:root {
  color-scheme: light;
  --paper: #faf8f5;
  --white: #fffdfb;
  --ink: #282139;
  --muted: #676071;
  --line: #e9e2e8;
  --rail: #271e39;
  --highlight: #3e3058;
  --lilac: #eee7fc;
  --accent: #613fa0;
  --coral: #ffbaa0;
  --green: #2f6b57;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.5 system-ui, sans-serif; }
html[data-auth-required="true"] #app:not(.signed-in) { display: none; }
.sign-in { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.sign-in-card { display: grid; justify-items: start; gap: 14px; padding: 28px; width: min(100%, 400px); background: var(--white); border: 1px solid var(--line); border-radius: 16px; }
.sign-in-card img { border-radius: 12px; }
.sign-in-card h1, .sign-in-card p { margin: 0; }
.sign-in-card p { color: var(--muted); }
.sign-in-card a { color: var(--accent); }
.sign-in-card form { display: grid; gap: 12px; width: 100%; }
button, input, textarea, select { color: inherit; font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #a78aee; outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .6; }
button, .button { border: 0; border-radius: 10px; background: var(--lilac); min-height: 42px; padding: 8px 13px; font-weight: 650; }
button:hover { filter: brightness(.96); }
button.primary { background: var(--accent); color: white; }
button.quiet { background: transparent; }
button.outline { border: 1px solid var(--line); background: var(--white); }
button.square { display: grid; place-items: center; width: 42px; padding: 0; flex-shrink: 0; }
button.link { min-height: 32px; padding: 3px 0; color: var(--accent); background: transparent; text-align: left; }
.icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.app { display: grid; grid-template-columns: 244px minmax(0, 1fr) 282px; height: 100dvh; }
.rail { background: var(--rail); color: #fbf6ff; padding: 22px 14px 14px; display: flex; flex-direction: column; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 23px; font-size: 1rem; font-weight: 760; line-height: 1.25; }
.brand img { width: 43px; height: 43px; border-radius: 13px; border: 1px solid #624a78; }
.brand small { display: block; color: #cbbddd; font-size: .83rem; margin-top: 3px; font-weight: 500; }
.nav { display: grid; gap: 4px; }
.nav button, .room-link { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; }
.rail button { background: transparent; color: inherit; }
.rail button:is(:hover,[aria-current="page"]) { background: var(--highlight); }
.rail .nav button[aria-current="page"] { color: #ffcab4; }
.rail-rooms { overflow: auto; margin: 17px -4px 0 0; padding-right: 4px; }
.rail section { margin-bottom: 15px; }
.rail h2 { color: #d4c5e4; margin: 0; font-size: .85rem; font-weight: 650; }
.room-link { min-height: 38px; font-size: .9rem; font-weight: 525; padding-left: 9px; }
.room-link .label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail .room-link .icon { width: 16px; height: 16px; color: #c9b9ed; }
.group-title { display: flex; align-items: center; justify-content: space-between; padding-left: 9px; }
.group-title button { min-height: 32px; width: 32px; }
.rail-foot { margin-top: auto; padding-top: 11px; border-top: 1px solid #473a56; }
.profile-button { display: flex; align-items: center; gap: 8px; text-align: left; justify-content: space-between; width: 100%; }
.profile-name { flex: 1; }
.badge { background: #ffd4c1; color: #442439; border-radius: 999px; padding: 0 7px; font-size: .81rem; line-height: 1.6; margin-left: auto; }
.main { min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.top { flex: none; height: 76px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); background: var(--white); }
.top-body { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.top-title, .top-actions { display: flex; align-items: center; gap: 9px; min-width: 0; }
.top-actions { flex-shrink: 0; }
.connection-status { display: inline-flex; flex: none; align-items: center; gap: 5px; color: var(--muted); font-size: .8rem; }
.connection-status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #817a89; }
.connection-status[data-status="online"]::before { background: var(--green); }
.connection-status[data-status="offline"]::before { background: #b52f41; }
.mute-button[aria-pressed="true"] { color: var(--accent); background: var(--lilac); }
.top .muted-label { font-weight: 700; }
.heading { min-width: 0; }
.top h1 { font-size: 1.38rem; letter-spacing: -.035em; margin: 0; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .sub { color: var(--muted); font-size: .88rem; margin-top: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.assist-mark { width: 38px; height: 38px; border-radius: 11px; }
.content { min-height: 0; flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.chat { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.transcript { padding: 21px clamp(16px, 4vw, 46px) 12px; flex: 1; overflow: auto; overflow-anchor: none; }
.day-rule { margin: 7px 0 21px; color: var(--muted); font-size: .82rem; display: flex; gap: 12px; align-items: center; text-align: center; }
.day-rule::before, .day-rule::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.message { display: flex; align-items: start; gap: 11px; margin-bottom: 15px; }
.message:has(+ .message.continuation) { margin-bottom: 4px; }
.message.mine { flex-direction: row-reverse; }
.message-avatar { display: grid; justify-items: center; flex-shrink: 0; }
.avatar { position: relative; overflow: hidden; display: inline-grid; place-items: center; font-weight: 760; width: 37px; height: 37px; border-radius: 11px; color: #38244d; background: #ded0f8; flex-shrink: 0; font-size: .9rem; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.p2 { background: #f4cfbf; }
.avatar.p3 { background: #cce6da; }
.avatar.p4 { background: #f3e2a8; }
.avatar.small { width: 29px; height: 29px; border-radius: 9px; font-size: .8rem; }
:is([data-bubble="lavender"], [data-calendar-tone="lavender"]) { --bubble: #e9defa; --calendar-color: #a482c7; --calendar-solid: var(--calendar-color); --calendar-pastel: #f3edf7; --calendar-dark: #6d419b; }
:is([data-bubble="peach"], [data-calendar-tone="peach"]) { --bubble: #f9dfd3; --calendar-color: #ffab85; --calendar-dark: #a34326; }
:is([data-bubble="mint"], [data-calendar-tone="mint"]) { --bubble: #dbefe4; --calendar-color: #4dbd83; --calendar-solid: var(--calendar-color); --calendar-pastel: #e8f7ed; --calendar-dark: #28603d; }
:is([data-bubble="honey"], [data-calendar-tone="honey"]) { --bubble: #f5eac5; --calendar-color: #fac32c; --calendar-solid: var(--calendar-color); --calendar-pastel: #fdf6df; --calendar-dark: #755800; }
:is([data-bubble="sky"], [data-calendar-tone="sky"]) { --bubble: #dceafb; --calendar-color: #48ace2; --calendar-solid: var(--calendar-color); --calendar-pastel: #e8f5fb; --calendar-dark: #285b90; }
:is([data-bubble="rose"], [data-calendar-tone="rose"]) { --bubble: #f7dce8; --calendar-color: #f391b9; --calendar-dark: #912b55; }
:is([data-bubble="slate"], [data-calendar-tone="slate"]) { --bubble: #e2e7f0; --calendar-color: #a5b5ce; --calendar-dark: #46556a; }
:is([data-bubble="lilac"], [data-calendar-tone="lilac"]) { --bubble: #e2def7; --calendar-color: #a99aef; --calendar-dark: #53439a; }
:is([data-bubble="red"], [data-calendar-tone="red"]) { --bubble: #fad2d4; --calendar-color: #e73840; --calendar-solid: var(--calendar-color); --calendar-pastel: #fcedee; --calendar-dark: #a32e39; }
.message.assistant { --bubble: #eee6f5; }
.message.assistant.private { --bubble: #fcebe2; }
.message-content { display: flex; flex-direction: column; align-items: start; min-width: 0; max-width: min(77%, 620px); }
.mine .message-content { align-items: end; }
.message-meta { display: flex; gap: 3px 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 3px; }
.mine .message-meta, .mine .message-links { justify-content: end; }
.message-meta strong { font-size: .94rem; }
.message-meta time, .dim { color: var(--muted); font-size: .84rem; }
.privacy { color: #764333; font-size: .82rem; font-weight: 650; }
.message-bubble-row { position: relative; display: flex; align-items: start; gap: 4px; max-width: 100%; }
.mine .message-bubble-row { flex-direction: row-reverse; }
.message-bubble { position: relative; min-width: 0; max-width: 100%; border-radius: 14px; padding: 8px 12px; background: var(--bubble, #eee7fc); }
.message-bubble::before { content: ""; position: absolute; top: 9px; left: -6px; width: 8px; height: 12px; background: inherit; clip-path: polygon(100% 0, 100% 100%, 0 55%); }
.mine .message-bubble::before { left: auto; right: -6px; transform: scaleX(-1); }
.message-bubble a { color: #4f3285; text-underline-offset: 2px; }
.message-links { display: flex; gap: 0 12px; flex-wrap: wrap; }
.message-reactions, .reaction-picker { display: flex; flex-wrap: wrap; gap: 4px; }
.message-reactions { position: relative; margin-top: -10px; }
.mine .message-reactions { justify-content: end; }
button.reaction { min-width: 32px; min-height: 32px; padding: 2px 8px; border-radius: 999px; }
button.reaction[aria-pressed="true"] { background: #ded0f8; color: var(--accent); }
.reaction-picker { padding: 0 20px 20px; }
.reaction-picker button.reaction { min-width: 44px; min-height: 44px; }
.message-actions { position: absolute; z-index: 1; bottom: calc(100% - 8px); left: 0; display: flex; width: max-content;
  max-width: calc(100vw - 64px); align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--white); opacity: 0; pointer-events: none; }
.mine .message-actions { left: auto; right: 0; }
.message-actions button { min-height: 36px; padding: 4px 8px; }
.message.actions-open .message-actions, .message:has(:focus-visible) .message-actions { opacity: 1; pointer-events: auto; }
@media (hover: hover) {
  .message:hover .message-actions { opacity: 1; pointer-events: auto; }
}
@media (any-pointer: coarse) {
  .message-bubble { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
  .message-actions button { min-height: 44px; }
}
.message p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.compose { position: relative; margin: 0 clamp(12px, 4vw, 46px) 14px; padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: end; background: var(--white); border: 1px solid #d9cce8; border-radius: 13px; box-shadow: 0 2px 4px #40264b0a; }
.compose textarea { background: transparent; resize: none; border: none; min-width: 0; flex: 1; padding: 10px 8px; min-height: 44px; max-height: 110px; }
.compose textarea:focus-visible { outline-offset: -2px; border-radius: 7px; }
.compose .send { height: 44px; }
.emoji-suggestions { position: absolute; z-index: 1; inset: auto 0 calc(100% + 4px); display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 3px 12px #40264b20; }
.emoji-suggestions[hidden] { display: none; }
.emoji-suggestions button { min-width: 42px; padding: 4px; font-size: 1.3rem; }
.image-previews { flex: 0 0 100%; display: flex; gap: 7px; }
.image-previews[hidden] { display: none; }
.image-preview { position: relative; width: 54px; height: 54px; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; }
.image-preview button { position: absolute; top: 1px; right: 1px; width: 28px; min-height: 28px; color: var(--ink); background: var(--paper); }
.image-preview button .icon { width: 16px; height: 16px; }
.message-images { display: flex; flex-wrap: wrap; gap: 6px; }
.message p + .message-images { margin-top: 6px; }
.message-images a { max-width: 100%; }
.message-images img { display: block; width: auto; height: auto; max-width: min(100%, 320px); max-height: 280px; border-radius: 8px; }
.details { background: #f3edf6; border-left: 1px solid var(--line); padding: 22px 17px; overflow: auto; }
.details section + section { margin-top: 23px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.section-title h2 { font-size: 1rem; margin: 0; }
.side-card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 4px 11px; }
.side-card button { background: transparent; display: flex; text-align: left; width: 100%; align-items: center; gap: 9px; font-weight: 600; padding: 8px 2px; }
.side-card button + button { border-top: 1px solid var(--line); border-radius: 0; }
.side-card .dim { display: block; font-weight: 500; }
.side-card .date-chip { flex-shrink: 0; }
.date-chip { display: inline-grid; place-items: center; min-width: 34px; padding: 4px; color: #4c367a; background: var(--lilac); border-radius: 8px; font-size: .82rem; font-weight: 750; }
.scroll { overflow: auto; padding: clamp(14px, 3.5vw, 32px); }
.scroll h2 { font-size: 1.06rem; margin: 17px 0 9px; }
.empty { color: var(--muted); padding: 14px 0; margin: 0; }
.content > .empty { padding: 25px; }
.collection { display: grid; gap: 8px; }
.collection > button, .notice { display: flex; text-align: left; align-items: center; gap: 12px; background: var(--white); border: 1px solid var(--line); padding: 10px 14px; width: 100%; min-height: 48px; border-radius: 11px; font-weight: 600; }
.collection > button span:first-of-type, .notice .summary { flex: 1; }
.collection > button .avatar { flex: none; }
.collection .sub, .notice .sub { display: block; font-size: .87rem; font-weight: 500; color: var(--muted); }
[data-calendar-nav] { touch-action: pan-y pinch-zoom; user-select: none; }
.calendar-mode[aria-pressed="true"] { background: var(--lilac); color: var(--accent); }
.calendar-mode:not([aria-pressed="true"]) { color: var(--muted); }
.calendar-scroll { --calendar-inset: clamp(14px, 3.5vw, 32px); padding: 0 0 var(--calendar-inset); }
.calendar-agenda { padding-inline: var(--calendar-inset); }
.calendar-grid { display: grid; --calendar-divider: #d8d8db; --calendar-date-height: 24px; --calendar-event-height: 15px; border-block-end: 1px solid var(--calendar-divider); background: #fff; }
.calendar-grid:focus-visible { outline-offset: -3px; }
.calendar-weekdays, .calendar-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { text-align: center; color: #747479; font-size: .76rem; font-weight: 680; }
.calendar-weekdays > span { padding-block: 3px; }
.calendar-week { min-height: 58px; border-block-start: 1px solid var(--calendar-divider); grid-template-rows: var(--calendar-date-height) repeat(var(--calendar-preview-rows, 1), var(--calendar-event-height)) minmax(0, 1fr); }
.calendar-grid[data-calendar-view="month"] .calendar-week { grid-template-rows: var(--calendar-date-height) repeat(var(--calendar-preview-rows), var(--calendar-event-height)); }
.calendar-day { grid-row: 1 / -1; background: #fff; border-radius: 0; min-width: 0; min-height: 0; padding: 1px 0 0; display: flex; align-items: start; justify-content: center; color: #747479; font-size: .84rem; }
.calendar-weekdays > span:not(:last-child), .calendar-day:not(:last-of-type) { border-inline-end: 1px solid var(--calendar-divider); }
.calendar-day > span { display: grid; place-items: center; min-width: 21px; height: 21px; line-height: 1; }
.calendar-day.outside { background: #fbfbfc; }
.calendar-day[aria-pressed="true"] { background: #f3eff8; }
.calendar-day[aria-pressed="true"] > span { background: #e5ddef; color: #645d6d; border-radius: 50%; }
.calendar-day:focus-visible { outline-offset: -3px; }
.event-preview, .calendar-more { z-index: 1; min-width: 0; pointer-events: none; }
.event-preview { position: relative; isolation: isolate; display: flex; align-items: center; overflow: hidden; margin: 0 2px 1px; padding: 0 4px; border-radius: 3px; color: var(--calendar-dark, #242426); font-size: .72rem; font-weight: 680; line-height: 1; }
.event-preview-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-preview[data-kind="all-day"] { color: #fff; text-shadow: 0 1px 1px #0009, 0 0 2px #0009; }
.event-preview[data-kind="all-day"] .event-swatch > span { background: var(--calendar-solid, var(--calendar-dark, #59595e)); }
.event-preview[data-kind="timed"] .event-swatch > span { background: var(--calendar-pastel, var(--bubble, #bfbfbf)); }
.event-preview[data-kind="reminder"] { background: #fff; border: 1px solid currentColor; }
.event-preview.continues-from { margin-inline-start: 0; border-start-start-radius: 0; border-end-start-radius: 0; }
.event-preview.continues-into { margin-inline-end: 0; border-start-end-radius: 0; border-end-end-radius: 0; }
.calendar-more { align-self: center; text-align: center; color: #636366; font-size: .72rem; line-height: 1; font-weight: 720; }
.event-swatch { display: flex; overflow: hidden; }
.event-preview > .event-swatch { position: absolute; z-index: -1; inset: 0; }
.event-swatch > span { flex: 1; background: var(--calendar-color, #bfbfbf); }
.event-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 1px solid #28213930; }
.day-schedule-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 17px 0 9px; }
.day-schedule-heading h2 { margin: 0; }
.day-agenda { margin: 0; padding: 0 12px; list-style: none; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.day-agenda li + li { border-top: 1px solid var(--line); }
.agenda-event { display: grid; grid-template-columns: clamp(74px, 21vw, 118px) 4px minmax(0, 1fr); align-items: start; gap: 10px; width: 100%; min-height: 49px; padding: 10px 4px; text-align: left; background: transparent; }
.agenda-event:hover { background: var(--paper); }
.agenda-clock { display: grid; align-content: start; gap: 2px; color: var(--muted); font-size: .78rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; }
.agenda-clock > :first-child { color: var(--ink); }
.agenda-swatch { align-self: stretch; flex-direction: column; min-height: 24px; border-radius: 3px; }
.agenda-text { min-width: 0; overflow-wrap: anywhere; }
.agenda-text strong { display: block; font-size: .95rem; line-height: 1.2; }
.agenda-text .sub, .agenda-kind { display: block; margin-top: 3px; color: var(--muted); font-size: .79rem; }
.calendar-scroll .collection button > :is(.event-dot, .date-chip) { flex: none; }
.list-scroll .collection { gap: 4px; }
.list-item { position: relative; display: flex; align-items: center; gap: 5px; padding: 2px 5px; border: 1px solid var(--list-highlight-border, var(--line)); background: var(--list-highlight, var(--white)); border-radius: 10px; overflow-wrap: anywhere; }
.list-item input { width: 21px; height: 21px; flex: none; accent-color: var(--accent); }
.list-item-content { flex: 1; min-width: 0; }
.list-item-text { overflow-wrap: anywhere; white-space: pre-wrap; }
.list-description { margin: 0 0 14px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.list-item-text a, .list-description a { color: var(--accent); }
.list-item[data-completed] .list-item-text { text-decoration: line-through; color: var(--muted); }
.list-completed { margin-top: 24px; }
.list-completed-at { display: block; color: var(--muted); font-size: .79rem; }
.list-item .list-grip { flex: none; display: grid; place-items: center; width: 38px; height: 44px; padding: 0; color: var(--muted); cursor: grab; touch-action: none; user-select: none; -webkit-touch-callout: none; }
.list-grip .icon { stroke-width: 2.8; }
.list-grip:active { cursor: grabbing; }
.list-dragging { opacity: .48; }
.list-item[data-list-drop]::after { content: ""; position: absolute; inset-inline: 0; height: 3px; border-radius: 3px; background: var(--accent); z-index: 1; pointer-events: none; }
.list-item[data-list-drop="before"]::after { top: -4px; }
.list-item[data-list-drop="after"]::after { bottom: -4px; }
[data-highlight="yellow"] { --list-highlight: #fff1ab; --list-highlight-border: #b59939; }
[data-highlight="orange"] { --list-highlight: #ffdfb9; --list-highlight-border: #c08755; }
[data-highlight="pink"] { --list-highlight: #fbd9e7; --list-highlight-border: #bc7896; }
[data-highlight="purple"] { --list-highlight: #eadcfc; --list-highlight-border: #9a7abe; }
[data-highlight="blue"] { --list-highlight: #d4e8ff; --list-highlight-border: #6d96c2; }
[data-highlight="teal"] { --list-highlight: #ccefe9; --list-highlight-border: #5a9e92; }
[data-highlight="green"] { --list-highlight: #deefbd; --list-highlight-border: #839f55; }
.list-highlight-palette { margin: 0; padding: 0; border: 0; }
.list-highlight-palette legend { padding: 0; font-weight: 650; }
.list-highlight-palette > div { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 3px; }
.list-highlight-palette label { position: relative; cursor: pointer; }
.list-highlight-palette input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: inherit; }
.list-highlight-palette label > span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--list-highlight-border, #aaa2ae); background: var(--list-highlight, var(--white)); }
.list-highlight-palette input:checked + span, .list-highlight-palette input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.list-highlight-palette [data-highlight]:not([data-highlight=""]) .icon { visibility: hidden; }
.list-highlight-palette input:checked + span .icon { visibility: visible; }
.list-christmas { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.list-christmas button[aria-pressed="true"] { border-color: #46845a; background: #e8f7ed; }
.list-christmas-tree { flex: none; line-height: 1; }
.list-heading .sub { white-space: normal; line-height: 1.15; }
.list-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.add-item { display: flex; gap: 7px; margin: 15px 0; }
.add-item input { flex: 1; min-width: 0; }
.notice.unseen { border-left: 4px solid var(--accent); }
.mobile-nav, .mobile-only { display: none; }
dialog { border: 1px solid var(--line); border-radius: 16px; width: min(490px, calc(100% - 24px)); max-height: 90dvh; padding: 21px; color: var(--ink); background: var(--white); box-shadow: 0 15px 60px #24133238; }
dialog::backdrop { background: #21172eb3; }
dialog h2 { margin: 0; font-size: 1.25rem; }
dialog header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
dialog[open]:has([data-conversation-debug]) { display: flex; flex-direction: column; width: min(840px, calc(100% - 24px)); overflow: hidden; }
[data-conversation-debug] { display: flex; flex-direction: column; min-height: 0; }
.top-actions .debug-button { color: var(--accent); }
.debug-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.debug-status:empty { margin: 0; }
.debug-transcript { flex: 1; overflow: auto; overflow-anchor: none; scrollbar-gutter: stable; min-height: 60px; padding: 3px 5px 3px 3px; }
.debug-message { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.debug-message + .debug-message { margin-top: 8px; }
dialog .debug-message p { margin: 3px 0; }
.debug-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.debug-job, .debug-stage { margin-top: 8px; padding: 8px 9px; border-radius: 7px; background: var(--paper); min-width: 0; }
.debug-job .debug-stage { background: var(--white); }
.debug-job h3, .debug-stage h4 { font-size: .9rem; margin: 0; }
.debug-job h3 .dim { margin-inline-start: 4px; font-weight: 500; }
.debug-stage details, .debug-tool { margin-top: 4px; font-size: .84rem; overflow-wrap: anywhere; }
.debug-stage summary { cursor: pointer; }
.debug-field { margin-top: 5px; }
.debug-value { margin: 4px 0 6px; padding: 6px 8px; background: var(--lilac); border-radius: 5px; max-height: min(42dvh, 380px); overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
dialog form { display: grid; gap: 12px; }
.device-alerts form, .device-alerts .input-label { grid-template-columns: minmax(0, 1fr); }
.device-alerts fieldset { min-inline-size: 0; }
.device-alerts select { width: 100%; min-width: 0; }
.device-alerts .top-actions { flex-wrap: wrap; }
dialog p { margin: 0 0 12px; }
dialog fieldset { padding: 9px 12px; margin: 0; border: 1px solid var(--line); border-radius: 10px; }
.checkboxes { display: flex; gap: 4px 12px; flex-wrap: wrap; }
.checkboxes label, .inline-option { display: flex; align-items: center; gap: 4px; min-height: 36px; }
.input-label { display: grid; gap: 4px; font-size: .9rem; font-weight: 650; min-width: 0; }
.profile-preview { display: flex; align-items: center; gap: 10px; }
.profile-preview .avatar { width: 52px; height: 52px; }
.bubble-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.bubble-color { display: grid; place-items: center; width: 42px; height: 42px; cursor: pointer; }
.bubble-color input { position: absolute; opacity: 0; }
.bubble-color span { display: block; width: 30px; height: 30px; border-radius: 50%; border: 1px solid #826d8c80; background: var(--bubble); }
.bubble-color input:checked + span { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--accent); }
.bubble-color input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 6px; }
input:not([type="checkbox"]), textarea, select { border: 1px solid #d9cce8; background: white; border-radius: 8px; padding: 8px 10px; min-height: 41px; max-width: 100%; }
input[type="checkbox"] { accent-color: var(--accent); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.toast { position: fixed; z-index: 5; left: 50%; bottom: 20px; transform: translateX(-50%); border-radius: 10px; background: var(--rail); color: white; padding: 10px 15px; max-width: calc(100% - 28px); width: max-content; }
.form-error { color: #9a3027; margin: 0; }
.routines-panel { width: 100%; padding: clamp(16px, 4vw, 32px); }
.routines-panel section + section { margin-top: 27px; }
.routine-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.routine-heading h2 { font-size: 1rem; margin: 0; }
.routine-new, .routine-add-step { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.routine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 135px), 1fr)); gap: 10px; }
.routine-tile { position: relative; display: grid; min-width: 0; }
.routine-run { display: grid; grid-template-rows: auto 1fr; justify-items: start; gap: 11px; width: 100%; min-height: 114px; text-align: left;
  background: var(--white); border: 1px solid var(--line); padding: 12px; border-radius: 14px; }
.routine-run strong { font-size: .9rem; line-height: 1.25; overflow-wrap: anywhere; }
.routine-glyph { display: inline-grid; place-items: center; width: 38px; height: 38px; color: #54378b; background: #eee7fc; border-radius: 11px; }
.routine-glyph:is([data-glyph="sun"],[data-glyph="bulb"]) { color: #7b460b; background: #ffedcc; }
.routine-glyph:is([data-glyph="tv"],[data-glyph="moon"]) { color: #374b89; background: #e1e9fc; }
.routine-glyph:is([data-glyph="home"],[data-glyph="book"]) { color: #22614c; background: #dcefe5; }
.routine-glyph[data-glyph="power"] { color: #803c43; background: #f9e3e3; }
.routine-tile .routine-tile-option { position: absolute; inset: 5px 5px auto auto; color: var(--muted); }
.routine-tile-option:hover { color: var(--accent); background: var(--lilac); }
.routine-tile-option .icon { width: 17px; height: 17px; }
.routine-error { margin: 0 0 12px; color: #9a3027; }
.hue-group { border-top: 1px solid var(--line); }
.hue-group:last-child { border-bottom: 1px solid var(--line); }
.hue-group summary { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 49px;
  padding: 5px 2px; cursor: pointer; font-weight: 670; list-style: none; }
.hue-group summary::-webkit-details-marker { display: none; }
.hue-group summary .icon { color: var(--muted); width: 15px; height: 15px; }
.hue-group[open] summary .icon { transform: rotate(90deg); }
.hue-group .routine-grid { margin-bottom: 13px; }
.routine-icon-picker { display: flex; flex-wrap: wrap; gap: 7px; }
.routine-icon-choice { position: relative; display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; }
.routine-icon-choice input { position: absolute; opacity: 0; }
.routine-icon-choice input:checked + .routine-glyph { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--accent); }
.routine-icon-choice input:focus-visible + .routine-glyph { outline: 2px solid var(--ink); outline-offset: 5px; }
.routine-step { display: grid; gap: 7px; min-width: 0; }
.routine-step + .routine-step { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.routine-step select { width: 100%; }
.routine-step-controls { display: flex; align-items: end; gap: 6px; }
.routine-step-controls .input-label:first-child { flex: 1; }
.routine-brightness input { width: 100%; }
.routine-brightness { flex: 0 1 112px; }
.routine-color input { width: 68px; padding: 5px; cursor: pointer; }
.routine-add-step { margin-top: 10px; }
@media (max-width: 1130px) {
  .app { grid-template-columns: 213px minmax(0, 1fr) 228px; }
  .details { padding-inline: 11px; }
}
@media (max-width: 935px) {
  .app { grid-template-columns: 214px minmax(0, 1fr); }
  .details { display: none; }
}
@media (max-width: 650px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .rail { display: none; }
  .top { height: 63px; padding: 0 10px; }
  .top, .top-body { gap: 6px; }
  .top .connection-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .top .sub { font-size: .77rem; }
  .top h1 { font-size: 1.2rem; }
  .top-actions { gap: 4px; }
  .top-actions button { padding-inline: 9px; font-size: .87rem; }
  .top-actions .square { padding: 0; }
  .top-title { gap: 5px; }
  .mobile-only { display: inline-grid; }
  .mobile-nav { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 3px; padding: 4px 5px max(4px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--white); }
  .mobile-nav.with-routines { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .mobile-nav button { position: relative; justify-content: center; flex-direction: column; gap: 1px; min-height: 48px; background: transparent; font-size: .76rem; padding: 4px 1px; }
  .mobile-nav button[aria-current="page"] { background: var(--lilac); color: var(--accent); }
  .mobile-nav .badge { position: absolute; top: 3px; left: calc(50% + 8px); }
  .transcript { padding-inline: 12px; }
  .message { gap: 8px; }
  .message-content { max-width: calc(100% - 40px); }
  .message-avatar > :is(.avatar, .assist-mark) { width: 31px; height: 31px; border-radius: 8px; }
  .compose { margin-bottom: 7px; }
  .toast { bottom: 70px; }
}

[hidden] { display: none !important; }
.conversation { display: grid; grid-template-columns: minmax(0, 1fr); height: 100%; min-height: 0; overflow: hidden; }
.with-thread .conversation { grid-template-columns: minmax(0, 1.25fr) minmax(260px, 1fr); }
.thread-chat { border-left: 1px solid var(--line); min-width: 0; background: var(--white); }
.thread-chat .transcript { padding: 14px 12px; }
.thread-chat .compose { margin-inline: 8px; }
.thread-header { display: flex; align-items: center; justify-content: space-between; padding: 3px 10px 3px 16px; border-bottom: 1px solid var(--line); }
.thread-header h2 { font-size: 1rem; margin: 0; }
.thread-origin { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.thread-link { display: inline-flex; align-items: center; gap: 5px; font-size: .86rem; }
.reply-audience:empty { display: none; }
.reply-audience { display: flex; margin: 0 8px 5px; padding: 3px 9px; border-radius: 8px; background: #fcf0e9; color: #764333; align-items: center; justify-content: space-between; font-size: .84rem; font-weight: 650; }
.reply-audience .icon { width: 14px; height: 14px; }
.load-earlier { display: block; margin: 0 auto 16px; }
button.danger { color: #9a3027; }
.list-item button { min-height: 35px; }
@media (min-width: 936px) {
  .app.with-thread { grid-template-columns: 213px minmax(0, 1fr); }
  .with-thread .details { display: none; }
}
@media (max-width: 820px) {
  .with-thread .conversation { grid-template-columns: minmax(0, 1fr); }
  .with-thread .room-chat { display: none; }
  .thread-chat { border-left: 0; }
}
.repeat-fields { display: grid; gap: 8px; }
button.mobile-only { display: none; }
.request-result { display: block; margin-top: 6px; white-space: pre-wrap; font-weight: 480; overflow-wrap: anywhere; }
@media (max-width: 650px) {
  button.mobile-only { display: inline-grid; }
}
.top-actions .bug-button { color: var(--accent); }
.event-fields[data-event-kind="reminder"] .form-row { grid-template-columns: minmax(0, 1fr); }
.event-fields[data-event-kind="reminder"] label:has([name="endDay"], [name="endTime"]),
.event-fields[data-event-kind="all-day"] .times { display: none; }
.event-fields { display: grid; gap: 12px; }
@media (max-width: 650px) {
  .calendar-scroll { --calendar-inset: 8px; padding-block-end: 14px; }
  .calendar-grid { --calendar-date-height: 22px; --calendar-event-height: 14px; }
  .calendar-week { min-height: 48px; }
  .event-preview { margin-inline: 1px; padding-inline: 2px; font-size: .65rem; }
}
@media (max-width: 600px) {
  .top-actions .square { width: 34px; }
}
.bug-button { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
@media (max-width: 900px) {
  .bug-button span { display: none; }
}
