:root {
  color-scheme: light;
  --ink: #18312c;
  --ink-soft: #29443d;
  --muted: #78847b;
  --line: #e3e4d9;
  --line-dark: rgba(240, 245, 221, .16);
  --paper: #fbfaf5;
  --canvas: #f2f1e9;
  --green: #17463d;
  --green-deep: #103a32;
  --green-soft: #e8eee2;
  --citron: #d4ef75;
  --coral: #e78369;
  --shadow: 0 22px 70px rgba(26, 49, 42, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body { min-width: 320px; margin: 0; color: var(--ink); background: var(--canvas); }
button, input, textarea { font: inherit; }
button { color: inherit; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid rgba(119, 153, 54, .42); outline-offset: 3px; }
[hidden] { display: none !important; }

.app-shell { position: relative; display: flex; width: 100%; height: 100vh; height: 100dvh; min-height: 0; flex-direction: column; overflow: hidden; }
.topbar { position: relative; z-index: 2; display: flex; height: 76px; flex: 0 0 76px; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 4vw, 64px); background: var(--canvas); border-bottom: 1px solid #dedfd5; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { position: relative; display: flex; width: 38px; height: 38px; align-items: center; justify-content: center; gap: 3px; border: 1px solid rgba(212, 239, 117, .2); border-radius: 13px 13px 13px 5px; background: var(--green); transform: rotate(-3deg); }
.brand-mark span { display: block; width: 3px; border-radius: 4px; background: var(--citron); transform: rotate(3deg); }
.brand-mark span:nth-child(1) { height: 10px; opacity: .56; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 12px; opacity: .75; }
.brand-copy { display: flex; flex-direction: column; gap: 3px; }
.brand-copy strong { font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: 500; letter-spacing: -.045em; }
.brand-copy small { color: #828a7f; font-size: 8px; font-weight: 700; letter-spacing: .14em; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.service-state, .connection-state { display: inline-flex; min-height: 32px; align-items: center; gap: 9px; padding: 0 12px; color: #64746a; border: 1px solid #dedfd5; border-radius: 4px 15px 15px 15px; font-size: 10px; font-weight: 650; letter-spacing: .015em; }
.service-state i, .connection-state i { display: block; width: 7px; height: 7px; border-radius: 50%; background: #aeb6a5; }
.service-state.is-online i, .connection-state.is-online i { background: #719b37; box-shadow: 0 0 0 3px rgba(113, 155, 55, .14); }
.service-state.is-error i, .connection-state.is-error i { background: var(--coral); box-shadow: 0 0 0 3px rgba(231, 131, 105, .15); }
.connection-state { background: rgba(255, 255, 255, .34); }
.icon-button { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; padding: 0; color: #62746b; background: transparent; border: 1px solid transparent; border-radius: 12px 12px 12px 4px; cursor: pointer; transition: color .18s, background .18s, border-color .18s, transform .18s; }
.icon-button:hover { color: var(--green); background: var(--green-soft); border-color: #dbe4d4; }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.mobile-menu { display: none !important; }

.workspace { position: relative; display: grid; min-height: 0; flex: 1; grid-template-columns: minmax(270px, 310px) minmax(0, 1fr); gap: clamp(14px, 2vw, 28px); padding: 24px clamp(16px, 3vw, 48px) 30px; overflow: hidden; }
.sidebar { display: flex; min-height: 0; flex-direction: column; gap: 13px; overflow: auto; scrollbar-width: thin; scrollbar-color: #c8cec0 transparent; }
.connect-card, .mailbox-card, .contacts-card { border-radius: 5px 22px 22px 22px; }
.connect-card { position: relative; padding: 25px 23px 20px; overflow: hidden; color: #f4f4e8; background: var(--green); box-shadow: 0 14px 38px rgba(17, 54, 46, .12); }
.connect-card::before { position: absolute; top: -53px; right: -53px; width: 155px; height: 155px; border: 1px solid rgba(212, 239, 117, .17); border-radius: 50%; box-shadow: 0 0 0 15px rgba(212, 239, 117, .025), 0 0 0 30px rgba(212, 239, 117, .025); content: ""; pointer-events: none; }
.connect-card::after { position: absolute; top: 35px; right: 33px; width: 5px; height: 5px; border-radius: 50%; background: var(--citron); box-shadow: 0 0 0 5px rgba(212, 239, 117, .09); content: ""; }
.section-kicker { display: flex; align-items: center; gap: 8px; color: #94a096; font-size: 8px; line-height: 1.4; font-weight: 760; letter-spacing: .15em; }
.connect-card .section-kicker { color: #a8ba9e; }
.section-index { display: inline-grid; width: 19px; height: 19px; place-items: center; color: var(--citron); border: 1px solid rgba(212, 239, 117, .42); border-radius: 50%; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0; }
.connect-card h1 { position: relative; margin: 24px 0 11px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(31px, 3.1vw, 39px); line-height: .99; font-weight: 400; letter-spacing: -.055em; }
.muted { max-width: 275px; margin: 0; color: #becbc0; font-size: 11px; line-height: 1.7; }
.form-stack { position: relative; display: flex; flex-direction: column; gap: 8px; margin-top: 22px; }
.form-stack label { margin-top: 3px; color: #d4ddd0; font-size: 9px; font-weight: 690; letter-spacing: .025em; }
.form-stack input { width: 100%; height: 44px; padding: 0 13px; color: #f5f4e8; background: rgba(5, 35, 29, .32); border: 1px solid rgba(237, 242, 221, .19); border-radius: 4px 11px 11px 11px; font-size: 12px; transition: border-color .16s, background .16s, box-shadow .16s; }
.form-stack input:focus { background: rgba(5, 35, 29, .55); border-color: rgba(212, 239, 117, .65); box-shadow: 0 0 0 3px rgba(212, 239, 117, .1); outline: 0; }
.form-stack input::placeholder { color: #91a59a; }
.primary-button, .secondary-button, .send-button { border: 0; cursor: pointer; transition: transform .17s, background .17s, color .17s, box-shadow .17s, border-color .17s; }
.primary-button { display: flex; height: 46px; align-items: center; justify-content: space-between; margin-top: 8px; padding: 0 14px; color: #20382e; background: var(--citron); border-radius: 4px 14px 14px 14px; font-size: 11px; font-weight: 760; }
.primary-button:hover { background: #e2f69a; box-shadow: 0 6px 20px rgba(212, 239, 117, .18); transform: translateY(-1px); }
.primary-button span { font-size: 19px; line-height: 1; font-weight: 450; }
.primary-button:disabled, .secondary-button:disabled, .send-button:disabled { opacity: .48; cursor: wait; transform: none; }
.full-width { width: 100%; }
.fine-print { display: flex; align-items: flex-start; gap: 8px; margin: 11px 0 0; color: #aab9ad; font-size: 9px; line-height: 1.5; }
.fine-mark { color: var(--citron); }
.resume-box { position: relative; margin-top: 19px; padding-top: 14px; border-top: 1px solid rgba(237, 242, 221, .15); }
.resume-box summary { color: #c3d0c5; font-size: 10px; font-weight: 620; cursor: pointer; list-style: none; }
.resume-box summary::-webkit-details-marker { display: none; }
.resume-box summary::after { float: right; color: var(--citron); content: "+"; font: 16px/10px Georgia, serif; }
.resume-box[open] summary::after { content: "−"; }
.compact-stack { margin-top: 12px; }
.secondary-button { min-height: 37px; padding: 0 13px; color: #56675c; background: #f0f1e7; border: 1px solid #e2e4d9; border-radius: 4px 12px 12px 12px; font-size: 10px; font-weight: 670; }
.secondary-button:hover { color: var(--green); background: #e8eddc; border-color: #d4ddc6; }
.security-note { display: flex; gap: 9px; align-items: flex-start; margin-top: 17px; padding: 11px 10px; color: #b8c7ba; background: rgba(5, 35, 29, .26); border: 1px solid rgba(237, 242, 221, .1); border-radius: 4px 11px 11px 11px; font-size: 9px; line-height: 1.55; }
.security-mark { display: grid; width: 16px; height: 16px; flex: 0 0 auto; place-items: center; color: var(--green-deep); background: var(--citron); border-radius: 50%; font-size: 10px; font-weight: 800; }

.mailbox-card, .contacts-card { background: var(--paper); border: 1px solid #e4e4d9; box-shadow: 0 6px 22px rgba(29, 48, 41, .025); }
.mailbox-card { padding: 17px 18px 13px; }
.identity-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.avatar { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 13px 13px 13px 4px; font-size: 13px; font-weight: 740; }
.avatar-self { color: var(--green); background: #e4ecd9; }
.avatar-peer { color: #733c2e; background: #f2d8c9; }
.identity-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.identity-copy strong { overflow: hidden; color: #263c34; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.identity-copy span { overflow: hidden; color: #8d9689; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
.mailbox-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 13px; padding-top: 11px; border-top: 1px solid #ecece3; }
.text-button { min-height: 30px; padding: 0; color: #768176; background: none; border: 0; cursor: pointer; font-size: 9px; font-weight: 650; }
.text-button:hover { color: var(--green); }
.danger-text:hover { color: #a74f3c; }

.contacts-card { display: flex; min-height: 180px; flex: 1; flex-direction: column; padding: 17px 15px 12px; overflow: hidden; }
.contacts-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 12px; }
.contacts-heading h2 { display: flex; align-items: center; gap: 8px; margin: 3px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 400; letter-spacing: -.045em; }
.directory-count { display: inline-grid; min-width: 20px; height: 20px; place-items: center; padding: 0 5px; color: #737e72; background: #eeefe7; border-radius: 50%; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0; }
.contacts-heading .icon-button { width: 34px; height: 34px; border-color: #e7e8de; }
.contacts-heading .icon-button:hover svg { transform: rotate(24deg); }
.contacts-heading .icon-button svg { transition: transform .2s; }
.search-wrap { display: flex; height: 40px; align-items: center; gap: 9px; padding: 0 11px; color: #8f998d; background: #f4f4ed; border: 1px solid #e9e9df; border-radius: 4px 12px 12px 12px; }
.search-wrap svg, .search-wrap span { flex: 0 0 auto; font-size: 17px; line-height: 1; }
.search-wrap input { width: 100%; min-width: 0; padding: 0; color: #35483d; background: transparent; border: 0; outline: 0; font-size: 11px; }
.search-wrap input::placeholder { color: #a0a89c; }
.search-wrap:focus-within { border-color: #abb99b; box-shadow: 0 0 0 3px rgba(113, 145, 77, .09); }
.peer-list { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 3px; margin: 10px -5px 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #d2d7ca transparent; }
.peer-button { display: flex; width: 100%; min-height: 58px; align-items: center; gap: 10px; padding: 8px 9px; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 4px 13px 13px 13px; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.peer-button:hover { background: #f5f5ee; }
.peer-button.is-selected { background: #edf1e5; border-color: #dfe6d4; }
.peer-button:active { transform: scale(.99); }
.peer-avatar { width: 36px; height: 36px; border-radius: 12px 12px 12px 4px; }
.peer-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }
.peer-copy strong { overflow: hidden; color: #34483d; font-size: 10px; font-weight: 690; text-overflow: ellipsis; white-space: nowrap; }
.peer-copy span { overflow: hidden; color: #90998d; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
.unread-badge { display: grid; min-width: 19px; height: 19px; place-items: center; padding: 0 5px; color: #223a2e; background: var(--citron); border-radius: 9px 9px 9px 3px; font-size: 8px; font-weight: 800; }
.empty-directory { margin: 20px 7px; color: #879286; font-size: 10px; line-height: 1.65; }
.directory-foot { display: flex; justify-content: space-between; margin: 9px 3px 0; padding-top: 9px; color: #899387; border-top: 1px solid #e9eae0; font-size: 8px; letter-spacing: .02em; }
.sidebar-footer { display: flex; min-height: 25px; align-items: center; gap: 5px; padding: 0 3px; color: #858d80; font-size: 7px; font-weight: 700; letter-spacing: .09em; }
.footer-signal { width: 6px; height: 6px; border-radius: 50%; background: #83a446; box-shadow: 0 0 0 3px rgba(131, 164, 70, .12); }
.footer-version { color: #a2a89b; font: 7px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0; }
.footer-spacer { flex: 1; }

.chat-area { position: relative; display: flex; min-width: 0; min-height: 0; height: 100%; overflow: hidden; background: var(--paper); border: 1px solid #e1e2d7; border-radius: 5px 26px 26px 26px; box-shadow: var(--shadow); }
.welcome-panel { position: relative; display: flex; width: 100%; flex-direction: column; align-items: center; justify-content: center; padding: 52px 24px; overflow: hidden; text-align: center; background-color: var(--paper); background-image: radial-gradient(#dce1d3 0.7px, transparent 0.7px); background-position: center; background-size: 19px 19px; }
.welcome-panel::before { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(251, 250, 245, .96) 0%, rgba(251, 250, 245, .89) 40%, rgba(251, 250, 245, .48) 100%); content: ""; }
.welcome-panel > * { position: relative; }
.welcome-art { position: relative; width: 158px; height: 124px; margin-bottom: 24px; }
.orbit { position: absolute; inset: 19px 8px; border: 1px solid #cad7bd; border-radius: 50%; transform: rotate(-24deg); }
.orbit-two { inset: 28px -4px; border-color: #e3c8b7; transform: rotate(29deg); }
.art-core { position: absolute; top: 37px; left: 55px; display: flex; width: 48px; height: 48px; align-items: center; justify-content: center; gap: 4px; border: 1px solid #607969; border-radius: 15px 15px 15px 5px; background: var(--green); box-shadow: 0 9px 25px rgba(18, 58, 49, .18); transform: rotate(-7deg); }
.art-core span { width: 3px; border-radius: 5px; background: var(--citron); transform: rotate(7deg); }
.art-core span:nth-child(1) { height: 11px; opacity: .6; }
.art-core span:nth-child(2) { height: 21px; }
.art-core span:nth-child(3) { height: 14px; opacity: .78; }
.art-dot { position: absolute; width: 8px; height: 8px; border: 2px solid var(--paper); border-radius: 50%; background: #83a44d; box-shadow: 0 0 0 1px #cfd8c2; }
.dot-one { top: 22px; left: 25px; }
.dot-two { top: 91px; right: 17px; background: var(--coral); box-shadow: 0 0 0 1px #edd0c3; }
.dot-three { top: 17px; right: 31px; width: 6px; height: 6px; background: #b4c19f; }
.welcome-ribbon { display: inline-flex; align-items: center; gap: 8px; color: #6e7f6b; font-size: 8px; font-weight: 740; letter-spacing: .14em; }
.welcome-ribbon > span:last-child { color: var(--coral); }
.ribbon-pulse { width: 6px; height: 6px; border-radius: 50%; background: #8da64f; box-shadow: 0 0 0 4px rgba(141, 166, 79, .12); }
.welcome-panel h2 { margin: 18px 0 13px; color: #1c3931; font-family: Georgia, "Times New Roman", serif; font-size: clamp(39px, 5.2vw, 68px); line-height: .98; font-weight: 400; letter-spacing: -.065em; }
.welcome-panel h2 em { color: #73875c; font-weight: 400; }
.welcome-panel > p { max-width: 345px; margin: 0; color: #7e887d; font-size: 12px; line-height: 1.75; }
.welcome-hints { display: flex; justify-content: center; gap: clamp(13px, 2.3vw, 32px); margin-top: 34px; padding-top: 20px; border-top: 1px solid #e2e5da; }
.welcome-hints span { display: flex; align-items: center; gap: 7px; color: #748173; font-size: 9px; }
.welcome-hints b { color: #557443; font: 700 8px ui-monospace, SFMono-Regular, Menlo, monospace; }
.welcome-coordinate { position: absolute !important; right: 24px; bottom: 21px; left: 24px; display: flex; justify-content: space-between; color: #9aa094; font: 7px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; }

.conversation { display: flex; width: 100%; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; }
.chat-header { display: flex; min-height: 84px; flex: 0 0 84px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 clamp(17px, 3vw, 38px); background: rgba(251, 250, 245, .91); border-bottom: 1px solid #e8e8dd; }
.chat-peer { display: flex; min-width: 0; align-items: center; gap: 12px; }
.chat-peer-copy { min-width: 0; }
.chat-peer-copy .section-kicker { margin-bottom: 2px; font-size: 7px; }
.chat-peer h2 { overflow: hidden; margin: 0 0 3px; color: #253d33; font-family: Georgia, "Times New Roman", serif; font-size: 19px; font-weight: 400; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.chat-peer p { overflow: hidden; margin: 0; color: #90988c; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
.chat-tools { display: flex; align-items: center; gap: 9px; }
.thread-chip { display: inline-flex; align-items: center; gap: 7px; color: #849082; font-size: 9px; white-space: nowrap; }
.thread-chip i { width: 6px; height: 6px; border-radius: 50%; background: #b5bcb0; }
.thread-chip.is-live i { background: #87a74d; box-shadow: 0 0 0 3px rgba(135, 167, 77, .12); }
.summary-button { min-height: 36px; white-space: nowrap; }
.finish-button { width: 36px; height: 36px; color: #7a8578; border-color: #e6e7dc; }
.finish-button:hover { color: #a74f3c; background: #fbede7; border-color: #f0d9ce; }
.message-scroller { min-height: 0; flex: 1 1 0; padding: 28px clamp(18px, 5vw, 68px); overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #d5d9ce transparent; }
.thread-start { display: flex; flex-direction: column; align-items: center; gap: 7px; margin: 52px auto 38px; color: #929b8e; font-size: 10px; }
.thread-start strong { color: #4c6252; font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: 400; letter-spacing: -.025em; }
.thread-start-icon { position: relative; display: flex; width: 38px; height: 38px; align-items: center; justify-content: center; gap: 3px; margin-bottom: 6px; background: #e8eddf; border-radius: 13px 13px 13px 4px; }
.thread-start-icon span { width: 2px; border-radius: 3px; background: #6f8c4e; }
.thread-start-icon span:nth-child(1) { height: 8px; opacity: .55; }
.thread-start-icon span:nth-child(2) { height: 15px; }
.thread-start-icon span:nth-child(3) { height: 10px; opacity: .7; }
.message-list { display: flex; flex-direction: column; gap: 22px; }
.message-row { display: flex; max-width: min(76%, 650px); flex-direction: column; align-items: flex-start; gap: 6px; }
.message-row.mine { align-self: flex-end; align-items: flex-end; }
.message-meta { display: flex; align-items: center; gap: 8px; padding: 0 3px; color: #929a8e; font-size: 8px; }
.message-row.mine .message-meta { justify-content: flex-end; }
.message-meta strong { color: #566b59; font-weight: 720; }
.message-kind { padding: 3px 6px; color: #85543f; background: #f4e2d6; border-radius: 3px 7px 7px 7px; font-size: 7px; text-transform: uppercase; letter-spacing: .07em; }
.message-bubble { max-width: 100%; padding: 12px 15px; color: #354b3e; background: #f0f1e8; border: 1px solid #e7e8dd; border-radius: 4px 17px 17px 17px; font-size: 12px; line-height: 1.75; overflow-wrap: anywhere; white-space: pre-wrap; }
.message-row.mine .message-bubble { color: #263a2e; background: #ddefa0; border-color: #d2e78d; border-radius: 17px 4px 17px 17px; }
.message-row.system .message-bubble { color: #794b3f; background: #f8ebe3; border-color: #f0ddd0; }
.composer { margin: 0 clamp(12px, 3vw, 36px) 22px; padding: 12px 13px 10px; background: #fffefa; border: 1px solid #dbdfd2; border-radius: 4px 17px 17px 17px; box-shadow: 0 8px 24px rgba(33, 55, 42, .055); transition: border-color .18s, box-shadow .18s; }
.composer:focus-within { border-color: #a9bb83; box-shadow: 0 0 0 3px rgba(130, 158, 83, .1), 0 8px 24px rgba(33, 55, 42, .055); }
.composer textarea { display: block; width: 100%; min-height: 36px; max-height: 132px; resize: none; padding: 4px 3px; color: #30483b; background: transparent; border: 0; outline: 0; font-size: 13px; line-height: 1.65; }
.composer textarea::placeholder { color: #9ba294; }
.composer textarea:disabled { cursor: not-allowed; }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; border-top: 1px solid #eeeee7; }
.composer-hint { display: flex; align-items: center; gap: 7px; color: #899285; font-size: 8px; }
.composer-state-dot { width: 5px; height: 5px; border-radius: 50%; background: #9bb562; }
kbd { display: inline-grid; min-width: 17px; height: 17px; place-items: center; margin-left: 2px; color: #778276; background: #f2f2ea; border: 1px solid #e5e6dc; border-radius: 4px; font: 9px ui-sans-serif, system-ui; }
.send-button { display: inline-flex; min-height: 35px; align-items: center; gap: 10px; padding: 0 7px 0 12px; color: #f6f4e9; background: var(--green); border-radius: 4px 12px 12px 12px; font-size: 9px; font-weight: 700; }
.send-button:hover:not(:disabled) { color: #20382e; background: var(--citron); }
.send-button b { display: grid; width: 21px; height: 21px; place-items: center; color: var(--green); background: var(--citron); border-radius: 7px 7px 7px 2px; font-size: 12px; line-height: 1; transition: transform .18s; }
.send-button:hover:not(:disabled) b { transform: translate(1px, -1px); }
.toast { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 20; max-width: min(400px, calc(100vw - 32px)); padding: 13px 16px; color: #f8f6ea; background: #203e34; border: 1px solid rgba(255, 255, 255, .12); border-radius: 4px 14px 14px 14px; box-shadow: 0 12px 32px rgba(20, 38, 34, .2); font-size: 11px; line-height: 1.55; animation: toast-in .2s ease-out; }
.toast.is-error { background: #8e493e; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sidebar-scrim { display: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 1500px) {
  .workspace { grid-template-columns: 330px minmax(0, 1fr); }
  .connect-card { padding: 29px 27px 23px; }
  .chat-area { max-width: 1500px; }
}

@media (max-width: 980px) {
  .topbar { padding-right: 22px; padding-left: 22px; }
  .workspace { grid-template-columns: minmax(255px, 285px) minmax(0, 1fr); gap: 14px; padding: 17px 18px 22px; }
  .connect-card { padding: 21px 18px 17px; }
  .connect-card h1 { font-size: 32px; }
  .chat-header { padding-right: 16px; padding-left: 17px; }
  .thread-chip { display: none; }
  .message-scroller { padding-right: 28px; padding-left: 28px; }
}

@media (max-width: 700px) {
  html, body { min-height: 100%; }
  .app-shell { height: 100vh; height: 100dvh; }
  .topbar { height: calc(64px + env(safe-area-inset-top)); flex-basis: calc(64px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 15px 0; }
  .brand-mark { width: 34px; height: 34px; border-radius: 12px 12px 12px 4px; }
  .brand-copy strong { font-size: 16px; }
  .brand-copy small { font-size: 7px; }
  .topbar-right { gap: 6px; }
  .service-state, .connection-state { min-height: 29px; gap: 7px; padding: 0 9px; font-size: 9px; }
  .mobile-menu { display: grid !important; width: 40px; height: 40px; }
  .workspace { display: block; height: calc(100vh - 64px - env(safe-area-inset-top)); height: calc(100dvh - 64px - env(safe-area-inset-top)); min-height: 0; padding: 0; overflow: hidden; }
  .chat-area { height: 100%; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
  .sidebar { position: absolute; top: 0; bottom: 0; left: 0; z-index: 9; width: min(370px, calc(100vw - 48px)); min-height: 0; padding: 14px 12px calc(14px + env(safe-area-inset-bottom)); overflow-y: auto; background: var(--canvas); opacity: 0; pointer-events: none; visibility: hidden; box-shadow: 16px 0 40px rgba(19, 43, 35, .13); transform: translateX(-102%); transition: transform .24s cubic-bezier(.2, .75, .25, 1), opacity .2s, visibility .24s; }
  .sidebar.is-open { opacity: 1; pointer-events: auto; visibility: visible; transform: translateX(0); }
  .sidebar-scrim { position: absolute; inset: 0; z-index: 8; display: block; padding: 0; background: rgba(17, 37, 31, .3); border: 0; opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .2s, visibility .2s; }
  .sidebar-scrim.is-visible { opacity: 1; pointer-events: auto; visibility: visible; }
  .connect-card { padding: 25px 22px 20px; }
  .connect-card h1 { margin-top: 21px; font-size: 36px; }
  .form-stack input { height: 48px; font-size: 16px; }
  .primary-button { height: 49px; }
  .mailbox-card { padding: 18px; }
  .contacts-card { min-height: 250px; }
  .sidebar-footer { margin-top: auto; }
  .welcome-panel { min-height: 100%; padding: 40px 24px max(52px, env(safe-area-inset-bottom)); }
  .welcome-art { margin-bottom: 20px; }
  .welcome-ribbon { max-width: 100%; flex-wrap: wrap; justify-content: center; font-size: 7px; letter-spacing: .11em; }
  .welcome-panel h2 { margin-top: 16px; font-size: clamp(42px, 12vw, 58px); }
  .welcome-panel > p { max-width: 300px; font-size: 12px; }
  .welcome-hints { flex-wrap: wrap; gap: 11px 17px; margin-top: 27px; padding-top: 16px; }
  .welcome-hints span { font-size: 8px; }
  .welcome-coordinate { right: 16px; bottom: max(14px, env(safe-area-inset-bottom)); left: 16px; font-size: 6px; }
  .chat-header { min-height: 72px; flex-basis: 72px; gap: 7px; padding: 0 12px; }
  .chat-peer { gap: 9px; }
  .chat-peer .avatar { width: 36px; height: 36px; }
  .chat-peer h2 { max-width: 34vw; font-size: 17px; }
  .chat-peer p { max-width: 35vw; font-size: 7px; }
  .chat-peer-copy .section-kicker { font-size: 6px; }
  .chat-tools { gap: 5px; }
  .summary-button { min-height: 36px; padding: 0 9px; font-size: 9px; }
  .finish-button { width: 36px; height: 36px; }
  .message-scroller { padding: 20px 13px calc(14px + env(safe-area-inset-bottom)); }
  .message-list { gap: 18px; }
  .message-row { max-width: 88%; }
  .message-bubble { padding: 11px 13px; font-size: 13px; }
  .composer { margin: 0 9px calc(9px + env(safe-area-inset-bottom)); padding: 10px 10px 9px; }
  .composer textarea { min-height: 38px; font-size: 16px; }
  .composer-bottom { gap: 6px; }
  .composer-hint { max-width: 56%; font-size: 7px; }
  .composer-hint kbd { display: none; }
  .send-button { min-height: 40px; padding-left: 11px; font-size: 9px; }
  .send-button b { width: 23px; height: 23px; }
  .toast { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); left: 12px; width: auto; max-width: none; }
}

@media (max-width: 390px) {
  .service-state { max-width: 126px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .welcome-panel h2 { font-size: 42px; }
  .welcome-hints { gap: 10px 13px; }
  .chat-header { padding-right: 8px; padding-left: 9px; }
  .summary-button { padding: 0 7px; font-size: 8px; }
  .composer-hint { font-size: 0; }
  .composer-hint .composer-state-dot { width: 6px; height: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
