:root {
  color-scheme: light;
  --ink: #192320;
  --muted: #74817b;
  --soft: #9ca7a1;
  --line: #e8eeeb;
  --canvas: #f6f8f7;
  --white: #fff;
  --sidebar: #18221f;
  --sidebar-muted: #9baaa4;
  --green: #2d8067;
  --green-dark: #21674f;
  --green-soft: #e8f4ee;
  --mint: #b7e0cf;
  --amber: #b77a26;
  --amber-soft: #fff5e3;
  --blue: #4b74b8;
  --blue-soft: #edf3ff;
  font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
.invite-button { padding: 7px 10px; border: 1px solid #d8e8de; border-radius: 7px; color: #367858; background: #f5fbf7; font-size: 10px; white-space: nowrap; }
.join-page { display: grid; place-items: center; min-height: 100dvh; padding: 24px; background: #eef5f0; }
.join-card { width: min(440px, 100%); padding: 36px; border: 1px solid #dce8df; border-radius: 20px; background: white; box-shadow: 0 20px 70px #173c2610; }
.join-card .brand-mark { margin-bottom: 24px; }
.join-card h1 { margin: 10px 0; font-size: 25px; letter-spacing: -1px; }
.join-card > p { color: #75847a; font-size: 13px; line-height: 1.8; }
.join-card form { margin-top: 24px; }
.join-card .dialog-input { font-size: 13px; padding: 12px; }
.join-card .field-label { font-size: 12px; }
.join-submit { width: 100%; margin-top: 20px; padding: 13px; font-size: 13px; }
.join-card .join-notice { margin-top: 22px; padding-top: 18px; border-top: 1px solid #e7eee9; font-size: 11px; }
.join-card a { color: #367858; font-size: 12px; }
#join-error { color: #a65757; font-size: 12px; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #99d7bd; outline-offset: 2px; }
.app-shell { display: grid; grid-template-columns: 248px minmax(460px, 1fr) 306px; min-height: 100vh; height: 100vh; overflow: hidden; }

.sidebar { display: flex; flex-direction: column; min-height: 0; padding: 22px 14px 14px; color: #f3f8f5; background: var(--sidebar); }
.brand { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 8px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #153d31; background: #b4e3cf; font-size: 16px; font-weight: 700; }
.brand-name { font-size: 21px; letter-spacing: -.8px; font-weight: 700; }
.brand-period { color: #a9ddc8; }
.brand-tag { margin: 3px 0 0 1px; color: #91a29b; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.workspace-switcher { display: flex; align-items: center; width: 100%; gap: 10px; margin: 24px 0 27px; padding: 11px 10px; border: 1px solid #35413c; border-radius: 10px; color: #f4f8f6; background: #202c28; text-align: left; }
.workspace-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: #173d31; background: #c5e7d7; font-size: 14px; font-weight: 700; }
.workspace-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; }
.workspace-copy strong { font-size: 12px; font-weight: 600; }
.workspace-copy small { color: #9aa8a2; font-size: 10px; }
.chevron { color: #9aa8a2; font-size: 15px; }
.side-label { display: flex; align-items: center; justify-content: space-between; padding: 0 9px; color: #81918a; font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
.primary-nav, .room-nav { display: grid; gap: 4px; margin-top: 9px; }
.nav-item, .room-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; border-radius: 8px; color: #bdc9c3; background: transparent; text-align: left; }
.nav-item { min-height: 38px; padding: 0 10px; font-size: 12px; }
.nav-item.active { color: #d5f0e2; background: #2b3d35; }
.nav-glyph { width: 16px; color: #a2c9b6; font-size: 16px; text-align: center; }
.nav-count { margin-left: auto; color: #9bcdb5; font-size: 9px; font-weight: 700; letter-spacing: .4px; }
.nav-count.muted { color: #87958e; }
.rooms-label { margin-top: 30px; }
.rooms-label button { padding: 0 2px; border: 0; color: #9eada6; background: none; font-size: 17px; }
.room-item { min-height: 34px; padding: 0 10px; color: #a7b4ae; font-size: 12px; }
.room-item span { color: #73847c; font-size: 15px; }
.room-item.selected { color: #e0ebe5; background: #24332e; }
.room-item.selected span { color: #a8d7bf; }
.sidebar-spacer { flex: 1; min-height: 28px; }
.local-note { display: flex; align-items: center; gap: 9px; margin: 0 4px 16px; padding: 10px; border: 1px solid #33403b; border-radius: 9px; background: #1c2925; }
.note-icon { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; color: #b2dccc; background: #2c443a; font-size: 13px; }
.local-note span:last-child { display: flex; flex-direction: column; gap: 3px; }
.local-note strong { color: #d7e5de; font-size: 10px; font-weight: 600; }
.local-note small { color: #87978f; font-size: 9px; }
.profile-switcher { padding: 12px 7px 0; border-top: 1px solid #34413c; }
.profile-switcher label { display: block; margin-bottom: 7px; color: #87978f; font-size: 10px; }
.profile-switcher select { width: 100%; padding: 9px 10px; border: 1px solid #36443e; border-radius: 8px; color: #e8f2ed; background: #202c28; font-size: 11px; }

.main-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--canvas); }
.channel-header { display: flex; align-items: center; justify-content: space-between; min-height: 82px; padding: 0 30px; border-bottom: 1px solid var(--line); background: #fff; }
.channel-title-line { display: flex; align-items: center; gap: 8px; }
.channel-hash { color: #81938a; font-size: 22px; font-weight: 400; }
.channel-title-line h1 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.25px; }
.channel-pill { margin-left: 3px; padding: 4px 7px; border: 1px solid #e5ece8; border-radius: 5px; color: #70817a; font-size: 9px; }
.channel-title-wrap p { margin: 5px 0 0 30px; color: #87938d; font-size: 10px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.service-state { display: flex; align-items: center; gap: 7px; color: #65756e; font-size: 10px; }
.status-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #49a580; box-shadow: 0 0 0 3px #e8f5ee; }
.status-dot.offline { background: #a9b3ae; box-shadow: 0 0 0 3px #f0f2f1; }
.status-dot.busy { background: #dfa343; box-shadow: 0 0 0 3px #fff4df; }
.icon-button { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #e3eae6; border-radius: 8px; color: #53635b; background: #fff; font-size: 17px; }
.avatar-stack { display: flex; align-items: center; padding: 0; border: 0; background: none; }
.stack-avatar { display: grid; place-items: center; width: 27px; height: 27px; margin-left: -6px; border: 2px solid #fff; border-radius: 50%; color: #34483e; background: #dcebe2; font-size: 9px; font-weight: 700; }
.stack-avatar:first-child { margin-left: 0; }
.stack-more { display: grid; place-items: center; width: 27px; height: 27px; margin-left: -5px; border: 2px solid #fff; border-radius: 50%; color: #52635b; background: #eff3f1; font-size: 8px; }
.demo-banner { display: flex; align-items: center; gap: 9px; min-height: 39px; padding: 0 30px; border-bottom: 1px solid #f0ebdc; color: #867351; background: #fffbf1; font-size: 10px; }
.demo-badge { padding: 3px 6px; border-radius: 4px; color: #986b24; background: #f8edcf; font-size: 9px; font-weight: 700; }
.demo-banner button { margin-left: auto; border: 0; color: #9b8d70; background: transparent; font-size: 17px; }
.timeline { flex: 1; min-height: 0; overflow: auto; padding: 26px 30px 18px; }
.day-divider { display: flex; align-items: center; gap: 12px; margin: 1px 0 21px; color: #94a099; font-size: 9px; }
.day-divider::before, .day-divider::after { height: 1px; flex: 1; background: #e6ece9; content: ''; }
.message { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 11px; margin: 0 0 20px; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #315c4b; background: #dcefe4; font-size: 11px; font-weight: 700; }
.avatar.blue { color: #3e5e91; background: #e2eafb; }
.avatar.rose { color: #8b5d69; background: #f6e4e9; }
.avatar.agent { border: 1px solid #c5e2d3; color: #287553; background: #edf8f1; font-size: 14px; }
.message-main { min-width: 0; }
.message-meta { display: flex; align-items: baseline; gap: 7px; min-height: 19px; }
.message-meta strong { font-size: 11px; font-weight: 700; }
.message-role { color: #91a099; font-size: 9px; }
.message-time { color: #a5afa9; font-size: 9px; }
.message-text { margin: 5px 0 0; color: #48564f; font-size: 11px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-actions { display: flex; gap: 9px; margin-top: 7px; opacity: .9; }
.message-action { padding: 0; border: 0; color: #56846f; background: none; font-size: 9px; font-weight: 600; }
.message-action:hover { color: #21674f; text-decoration: underline; }
.handoff-message { margin-bottom: 18px; }
.handoff-card { max-width: 610px; margin-top: 6px; padding: 15px 16px; border: 1px solid #dcebe2; border-radius: 11px; background: #fff; box-shadow: 0 3px 12px rgba(31, 73, 54, .035); }
.handoff-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.handoff-route { display: flex; align-items: center; gap: 7px; color: #51645a; font-size: 9px; font-weight: 600; }
.route-arrow { color: #91aa9c; font-size: 13px; }
.status-label { padding: 4px 7px; border-radius: 5px; color: #8b692c; background: var(--amber-soft); font-size: 9px; font-weight: 600; white-space: nowrap; }
.status-label.queued { color: #6d7780; background: #f0f3f4; }
.status-label.processing { color: #456aa1; background: var(--blue-soft); }
.status-label.completed { color: #2b7657; background: #e9f6ee; }
.status-label.demo_completed { color: #7b6a46; background: #faf4e6; }
.status-label.blocked { color: #a65757; background: #fff0ef; }
.handoff-request { margin: 12px 0 0; color: #263c31; font-size: 11px; font-weight: 600; line-height: 1.65; }
.handoff-context { margin: 9px 0 0; padding: 9px 10px; border-radius: 7px; color: #6d7a73; background: #f7faf8; font-size: 10px; line-height: 1.7; white-space: pre-wrap; }
.handoff-context strong { display: block; margin-bottom: 2px; color: #849189; font-size: 8px; letter-spacing: .35px; text-transform: uppercase; }
.handoff-result { margin: 10px 0 0; padding: 10px 11px; border-radius: 7px; color: #536259; background: #f3f8f5; font-size: 10px; line-height: 1.7; white-space: pre-wrap; }
.approve-button { margin-top: 11px; padding: 7px 10px; border: 0; border-radius: 6px; color: #fff; background: var(--green); font-size: 9px; font-weight: 700; }
.approve-button:hover { background: var(--green-dark); }
.system-message { display: flex; align-items: center; gap: 7px; margin: -5px 0 17px 45px; color: #83918a; font-size: 9px; }
.system-message span { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; color: #4a8167; background: #e8f3ec; }
.empty-state { display: grid; place-items: center; min-height: 240px; color: #829088; text-align: center; }
.empty-illustration { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 12px; border: 1px solid #dcebe2; border-radius: 15px; color: #4c9274; background: #edf7f1; font-size: 22px; }
.empty-state strong { color: #43554b; font-size: 13px; }
.empty-state p { max-width: 260px; margin: 6px 0 0; font-size: 10px; line-height: 1.7; }
.composer-wrap { padding: 0 30px 22px; background: var(--canvas); }
.composer-tools { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; color: #8a9790; font-size: 9px; }
.handoff-shortcut { padding: 5px 8px; border: 1px solid #d8e8de; border-radius: 6px; color: #367858; background: #f5fbf7; font-size: 9px; font-weight: 600; }
.handoff-shortcut span { margin-right: 3px; font-size: 11px; }
.message-composer { padding: 11px 12px 9px; border: 1px solid #dfe8e3; border-radius: 10px; background: #fff; box-shadow: 0 3px 10px rgba(25, 55, 41, .03); }
.message-composer textarea { display: block; width: 100%; min-height: 38px; resize: vertical; border: 0; outline: 0; color: #34463c; background: transparent; font-size: 11px; line-height: 1.6; }
.message-composer textarea::placeholder { color: #a2ada6; }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; }
.composer-hint { color: #a2ada6; font-size: 8px; }
.send-button { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 0; border-radius: 6px; color: #fff; background: var(--green); font-size: 9px; font-weight: 600; }
.send-button:hover { background: var(--green-dark); }
.send-arrow { font-size: 12px; }

.details-panel { min-height: 0; overflow: auto; padding: 27px 20px 16px; border-left: 1px solid var(--line); background: #fff; }
.details-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.eyebrow { color: #9aa69f; font-size: 8px; font-weight: 700; letter-spacing: 1px; }
.details-heading h2 { margin: 4px 0 0; color: #26372e; font-size: 14px; letter-spacing: -.2px; }
.pulse-indicator { width: 8px; height: 8px; border-radius: 50%; background: #62b28c; box-shadow: 0 0 0 4px #edf7f1; }
.orchestrator-card { padding: 13px; border: 1px solid #dcebe2; border-radius: 10px; background: linear-gradient(135deg, #f5fbf7, #fff); }
.orchestrator-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.orchestrator-icon { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; color: #2e7958; background: #e4f3ea; font-size: 14px; }
.connection-chip { display: flex; align-items: center; gap: 6px; color: #418061; font-size: 8px; font-weight: 600; }
.connection-chip .status-dot { width: 6px; height: 6px; box-shadow: none; }
.orchestrator-card > strong { display: block; color: #2c4235; font-size: 10px; }
.orchestrator-card p { margin: 5px 0 0; color: #7e8c84; font-size: 9px; line-height: 1.65; }
.policy-section, .members-section { padding-top: 20px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; }
.section-heading h3 { margin: 0; color: #42534a; font-size: 10px; font-weight: 700; }
.owner-lock { padding: 3px 6px; border-radius: 4px; color: #738078; background: #f1f4f2; font-size: 8px; }
.policy-description { margin: 8px 0 9px; color: #829088; font-size: 9px; line-height: 1.6; }
.policy-description strong { color: #55665c; font-weight: 600; }
.policy-select { width: 100%; padding: 8px 9px; border: 1px solid #e0e9e4; border-radius: 7px; color: #405448; background: #fff; font-size: 9px; }
.policy-footnote { margin: 7px 0 0; color: #929e97; font-size: 8px; line-height: 1.6; }
.text-action { padding: 4px 0; border: 0; color: #4a8a6a; background: transparent; font-size: 9px; font-weight: 600; }
.member-list { display: grid; gap: 5px; margin-top: 10px; }
.member-row { display: flex; align-items: center; gap: 8px; padding: 7px 6px; border-radius: 7px; }
.member-row:hover { background: #f7faf8; }
.member-avatar { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; color: #3d745a; background: #e5f1e9; font-size: 9px; font-weight: 700; }
.member-avatar.color-1 { color: #4d6795; background: #e9eef9; }
.member-avatar.color-2 { color: #8c6372; background: #f6e9ed; }
.member-copy { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; }
.member-name-line { display: flex; align-items: center; gap: 5px; }
.member-name-line strong { overflow: hidden; color: #4a5a51; font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.member-copy small { color: #98a39d; font-size: 8px; }
.member-ai-state { display: flex; align-items: center; gap: 5px; color: #9aa59f; font-size: 8px; white-space: nowrap; }
.member-ai-state .status-dot { width: 6px; height: 6px; box-shadow: none; }
.copy-agent-id { padding: 4px 5px; border: 1px solid #e5ece8; border-radius: 5px; color: #74847b; background: #fff; font-size: 7px; }
.copy-agent-id:hover { color: #2d8067; border-color: #c9e1d3; background: #f4faf6; }
.connect-help { display: flex; gap: 7px; margin-top: 17px; padding: 10px; border-radius: 8px; background: #f7f9f8; }
.help-mark { display: grid; place-items: center; width: 15px; height: 15px; flex: 0 0 auto; border: 1px solid #b8c9bf; border-radius: 50%; color: #73867a; font-size: 9px; font-weight: 700; }
.connect-help p { margin: 0; color: #829088; font-size: 8px; line-height: 1.7; overflow-wrap: anywhere; }
.connect-help code { color: #527260; font-size: 8px; }
.panel-footer { display: flex; align-items: center; gap: 7px; margin-top: 15px; padding-top: 13px; border-top: 1px solid #edf1ef; color: #839189; font-size: 8px; }
.footer-lock { color: #6c987d; font-size: 12px; }

.dialog-card { width: min(490px, calc(100% - 28px)); max-width: 100%; padding: 22px; border: 1px solid #e0e9e4; border-radius: 14px; color: var(--ink); background: #fff; box-shadow: 0 20px 70px rgba(16, 37, 27, .2); }
.dialog-card::backdrop { background: rgba(16, 29, 24, .42); backdrop-filter: blur(2px); }
.compact-dialog { width: min(410px, calc(100% - 28px)); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; }
.dialog-header h2 { margin: 4px 0 0; color: #26372e; font-size: 17px; }
.dialog-close { width: 27px; height: 27px; border: 0; border-radius: 7px; color: #77857d; background: #f3f6f4; font-size: 18px; }
.dialog-intro { margin: 10px 0 18px; color: #7d8b83; font-size: 10px; line-height: 1.7; }
.field-label { display: flex; align-items: center; gap: 6px; margin: 13px 0 6px; color: #526259; font-size: 9px; font-weight: 700; }
.field-label span { color: #9da8a2; font-size: 8px; font-weight: 400; }
.dialog-input { display: block; width: 100%; padding: 9px 10px; border: 1px solid #dfe8e3; border-radius: 7px; color: #384940; background: #fff; font-size: 10px; line-height: 1.6; }
.dialog-input::placeholder { color: #a7b1ab; }
textarea.dialog-input { resize: vertical; }
.recipient-policy-note { margin-top: 7px; padding: 8px 9px; border-radius: 6px; color: #7a887f; background: #f6f9f7; font-size: 8px; line-height: 1.6; }
.recipient-policy-note strong { color: #496553; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.secondary-button, .primary-button { padding: 9px 12px; border-radius: 7px; font-size: 9px; font-weight: 600; }
.secondary-button { border: 1px solid #e0e8e3; color: #65736b; background: #fff; }
.primary-button { border: 1px solid var(--green); color: #fff; background: var(--green); }
.primary-button:hover { background: var(--green-dark); }
.primary-button span { margin-left: 5px; font-size: 11px; }
.toast { position: fixed; z-index: 10; right: 22px; bottom: 22px; max-width: min(360px, calc(100% - 44px)); padding: 10px 13px; border: 1px solid #d5e7db; border-radius: 8px; color: #315a43; background: #f1faf4; box-shadow: 0 8px 28px rgba(26, 53, 37, .12); font-size: 10px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@media (max-width: 1160px) {
  .app-shell { grid-template-columns: 225px minmax(420px, 1fr); }
  .details-panel { display: none; }
}
@media (max-width: 720px) {
  .app-shell { display: block; height: 100dvh; }
  .sidebar { display: none; }
  .main-panel { height: 100dvh; }
  .channel-header { min-height: 72px; padding: 0 15px; }
  .channel-title-wrap p { max-width: 220px; margin-left: 25px; font-size: 9px; }
  .header-actions { gap: 7px; }
  .service-state { max-width: 94px; font-size: 8px; }
  .avatar-stack { display: none; }
  .demo-banner { padding: 6px 15px; font-size: 9px; }
  .timeline { padding: 20px 15px 15px; }
  .composer-wrap { padding: 0 15px 14px; }
  .handoff-card { padding: 12px; }
}

.profile-label { display: block; margin-bottom: 7px; color: #87978f; font-size: 10px; }
#current-user-name { display: block; color: #e8f2ed; font-size: 12px; }
.logout-button { margin-top: 10px; padding: 5px 0; border: 0; color: #b1c7bc; background: none; font-size: 10px; }
.agent-connect-button { width: 100%; margin-top: 18px; }
.token-notice { margin-top: 18px; padding: 10px; border-radius: 7px; color: #867351; background: #fffbf1; font-size: 11px; line-height: 1.7; }
.agent-id-line { color: #65766c; font-size: 11px; overflow-wrap: anywhere; }
#agent-token-value { font-family: ui-monospace, monospace; overflow-wrap: anywhere; }
.auth-error { color: #a65757; font-size: 12px; line-height: 1.7; }
button:disabled { cursor: wait; opacity: .55; }
@media (max-width: 720px) {
  .service-state { display: none; }
  .join-card { padding: 25px; }
}

.handoff-reply-actions { display: flex; gap: 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #edf3ef; }
.reply-badge { display: inline-block; margin-top: 5px; padding: 3px 6px; border-radius: 4px; color: #638270; background: #eaf3ee; font-size: 8px; }

.bridge-instructions { margin-top: 18px; padding-top: 14px; border-top: 1px solid #e7eee9; }
.bridge-instructions h3 { font-size: 12px; color: #415b4b; }
.bridge-instructions p { font-size: 10px; color: #7c8d82; line-height: 1.7; }
.bridge-instructions code { display: block; padding: 9px; border-radius: 6px; background: #f3f7f4; color: #3d624b; font-size: 10px; overflow-wrap: anywhere; white-space: pre-wrap; }
