:root {
    color-scheme: dark;
    --background: #060d19;
    --surface: #0a1424;
    --surface-raised: #0e1b2f;
    --surface-muted: #101e33;
    --border: rgba(151, 181, 218, .14);
    --border-strong: rgba(151, 181, 218, .24);
    --text: #f2f6ff;
    --muted: #8290a8;
    --subtle: #aab6c8;
    --primary: #27baff;
    --primary-deep: #087ddd;
    --purple: #946cff;
    --green: #36d7a0;
    --amber: #ffbd69;
    --red: #ff6d7c;
    --radius: 20px;
    --shell-width: 1420px;
    font-family: Tahoma, "Noto Sans Thai", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 340px; min-height: 100dvh; background: radial-gradient(ellipse at 80% 0%, rgba(37, 92, 177, .14), transparent 38%), var(--background); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
svg { flex: 0 0 auto; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.text-right { text-align: right; }
.stack { display: grid; gap: 16px; }
.hide-mobile { display: initial; }

.auth-page { display: grid; place-items: center; padding: 30px 18px; }
.auth-panel { width: min(100%, 420px); padding: 38px 30px; border: 1px solid var(--border); border-radius: 28px; background: linear-gradient(165deg, rgba(18, 35, 61, .92), rgba(8, 15, 27, .98)); box-shadow: 0 28px 100px rgba(0, 0, 0, .34); }
.auth-panel h1 { margin: 18px 0 5px; font-size: 2rem; letter-spacing: -.04em; }
.auth-panel > .muted { margin: 0 0 25px; }
.install-panel { width: min(100%, 480px); }

.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr) 332px; width: min(100%, var(--shell-width)); min-height: 100dvh; margin: 0 auto; }
.sidebar { position: sticky; top: 0; height: 100dvh; padding: 25px 16px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 24px; background: rgba(6, 13, 25, .65); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 7px; }
.brand strong { display: block; font-size: 1.07rem; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: .74rem; }
.assistant-avatar { position: relative; display: grid; flex: 0 0 45px; place-items: center; width: 45px; height: 45px; border: 1px solid rgba(58, 166, 249, .42); border-radius: 50%; color: #dff3ff; background: radial-gradient(circle at 35% 30%, #2b9bfc, #0e428b 54%, #08224e); box-shadow: inset 0 0 0 5px rgba(255, 255, 255, .035); }
.assistant-avatar::after { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border: 2px solid var(--surface); border-radius: 50%; content: ''; background: var(--green); }
.assistant-avatar--large { width: 64px; height: 64px; }
.assistant-avatar--large .icon { width: 32px; height: 32px; }
.assistant-avatar img, .message-avatar img { display: block; width: 100% !important; height: 100% !important; max-width: 100% !important; max-height: 100% !important; border-radius: inherit; object-fit: cover; object-position: center 28%; }
.nav { display: grid; gap: 5px; }
.nav a, .menu-link { position: relative; display: flex; align-items: center; min-height: 46px; padding: 0 12px; border: 1px solid transparent; border-radius: 12px; gap: 11px; color: var(--subtle); transition: .18s ease; }
.nav a:hover, .menu-link:hover, .nav a.is-active { border-color: rgba(48, 153, 245, .19); color: #eaf7ff; background: linear-gradient(90deg, rgba(32, 123, 229, .19), rgba(32, 123, 229, .035)); }
.nav-section-label { margin: 12px 9px 6px; color: var(--muted); font-size: .74rem; }
.nav-count { margin-left: auto; padding: 3px 7px; border-radius: 20px; background: rgba(245, 97, 115, .16); color: #ff8794; font-size: .7rem; }
.sidebar-profile { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 12px 8px; border-top: 1px solid var(--border); }
.person-avatar { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; border-radius: 13px; font-size: .96rem; font-weight: 700; color: white; background: var(--avatar-color, #087ddd); }
.sidebar-profile strong, .sidebar-profile span { display: block; max-width: 154px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-profile strong { font-size: .83rem; }
.sidebar-profile span { margin-top: 4px; color: var(--muted); font-size: .72rem; }

.main-panel { min-width: 0; min-height: 100dvh; border-right: 1px solid var(--border); }
.topbar { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 80px; padding: 0 22px; border-bottom: 1px solid var(--border); background: rgba(7, 15, 27, .89); backdrop-filter: blur(18px); }
.topbar-title { display: flex; align-items: center; gap: 12px; }
.topbar-title h1 { margin: 0; font-size: 1.18rem; }
.topbar-title p { margin: 4px 0 0; color: var(--muted); font-size: .76rem; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-button { position: relative; display: grid; flex: 0 0 auto; place-items: center; width: 40px; height: 40px; border: 1px solid transparent; border-radius: 12px; color: var(--subtle); background: transparent; }
.icon-button:hover { border-color: var(--border); color: white; background: var(--surface-raised); }
.icon-button .badge { position: absolute; top: 0; right: -2px; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 12px; background: #ec5460; color: white; font-size: .64rem; }
.back-link { display: grid; place-items: center; width: 38px; height: 38px; margin-left: -8px; border-radius: 11px; color: var(--subtle); }

.chat-layout { display: flex; flex-direction: column; min-height: calc(100dvh - 80px); }
.chat-stream { display: flex; flex: 1; flex-direction: column; gap: 15px; padding: 24px 22px 18px; }
.day-label { align-self: center; margin: 6px 0; color: var(--muted); font-size: .77rem; }
.message-row { display: flex; align-items: flex-end; max-width: 90%; gap: 9px; }
.message-row--user { align-self: flex-end; flex-direction: row-reverse; }
.message-avatar { display: grid; flex: 0 0 31px; place-items: center; width: 31px; height: 31px; border: 1px solid rgba(53, 138, 233, .35); border-radius: 50%; color: #9bdcff; background: #10366a; }
.message-avatar .icon { width: 16px; height: 16px; }
.bubble { max-width: min(760px, 100%); padding: 10px 13px; overflow-wrap: anywhere; word-break: break-word; border: 1px solid rgba(151, 181, 218, .11); border-radius: 17px 17px 17px 5px; white-space: pre-wrap; line-height: 1.65; background: var(--surface-raised); }
/* External links inside chat: compact inline pill. Do not alter message line spacing/layout. */
.chat-external-link { display: inline-flex; align-items: center; gap: 5px; max-width: min(100%, 320px); margin: 1px 3px; padding: 3px 8px; overflow: hidden; border: 1px solid rgba(83, 178, 255, .48); border-radius: 8px; color: #a9ddff; background: rgba(15, 104, 180, .16); box-shadow: none; font-size: .86em; font-weight: 700; line-height: 1.35; text-decoration: none; vertical-align: baseline; }
.chat-external-link__icon { display: inline-grid; flex: 0 0 17px; place-items: center; width: 17px; height: 17px; border-radius: 5px; color: #e7f7ff; background: rgba(56, 189, 248, .18); font-size: 10px; }
.chat-external-link__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-external-link:hover { border-color: rgba(83, 178, 255, .78); color: #e6f6ff; background: rgba(26, 122, 203, .28); }
.bubble .chat-external-link + br { display: none; }
@media (max-width: 640px) { .chat-external-link { max-width: min(100%, 280px); } .chat-external-link__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
.message-row--user .bubble { border-color: rgba(89, 185, 255, .26); border-radius: 17px 17px 5px 17px; background: linear-gradient(135deg, #0c83da, #085cbc); }

.message-row--processing .bubble { min-width: 210px; color: #dbeafe; }
.message-row--processing .message-avatar img { display:block; width:31px; height:31px; border-radius:50%; object-fit:cover; }
.processing-bubble { display:flex; align-items:center; gap:9px; }
.thinking-dots { display:inline-flex; align-items:center; gap:4px; min-width:34px; }
.thinking-dots i { width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.35; animation:lalin-thinking 1.15s infinite ease-in-out; }
.thinking-dots i:nth-child(2) { animation-delay:.16s; }
.thinking-dots i:nth-child(3) { animation-delay:.32s; }
@keyframes lalin-thinking { 0%, 80%, 100% { transform:translateY(0); opacity:.3; } 40% { transform:translateY(-4px); opacity:1; } }
.chat-composer[aria-busy="true"] .send-button { opacity:.55; cursor:wait; }
.message-time { margin: 4px 3px 0; text-align: right; color: var(--muted); font-size: .66rem; }
.message-meta { display: flex; align-items: center; justify-content: flex-end; min-height: 18px; margin-top: 4px; gap: 7px; }
.message-meta .message-time { margin: 0 3px 0 0; }
.message-source { padding: 2px 7px; border-radius: 10px; color: #a1d6ff; background: rgba(49, 140, 238, .14); font-size: .61rem; }
.message-source--ai { color: #8ceecb; background: rgba(41, 190, 136, .14); }
.message-source--ai_unavailable { color: #ffacb2; background: rgba(224, 76, 88, .14); }
.welcome-copy { margin-left: 40px; line-height: 1.7; color: var(--subtle); }
.event-card { display: block; margin-left: 40px; overflow: hidden; border: 1px solid rgba(73, 156, 245, .27); border-radius: 19px; background: linear-gradient(130deg, rgba(24, 92, 177, .23), rgba(16, 24, 50, .66) 76%); }
.event-card--purple { border-color: rgba(152, 104, 255, .29); background: linear-gradient(135deg, rgba(97, 48, 168, .22), rgba(20, 18, 46, .72)); }
.event-card-body { display: flex; align-items: flex-start; gap: 12px; padding: 16px; }
.event-type-icon { display: grid; flex: 0 0 auto; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 13px; color: white; background: var(--event-color, #168dff); }
.event-time { margin: 0 0 2px; font-size: 1.9rem; font-weight: 700; letter-spacing: -.08em; line-height: 1; }
.event-card h3 { margin: 6px 0 3px; font-size: 1rem; }
.event-card p { margin: 3px 0 0; color: var(--subtle); font-size: .82rem; }
.event-card-footer { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 14px 70px; gap: 9px; }
.event-role { color: var(--subtle); font-size: .76rem; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 0 40px; }
.quick-chip { padding: 8px 11px; border: 1px solid var(--border); border-radius: 16px; color: var(--subtle); background: rgba(14, 27, 47, .65); font-size: .78rem; }
.quick-chip:hover { border-color: rgba(60, 164, 249, .46); color: #d9eeff; }
.chat-composer { position: sticky; bottom: 0; display: flex; align-items: center; padding: 12px 17px max(13px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border); gap: 9px; background: rgba(7, 15, 27, .93); backdrop-filter: blur(16px); }
.composer-input { flex: 1; min-width: 0; height: 48px; padding: 0 15px; border: 1px solid var(--border); border-radius: 17px; outline: none; color: var(--text); background: #101c2d; }
.composer-input:focus { border-color: rgba(49, 169, 249, .6); }
.send-button { display: grid; place-items: center; width: 45px; height: 45px; border: 0; border-radius: 50%; color: white; background: linear-gradient(135deg, #24c0fa, #0676df); }
.send-button:disabled { opacity: .5; }

.right-panel { position: sticky; top: 0; height: 100dvh; padding: 25px 20px; overflow-y: auto; }
.side-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.side-heading h2 { margin: 0; font-size: .92rem; }
.calendar-date { display: grid; place-items: center; width: 56px; height: 61px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-raised); }
.calendar-date strong { font-size: 1.28rem; }
.calendar-date small { color: var(--muted); font-size: .69rem; }
.side-event { display: flex; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.side-event strong { display: block; font-size: .83rem; line-height: 1.5; }
.side-event p { margin: 5px 0 0; color: var(--muted); font-size: .75rem; }
.side-block { margin-top: 30px; }
.readiness-row { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: .79rem; }
.progress { height: 6px; margin-top: 9px; overflow: hidden; border-radius: 20px; background: #18263b; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #087bdd, #37d9b0); }

.page-content { padding: 22px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; }
.page-heading h2 { margin: 0; font-size: 1.15rem; }
.page-heading p { margin: 5px 0 0; color: var(--muted); font-size: .8rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.group-picker { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-bottom: 13px; }
.group-picker > .field { flex: 1 1 220px; margin: 0; }
.group-picker > .button { min-height: 40px; }
.tab-chip { padding: 8px 11px; border: 1px solid var(--border); border-radius: 12px; color: var(--subtle); background: var(--surface-raised); font-size: .76rem; }
.tab-chip.is-active { border-color: rgba(32, 159, 255, .48); color: white; background: linear-gradient(135deg, rgba(8, 126, 218, .58), rgba(12, 73, 147, .56)); }
.notice { padding: 12px 13px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: 13px; color: var(--subtle); background: var(--surface-raised); font-size: .85rem; line-height: 1.55; }
.notice--success { border-color: rgba(59, 218, 159, .29); color: #a7f6db; background: rgba(37, 144, 109, .12); }
.notice--danger { border-color: rgba(255, 101, 120, .32); color: #ffb2ba; background: rgba(169, 53, 68, .15); }

.notification-list, .event-list, .document-list, .agenda-list, .task-list { display: grid; gap: 11px; }
.notification-card { display: flex; padding: 14px; border: 1px solid var(--border); border-radius: 16px; gap: 11px; background: rgba(12, 23, 39, .8); }
.notification-card.unread { border-color: rgba(57, 153, 242, .23); background: linear-gradient(115deg, rgba(18, 52, 95, .36), rgba(12, 23, 39, .8)); }
.notification-card__button { display: flex; align-items: center; width: 100%; padding: 0; border: 0; gap: 11px; color: inherit; font: inherit; text-align: left; background: transparent; cursor: pointer; }
.notification-icon { display: grid; flex: 0 0 auto; place-items: center; width: 43px; height: 43px; border-radius: 14px; color: white; background: rgba(50, 138, 236, .75); }
.notification-icon--success { background: rgba(42, 175, 122, .75); }
.notification-icon--urgent { background: rgba(226, 79, 92, .75); }
.notification-icon--important { background: rgba(137, 87, 215, .78); }
.notification-copy { flex: 1; min-width: 0; }
.notification-copy h3 { margin: 0; font-size: .88rem; line-height: 1.45; }
.notification-copy p { margin: 5px 0 0; color: var(--subtle); font-size: .77rem; line-height: 1.55; }
.notification-copy time { display: block; margin-top: 7px; color: var(--muted); font-size: .68rem; }
.unread-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: #f26976; }

.manage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.manage-card { min-height: 111px; padding: 15px; border: 1px solid var(--border); border-radius: 17px; background: linear-gradient(145deg, rgba(25, 66, 124, .3), rgba(12, 20, 37, .65)); }
.manage-card:nth-child(2) { background: linear-gradient(145deg, rgba(82, 52, 145, .34), rgba(14, 20, 37, .65)); }
.manage-card:nth-child(3) { background: linear-gradient(145deg, rgba(29, 113, 90, .25), rgba(14, 20, 37, .65)); }
.manage-card:nth-child(4) { background: linear-gradient(145deg, rgba(126, 91, 37, .29), rgba(14, 20, 37, .65)); }
.manage-card .icon { width: 23px; height: 23px; color: #84cfff; }
.manage-card strong { display: block; margin-top: 12px; font-size: .88rem; }
.manage-card small { display: block; margin-top: 4px; color: var(--muted); font-size: .7rem; }
.create-event-card { display: flex; align-items: center; min-height: 94px; padding: 18px; margin-bottom: 13px; border: 1px solid rgba(44, 166, 245, .4); border-radius: 18px; gap: 14px; background: linear-gradient(125deg, rgba(10, 132, 221, .38), rgba(34, 84, 185, .2)); }
.create-event-card__icon { display: grid; flex: 0 0 auto; place-items: center; width: 48px; height: 48px; border-radius: 15px; color: white; background: linear-gradient(135deg, #0aa7e5, #176ce5); }
.create-event-card > span:nth-child(2) { flex: 1; min-width: 0; }
.create-event-card strong, .create-event-card small { display: block; }
.create-event-card strong { font-size: .94rem; }
.create-event-card small { margin-top: 5px; color: var(--subtle); font-size: .73rem; line-height: 1.45; }
.create-event-card > .icon { color: #8edbff; }
.work-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 20px; border: 1px solid var(--border); border-radius: 15px; overflow: hidden; background: rgba(12, 22, 37, .65); }
.work-shortcuts a { display: flex; align-items: center; min-width: 0; padding: 13px; border-right: 1px solid var(--border); gap: 9px; }
.work-shortcuts a:last-child { border-right: 0; }
.work-shortcuts .icon { flex: 0 0 auto; color: #77cfff; }
.work-shortcuts strong, .work-shortcuts small { display: block; }
.work-shortcuts strong { font-size: .77rem; }
.work-shortcuts small { margin-top: 3px; color: var(--muted); font-size: .66rem; }

.panel { padding: 17px; border: 1px solid var(--border); border-radius: 17px; background: rgba(12, 22, 37, .84); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 13px; }
.section-title h3 { margin: 0; font-size: .91rem; }
.section-title a { color: #67c9ff; font-size: .77rem; }
.compact-event { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.compact-event:last-child { border-bottom: 0; }
.compact-event-content { flex: 1; min-width: 0; }
.compact-event-content strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.compact-event-content p { margin: 5px 0 0; color: var(--muted); font-size: .74rem; }
.status-badge { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 20px; font-size: .68rem; white-space: nowrap; }
.status-badge--pending, .status-badge--draft { color: #ffd39a; background: rgba(231, 157, 59, .13); }
.status-badge--ready, .status-badge--completed, .status-badge--approved { color: #8ceecb; background: rgba(41, 190, 136, .15); }
.status-badge--in_progress, .status-badge--submitted { color: #a1d6ff; background: rgba(49, 140, 238, .15); }
.status-badge--cancelled { color: #ffacb2; background: rgba(224, 76, 88, .14); }
.status-badge--accepted { color: #8ceecb; background: rgba(41, 190, 136, .15); }
.status-badge--declined { color: #ffacb2; background: rgba(224, 76, 88, .14); }
.status-badge--delegated { color: #a1d6ff; background: rgba(49, 140, 238, .15); }

.form-stack { display: grid; gap: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.field { display: grid; min-width: 0; gap: 7px; }
.field > span { color: var(--subtle); font-size: .8rem; }
.field input, .field select, .field textarea { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 11px; outline: none; color: var(--text); background: #0a1525; }
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(61, 169, 247, .7); }
.key-monitor { display: grid; gap: 13px; padding: 15px; border: 1px solid var(--border); border-radius: 14px; background: rgba(8, 17, 30, .64); }
.key-monitor__heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.key-monitor__heading strong { font-size: .84rem; }
.key-monitor__heading > span { color: var(--muted); font-size: .74rem; }
.key-monitor__summary { display: flex; flex-wrap: wrap; gap: 7px; }
.key-counter { padding: 5px 9px; border-radius: 20px; font-size: .7rem; }
.key-counter--active { color: #8ceecb; background: rgba(41, 190, 136, .15); }
.key-counter--standby { color: #a1d6ff; background: rgba(49, 140, 238, .15); }
.key-counter--quota, .key-counter--error { color: #ffacb2; background: rgba(224, 76, 88, .14); }
.key-monitor__list { display: grid; gap: 8px; }
.key-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; border: 1px solid var(--border); border-radius: 11px; gap: 12px; background: #0a1525; }
.key-row__identity, .key-row__details { display: grid; gap: 5px; }
.key-row__identity strong { font-size: .77rem; }
.key-row__identity code { color: var(--muted); font-size: .7rem; }
.key-row__details { justify-items: end; }
.key-row__details small { color: var(--muted); font-size: .67rem; }
.key-row__details .key-error-hint { max-width: 360px; color: #ffb7bd; line-height: 1.4; text-align: right; }
.field-full { grid-column: 1 / -1; }
.required { color: var(--red); }
.check-field { display: flex; align-items: center; gap: 9px; color: var(--subtle); font-size: .81rem; }
.check-field input { accent-color: #1aaff7; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 13px; border: 1px solid var(--border); border-radius: 11px; gap: 7px; color: var(--text); background: var(--surface-raised); font-size: .81rem; }
.button:hover { border-color: rgba(92, 172, 242, .47); }
.button--primary { border-color: transparent; color: white; background: linear-gradient(110deg, #079edc, #156de4); }
.button--success { border-color: transparent; color: white; background: linear-gradient(110deg, #129775, #20bc86); }
.button--block { width: 100%; min-height: 46px; }
.button--small { min-height: 32px; padding: 0 9px; border-radius: 9px; font-size: .75rem; }
.button--ghost { background: transparent; }
.button--danger { border-color: rgba(224, 76, 88, .35); color: #ffd5d8; background: rgba(188, 53, 70, .2); }
.button-row, .chat-action-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chat-action-group { margin-top: 12px; }
.chat-action-group form, .button-row form { margin: 0; }
.optional-details { padding: 13px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.optional-details summary, .panel > summary { cursor: pointer; font-size: .83rem; font-weight: 600; }
.optional-details summary .small { margin-left: 7px; font-weight: 400; }
.simple-steps { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 15px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: rgba(10, 21, 37, .65); }
.simple-steps span { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px; border-right: 1px solid var(--border); gap: 7px; color: var(--muted); font-size: .72rem; text-align: center; }
.simple-steps span:last-child { border-right: 0; }
.simple-steps b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #172943; }
.simple-steps .is-current { color: #dff6ff; background: rgba(21, 121, 205, .16); }
.simple-steps .is-current b { color: white; background: #118bd8; }
.form-section--primary { padding: 17px; margin-top: 0; border: 1px solid var(--border); border-radius: 15px; background: rgba(12, 22, 37, .74); }
.form-section--inside { margin-top: 12px; padding-top: 0; border-top: 0; }
.intake-panel .section-title h3, .conflict-panel .section-title h3 { display: inline-flex; align-items: center; gap: 8px; }
.intake-panel .section-title h3 .icon { color: #72cbff; }
.conflict-panel { border-color: rgba(231, 109, 113, .38); }
.conflict-panel .readiness-card + .readiness-card { margin-top: 9px; }
.delegation-panel { border-color: rgba(61, 169, 247, .38); }
.person-pill--delegated { opacity: .58; }
.form-section { margin-top: 19px; padding-top: 17px; border-top: 1px solid var(--border); }
.form-section h3 { margin: 0 0 13px; font-size: .9rem; }
.person-picker { display: grid; gap: 8px; max-height: 420px; overflow-y: auto; }
.person-option { padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.person-main { display: flex; align-items: center; gap: 9px; }
.person-main input[type="checkbox"] { accent-color: #1aaff7; }
.person-info { flex: 1; min-width: 0; }
.person-info strong { display: block; font-size: .8rem; }
.person-info span { display: block; margin-top: 3px; color: var(--muted); font-size: .72rem; }
.person-role { display: grid; gap: 7px; margin-top: 9px; }
.person-role input { width: 100%; min-height: 35px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 9px; color: var(--text); background: #0b1627; font-size: .76rem; }
.related-document-fields { display: grid; gap: 9px; margin-top: 12px; }
.related-document-field { display: grid; grid-template-columns: minmax(150px, .75fr) 1.25fr; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.related-document-field span, .related-document-field small { display: block; }
.related-document-field strong { font-size: .82rem; }
.related-document-field small { margin-top: 3px; color: var(--muted); font-size: .7rem; }
.related-document-field input { width: 100%; }
@media (max-width: 620px) { .related-document-field { grid-template-columns: 1fr; } }

.event-hero { padding: 18px; border: 1px solid var(--border); border-radius: 18px; background: linear-gradient(130deg, rgba(26, 78, 148, .22), rgba(11, 22, 39, .88)); }
.event-hero h2 { margin: 12px 0 7px; font-size: 1.17rem; line-height: 1.5; }
.event-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; color: var(--subtle); font-size: .78rem; }
.event-meta span { display: inline-flex; align-items: center; gap: 5px; }
.event-meta .icon { width: 15px; height: 15px; }
.readiness-card { display: flex; align-items: center; justify-content: space-between; padding: 12px; border: 1px solid var(--border); border-radius: 13px; gap: 12px; background: var(--surface); }
.readiness-card strong { display: block; font-size: .83rem; }
.readiness-card p { margin: 5px 0 0; color: var(--muted); font-size: .75rem; }
.readiness-percent { font-size: 1.12rem; font-weight: 700; color: var(--green); }
.missing-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; margin: 4px 5px 0 0; border-radius: 12px; color: #ffc397; background: rgba(217, 128, 51, .15); font-size: .7rem; }
.agenda-item, .document-item, .task-item { display: flex; align-items: flex-start; gap: 10px; padding: 11px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.item-copy { flex: 1; min-width: 0; }
.item-copy strong { display: block; font-size: .81rem; line-height: 1.5; }
.item-copy p { margin: 4px 0 0; color: var(--muted); font-size: .73rem; line-height: 1.55; }
.file-symbol { display: grid; place-items: center; width: 37px; height: 42px; border-radius: 9px; color: white; background: #d94955; }
.person-pill { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; }
.person-pill .person-avatar { width: 32px; height: 32px; border-radius: 10px; }
.people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.person-pill strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; }
.person-pill span { display: block; margin-top: 3px; color: var(--muted); font-size: .68rem; }
.inline-form { display: grid; gap: 11px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.empty-state { padding: 28px 14px; text-align: center; color: var(--muted); }
.empty-state .icon { width: 33px; height: 33px; color: #5c718c; }
.empty-state p { margin: 10px 0 0; font-size: .82rem; line-height: 1.6; }

.user-card { display: flex; align-items: center; gap: 11px; padding: 11px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.user-card-copy { flex: 1; min-width: 0; }
.user-card-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .83rem; }
.user-card-copy p { margin: 5px 0 0; color: var(--muted); font-size: .72rem; }
.stats-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 18px; }
.stat { padding: 12px 10px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.stat strong { display: block; font-size: 1.21rem; }
.stat span { display: block; margin-top: 5px; color: var(--muted); font-size: .69rem; }

.bottom-nav { display: none; }

@media (max-width: 1150px) {
    .app-shell { grid-template-columns: 228px minmax(0, 1fr); }
    .right-panel { display: none; }
    .main-panel { border-right: 0; }
}

@media (max-width: 740px) {
    .work-shortcuts { grid-template-columns: 1fr; }
    .work-shortcuts a { border-right: 0; border-bottom: 1px solid var(--border); }
    .work-shortcuts a:last-child { border-bottom: 0; }
    .simple-steps span { padding: 7px 4px; font-size: .65rem; }
    body { background: var(--background); }
    .app-shell { display: block; min-height: 100dvh; }
    .sidebar { display: none; }
    .main-panel { min-height: 100dvh; }
    .topbar { min-height: 73px; padding: 0 14px; }
    .topbar-title h1 { font-size: 1.06rem; }
    .topbar-title p { font-size: .72rem; }
    .chat-layout { min-height: calc(100dvh - 73px); }
    .chat-stream { padding: 20px 14px 16px; }
    .event-card, .welcome-copy, .quick-actions { margin-left: 35px; }
    .message-row { max-width: 94%; }
    .event-card-body { padding: 14px; }
    .event-card-footer { padding-left: 64px; }
    .event-time { font-size: 1.72rem; }
    .chat-composer { padding-right: 12px; padding-left: 12px; }
    .page-content { padding: 16px 14px calc(82px + env(safe-area-inset-bottom)); }
    .bottom-nav { position: fixed; z-index: 9; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); padding: 7px 7px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: rgba(7, 15, 27, .96); backdrop-filter: blur(16px); }
    .bottom-nav a { display: grid; justify-items: center; gap: 4px; padding: 5px 3px; border-radius: 10px; color: var(--muted); font-size: .63rem; }
    .bottom-nav a.active { color: #72cfff; background: rgba(33, 131, 231, .12); }
    .bottom-nav .icon { width: 19px; height: 19px; }
    .chat-page .bottom-nav { display: none; }
    .hide-mobile { display: none; }
    .people-grid { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
    .form-grid { grid-template-columns: 1fr; }
    .field-full { grid-column: auto; }
    .manage-grid { gap: 9px; }
    .manage-card { padding: 13px 10px; }
    .stats-row { gap: 7px; }
    .stat { padding: 11px 8px; }
}

@media print {
    body { color: #111; background: #fff; }
    .sidebar, .right-panel, .topbar-actions, .bottom-nav, .no-print, .chat-composer { display: none !important; }
    .app-shell { display: block; max-width: none; }
    .main-panel, .topbar, .panel, .event-hero, .agenda-item { border-color: #ccc; color: #111; background: white; }
    .muted, .event-meta, .item-copy p { color: #555; }
}

/* Lalin notification core */
.lalin-notification-stack{position:fixed;top:max(18px,env(safe-area-inset-top));right:18px;z-index:9999;width:min(390px,calc(100vw - 28px));display:grid;gap:10px;pointer-events:none}
.lalin-notification-toast{pointer-events:auto;display:grid;grid-template-columns:38px 1fr 28px;align-items:start;gap:10px;padding:13px 12px;border:1px solid rgba(103,211,255,.26);border-radius:16px;background:rgba(7,18,34,.96);box-shadow:0 18px 50px rgba(0,0,0,.34);backdrop-filter:blur(16px);text-decoration:none;color:#eef9ff;animation:lalinToastIn .22s ease-out}
.lalin-notification-toast--important{border-color:rgba(255,190,80,.45)}
.lalin-notification-toast--urgent{border-color:rgba(255,93,124,.7);box-shadow:0 18px 55px rgba(255,65,105,.14)}
.lalin-notification-toast--success{border-color:rgba(68,220,171,.5)}
.lalin-notification-icon{display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:rgba(53,203,183,.14);font-size:20px}
.lalin-notification-copy{display:grid;gap:4px;min-width:0}.lalin-notification-copy strong{font-size:.92rem;line-height:1.35}.lalin-notification-copy span{font-size:.82rem;line-height:1.55;color:#bcd0df;white-space:pre-line}
.lalin-notification-copy .lalin-notification-preview{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden;overflow-wrap:anywhere}
.lalin-notification-copy .lalin-notification-detail{color:#67d3ff;font-size:.76rem;font-weight:700;margin-top:3px}
.lalin-notification-toast button{border:0;background:transparent;color:#9fb1bf;font-size:22px;line-height:1;cursor:pointer;padding:0}
.notification-device-actions{display:flex;gap:9px;flex-wrap:wrap;margin:14px 0 10px}.notification-sound-toggle{margin-top:10px}
@keyframes lalinToastIn{from{opacity:0;transform:translateY(-8px) scale(.98)}to{opacity:1;transform:none}}
@media(max-width:640px){.lalin-notification-stack{left:14px;right:14px;top:max(12px,env(safe-area-inset-top));width:auto}.lalin-notification-toast{border-radius:15px}}

/* Global per-device Push enrollment. Kept isolated so legacy pages remain unaffected. */
.lalin-push-enrollment{position:fixed;left:50%;bottom:max(18px,env(safe-area-inset-bottom));transform:translateX(-50%);z-index:9998;width:min(760px,calc(100vw - 28px));display:grid;grid-template-columns:46px 1fr auto;gap:12px;align-items:center;padding:13px 14px;border:1px solid rgba(53,203,183,.34);border-radius:18px;background:rgba(7,18,34,.97);box-shadow:0 20px 60px rgba(0,0,0,.42);backdrop-filter:blur(18px)}
.lalin-push-enrollment__icon{display:grid;place-items:center;width:46px;height:46px;border-radius:14px;background:rgba(53,203,183,.14);font-size:23px}
.lalin-push-enrollment__copy{display:grid;gap:3px;min-width:0}.lalin-push-enrollment__copy strong{font-size:.92rem;color:#effbff}.lalin-push-enrollment__copy span{font-size:.79rem;line-height:1.5;color:#a9c0d0}
@media(max-width:640px){.lalin-push-enrollment{grid-template-columns:40px 1fr;padding:12px;bottom:max(10px,env(safe-area-inset-bottom));border-radius:16px}.lalin-push-enrollment__icon{width:40px;height:40px}.lalin-push-enrollment .button{grid-column:1/-1;width:100%}}

/* Notification device quick-start: explicit control on Settings, isolated from legacy UI. */
.notification-device-quickstart{margin:14px 0;padding:14px;border:1px solid rgba(53,203,183,.28);border-radius:16px;background:rgba(53,203,183,.055)}
.notification-device-quickstart__copy{display:grid;gap:4px}.notification-device-quickstart__copy strong{font-size:.94rem;color:#effbff}.notification-device-quickstart__copy span{font-size:.8rem;line-height:1.55;color:#a9c0d0}

/* Persistent profile identity */
.person-avatar { overflow: hidden; }
.person-avatar__image { display:block; width:100%; height:100%; object-fit:cover; border-radius:inherit; }
.profile-avatar-form { margin-top:14px; }
.profile-avatar-delete { justify-content:center; margin-top:8px; }

/* V16: make external/news links visually distinct from message text without changing chat layout */
.chat-external-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: min(100%, 340px);
    margin: 3px 4px 3px 0;
    padding: 5px 10px;
    border: 1px solid rgba(74, 196, 255, .92);
    border-radius: 9px;
    color: #ffffff;
    background: rgba(9, 103, 172, .72);
    box-shadow: 0 0 0 1px rgba(91, 205, 255, .08), 0 4px 12px rgba(0,0,0,.16);
    font-size: .84em;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none;
    vertical-align: middle;
}
.chat-external-link__icon {
    display: inline-grid;
    flex: 0 0 20px;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    color: #06243a;
    background: #86dcff;
    font-size: 11px;
    font-weight: 900;
}
.chat-external-link__label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-external-link:hover,
.chat-external-link:focus-visible {
    border-color: #a7e8ff;
    color: #ffffff;
    background: rgba(12, 127, 207, .9);
    box-shadow: 0 0 0 2px rgba(78, 190, 255, .18), 0 5px 15px rgba(0,0,0,.2);
    outline: none;
}
@media (max-width: 640px) {
    .chat-external-link { max-width: min(100%, 300px); padding: 5px 9px; }
}

/* V17 — unify news source links across Chat + Notifications */
.notification-card--news{align-items:flex-start;max-width:100%;overflow:hidden}
.notification-copy--news{min-width:0;max-width:100%;width:100%}
.notification-copy--news h3{overflow-wrap:anywhere;word-break:break-word}
.notification-news-body{margin-top:8px;color:var(--subtle);font-size:.84rem;line-height:1.72;white-space:normal;overflow-wrap:anywhere;word-break:break-word;max-width:100%}
.notification-news-source{display:block;margin:2px 0 5px;color:var(--muted);font-size:.78rem}
.notification-news-source strong{color:var(--text)}
.notification-news-link{display:inline-flex;align-items:center;gap:7px;max-width:min(100%,420px);margin:6px 6px 4px 0;padding:8px 12px;border:1px solid rgba(67,183,255,.78);border-radius:10px;background:linear-gradient(180deg,rgba(14,116,190,.36),rgba(8,77,137,.32));box-shadow:0 0 0 1px rgba(69,174,255,.06) inset;color:#dff5ff!important;text-decoration:none!important;font-weight:800;font-size:.79rem;line-height:1.25;vertical-align:middle;overflow:hidden}
.notification-news-link span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.notification-news-link:hover{background:linear-gradient(180deg,rgba(25,145,230,.48),rgba(11,95,165,.42));border-color:#6fd1ff;transform:translateY(-1px)}
.notification-news-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:8px;padding-top:7px;border-top:1px solid rgba(148,163,184,.12)}

.chat-external-link{border-color:rgba(79,195,255,.9)!important;background:linear-gradient(180deg,rgba(19,137,218,.78),rgba(8,93,161,.78))!important;color:#fff!important;box-shadow:0 2px 8px rgba(0,91,164,.22)!important}
.chat-external-link:hover{border-color:#9be2ff!important;background:linear-gradient(180deg,rgba(31,158,241,.9),rgba(12,111,187,.9))!important}
.chat-external-link__label{font-weight:800!important}

@media(max-width:640px){.notification-card--news{padding:12px}.notification-news-link{max-width:100%;font-size:.77rem}.notification-news-body{font-size:.81rem}}

/* V5.5 — SDSS document action, isolated from Flow C/news styles */
.notification-card--document{align-items:flex-start;position:relative;max-width:100%;overflow:hidden}
.notification-copy--document{min-width:0;flex:1;max-width:100%}
.notification-copy--document h3{margin:0 0 5px;overflow-wrap:anywhere;word-break:break-word}
.notification-copy--document p{margin:0 0 10px;line-height:1.65;overflow-wrap:anywhere;word-break:break-word;white-space:normal}
.notification-copy--document time{display:block;margin-top:8px}
.notification-document-links{display:flex;align-items:center;gap:7px;flex-wrap:wrap;max-width:100%}
.notification-document-link{display:inline-flex;align-items:center;gap:6px;min-height:32px;max-width:min(100%,280px);padding:5px 10px;border:1px solid rgba(58,173,255,.78);border-radius:9px;background:linear-gradient(180deg,rgba(16,104,174,.72),rgba(10,73,128,.82));color:#fff!important;font:inherit;font-size:.76rem;font-weight:800;text-decoration:none!important;cursor:pointer;box-shadow:0 4px 12px rgba(0,116,204,.14);transition:transform .15s ease,border-color .15s ease,background .15s ease}
.notification-document-link:hover{transform:translateY(-1px);border-color:rgba(111,205,255,.98);background:linear-gradient(180deg,rgba(20,126,205,.82),rgba(12,88,151,.92))}
.notification-document-link__icon{display:grid;place-items:center;flex:0 0 20px;width:20px;height:20px;border-radius:6px;background:rgba(111,205,255,.25);font-size:12px;line-height:1}
.notification-document-link__label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:680px){.notification-copy--document{width:100%}.notification-document-link{max-width:100%}}
.website-role-field{border:1px solid var(--border);border-radius:14px;padding:14px}.website-role-field legend{padding:0 8px;color:var(--text-muted)}.website-role-options{display:flex;flex-wrap:wrap;gap:10px 18px}.website-directory-list{display:grid;gap:10px}.website-directory-item{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px;border:1px solid var(--border);border-radius:14px;background:rgba(5,17,34,.45)}.website-directory-item>div:first-child{display:grid;gap:5px;min-width:0}.website-directory-item a{overflow-wrap:anywhere}.website-directory-title{display:flex;align-items:center;gap:10px}.inline-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.inline-actions form{margin:0}@media(max-width:720px){.website-directory-item{align-items:flex-start;flex-direction:column}.website-directory-item>.inline-actions{width:100%}}

/* Lalin personnel contact card: tap/click to call from chat. */
.chat-phone-link{display:inline-flex;align-items:center;gap:7px;max-width:min(100%,330px);margin:3px 2px;padding:7px 11px;border:1px solid rgba(69,207,154,.62);border-radius:10px;background:rgba(22,163,116,.14);color:#bdf8dd;font-weight:800;line-height:1.3;text-decoration:none;vertical-align:middle}
.chat-phone-link__icon{display:inline-grid;place-items:center;width:23px;height:23px;flex:0 0 23px;border-radius:7px;background:rgba(69,207,154,.18);color:#e9fff5;font-size:13px}
.chat-phone-link:hover,.chat-phone-link:focus-visible{border-color:rgba(116,235,188,.95);background:rgba(22,163,116,.26);color:#fff;outline:none}
@media(max-width:640px){.chat-phone-link{max-width:100%;padding:8px 10px}}

/* Personal appointment RSVP — notification center + in-app toast only. */
.notification-card--appointment{align-items:flex-start}
.notification-copy--appointment{min-width:0;flex:1}
.notification-rsvp-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:10px}
.notification-rsvp-actions form{margin:0}
.notification-rsvp-status{display:block;margin-top:8px;color:var(--muted);font-size:.76rem;line-height:1.45}
.notification-card--appointment [aria-current="true"]{font-weight:800}

.lalin-notification-toast{grid-template-columns:minmax(0,1fr) 28px;gap:8px}
.lalin-notification-main{display:grid;grid-template-columns:38px minmax(0,1fr);gap:10px;align-items:start;min-width:0;color:inherit;text-decoration:none}
.lalin-notification-close{grid-column:2;grid-row:1;border:0!important;background:transparent!important;color:#9fb1bf!important;font-size:22px!important;line-height:1!important;cursor:pointer;padding:0!important}
.lalin-notification-rsvp{grid-column:1 / -1;display:flex;gap:8px;flex-wrap:wrap;padding-left:48px}
.lalin-rsvp-button{min-height:36px;padding:7px 11px;border:1px solid rgba(157,181,198,.34);border-radius:10px;background:rgba(255,255,255,.06);color:#eef9ff;font:inherit;font-size:.76rem;font-weight:800;cursor:pointer}
.lalin-rsvp-button:hover{background:rgba(255,255,255,.1)}
.lalin-rsvp-button:disabled{opacity:.58;cursor:wait}
.lalin-rsvp-button--accept.is-active{border-color:rgba(68,220,171,.62);background:rgba(68,220,171,.14)}
.lalin-rsvp-button--decline.is-active{border-color:rgba(255,93,124,.72);background:rgba(255,93,124,.13)}
@media(max-width:640px){.lalin-notification-rsvp{padding-left:0}.lalin-rsvp-button{min-height:40px;flex:1 1 120px}}
/* Override the legacy generic toast button rule for RSVP actions. */
.lalin-notification-toast .lalin-rsvp-button{min-height:36px;padding:7px 11px;border:1px solid rgba(157,181,198,.34);border-radius:10px;background:rgba(255,255,255,.06);color:#eef9ff;font:inherit;font-size:.76rem;line-height:1.25;font-weight:800;cursor:pointer}
.lalin-notification-toast .lalin-rsvp-button:hover{background:rgba(255,255,255,.1)}
.lalin-notification-toast .lalin-rsvp-button:disabled{opacity:.58;cursor:wait}
.lalin-notification-toast .lalin-rsvp-button--accept.is-active{border-color:rgba(68,220,171,.62);background:rgba(68,220,171,.14)}
.lalin-notification-toast .lalin-rsvp-button--decline.is-active{border-color:rgba(255,93,124,.72);background:rgba(255,93,124,.13)}

/* Light theme: user-selectable and persisted per device. */
html[data-theme="light"] {
    color-scheme: light;
    --background: #f4f7fb;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --surface-muted: #edf3fa;
    --border: rgba(38, 67, 103, .14);
    --border-strong: rgba(38, 67, 103, .25);
    --text: #142033;
    --muted: #64748b;
    --subtle: #475569;
    --primary: #078ad5;
    --primary-deep: #086bc2;
}
html[data-theme="light"] body { background: radial-gradient(ellipse at 80% 0%, rgba(42, 144, 224, .10), transparent 40%), var(--background); color: var(--text); }
html[data-theme="light"] .sidebar { background: rgba(255, 255, 255, .90); }
html[data-theme="light"] .topbar,
html[data-theme="light"] .chat-composer,
html[data-theme="light"] .bottom-nav { background: rgba(255, 255, 255, .94); }
html[data-theme="light"] .main-panel { background: rgba(249, 251, 254, .72); }
html[data-theme="light"] .right-panel { background: rgba(246, 249, 253, .72); }
html[data-theme="light"] .nav a:hover,
html[data-theme="light"] .menu-link:hover,
html[data-theme="light"] .nav a.is-active { color: #075ea8; background: linear-gradient(90deg, rgba(23, 131, 218, .13), rgba(23, 131, 218, .035)); }
html[data-theme="light"] .icon-button:hover { color: #075ea8; background: #edf5fc; }
html[data-theme="light"] .bubble { border-color: rgba(38, 67, 103, .13); box-shadow: 0 2px 10px rgba(33, 62, 99, .045); }
html[data-theme="light"] .message-row--user .bubble { color: #fff; background: linear-gradient(135deg, #1594e5, #0871c9); }
html[data-theme="light"] .message-row--processing .bubble { color: #27415f; }
html[data-theme="light"] .composer-input,
html[data-theme="light"] .field input,
html[data-theme="light"] .field select,
html[data-theme="light"] .field textarea,
html[data-theme="light"] .person-role input,
html[data-theme="light"] .key-row { color: var(--text); background: #fff; }
html[data-theme="light"] .quick-chip,
html[data-theme="light"] .work-shortcuts,
html[data-theme="light"] .panel,
html[data-theme="light"] .form-section--primary,
html[data-theme="light"] .simple-steps,
html[data-theme="light"] .key-monitor,
html[data-theme="light"] .notification-card,
html[data-theme="light"] .website-directory-item { background: #fff; }
html[data-theme="light"] .notification-card.unread { background: linear-gradient(115deg, #e9f5ff, #fff); }
html[data-theme="light"] .event-card { background: linear-gradient(130deg, #edf7ff, #fff 76%); }
html[data-theme="light"] .event-card--purple { background: linear-gradient(135deg, #f3efff, #fff); }
html[data-theme="light"] .manage-card { background: linear-gradient(145deg, #eaf4ff, #fff); }
html[data-theme="light"] .manage-card:nth-child(2) { background: linear-gradient(145deg, #f1edff, #fff); }
html[data-theme="light"] .manage-card:nth-child(3) { background: linear-gradient(145deg, #e9f8f2, #fff); }
html[data-theme="light"] .manage-card:nth-child(4) { background: linear-gradient(145deg, #fff5e6, #fff); }
html[data-theme="light"] .event-hero { background: linear-gradient(130deg, #eaf4ff, #fff); }
html[data-theme="light"] .progress { background: #dce6f0; }
html[data-theme="light"] .auth-panel { background: linear-gradient(165deg, #fff, #f3f7fc); box-shadow: 0 24px 70px rgba(33, 62, 99, .14); }
html[data-theme="light"] .notice--success { color: #147354; background: #e9f8f2; }
html[data-theme="light"] .notice--danger { color: #a33142; background: #fff0f2; }
html[data-theme="light"] .status-badge--pending,
html[data-theme="light"] .status-badge--draft { color: #8a560d; }
html[data-theme="light"] .status-badge--ready,
html[data-theme="light"] .status-badge--completed,
html[data-theme="light"] .status-badge--approved,
html[data-theme="light"] .status-badge--accepted { color: #147354; }
html[data-theme="light"] .status-badge--in_progress,
html[data-theme="light"] .status-badge--submitted,
html[data-theme="light"] .status-badge--delegated { color: #075ea8; }
html[data-theme="light"] .status-badge--cancelled,
html[data-theme="light"] .status-badge--declined { color: #a33142; }
html[data-theme="light"] .lalin-notification-toast,
html[data-theme="light"] .lalin-push-enrollment { color: #142033; background: rgba(255,255,255,.98); box-shadow: 0 18px 50px rgba(33,62,99,.18); }
html[data-theme="light"] .lalin-notification-close { color: #64748b!important; }
html[data-theme="light"] .lalin-rsvp-button,
html[data-theme="light"] .lalin-notification-toast .lalin-rsvp-button { color: #20324a; background: #f1f5f9; }
html[data-theme="light"] .theme-toggle { font-size: 1.18rem; }

/* Chat deletion controls. Server-side ownership checks remain authoritative. */
.message-delete-button {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    opacity: .72;
}
.message-delete-button:hover { color: #ff6b7f; background: rgba(255, 91, 118, .12); opacity: 1; }
.message-delete-button:disabled { cursor: wait; opacity: .35; }
.chat-clear-button { color: #ff8b9d; font-size: 1rem; }
.chat-clear-button:hover { color: #ff5b76 !important; background: rgba(255, 91, 118, .12) !important; }
html[data-theme="light"] .message-delete-button:hover,
html[data-theme="light"] .chat-clear-button:hover { color: #b4233b !important; background: #fff0f3 !important; }
