:root { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #1d1c1d; background: #fff; font-synthesis: none; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; container-type: inline-size; }

.topbar { display: flex; align-items: center; height: 50px; padding: 0 16px; background: #350d36; color: #fff; }
.topbar-brand { display: flex; align-items: center; gap: 8px; min-width: 200px; white-space: nowrap; font-size: 16px; letter-spacing: -.04em; }
.brand-mark { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 6px; background: #a8e8be; color: #31513c; font-size: 20px; font-weight: 800; }

.app-layout { position: relative; display: grid; grid-template-columns: 205px minmax(0, 1fr); height: calc(100vh - 50px); min-height: 540px; }
.app-layout.thread-open { grid-template-columns: 205px minmax(0, 1fr) 390px; }
.sidebar { position: relative; min-width: 0; background: #3f2342; color: #e7dce8; }
.workspace-title { display: flex; justify-content: space-between; padding: 20px 17px; border-bottom: 1px solid #67456a; color: #fff; font-size: 16px; font-weight: 800; letter-spacing: -.03em; }
.workspace-title span { color: #c7b3ca; }
.sidebar-section { padding: 24px 17px 8px; color: #c9b8cb; font-size: 11px; font-weight: 800; }
.sidebar-channel { padding: 7px 17px; color: #e8dfea; font-size: 13px; }
.sidebar-channel span { margin-right: 8px; font-size: 18px; font-weight: 400; }
.sidebar-channel.active { background: #116e56; color: #fff; font-weight: 700; }
.sidebar-foot { position: absolute; bottom: 18px; left: 17px; right: 17px; padding-top: 13px; border-top: 1px solid #67456a; color: #b9a5bb; font-size: 9px; letter-spacing: .09em; line-height: 1.7; }
.sidebar-foot strong { color: #e5d9e5; font-size: 10px; font-weight: 500; letter-spacing: 0; }

.channel-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 3px solid #48264c; background: #fff; }
.pane-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 72px; padding: 12px 22px; border-bottom: 1px solid #e8e8e8; }
.channel-header { min-height: 54px; }
.thread-header { min-height: 54px; }
.pane-header h1, .pane-header h2 { margin: 0; font-size: 17px; line-height: 1.2; letter-spacing: -.035em; }
.pane-header h1 span { margin-right: 3px; color: #747074; font-weight: 400; }
.pane-header p { margin: 5px 0 0; color: #777477; font-size: 11px; }
.count { color: #858085; white-space: nowrap; font-size: 10px; }
.message-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 0 36px; }
.date-divider { position: relative; display: flex; align-items: center; justify-content: center; margin: 26px 25px 24px 77px; color: #292929; font-size: 12px; font-weight: 800; }
.date-divider::before { position: absolute; z-index: 0; left: 0; right: 0; height: 1px; background: #dedede; content: ""; }
.date-divider span { z-index: 1; padding: 6px 16px; border: 1px solid #dedede; border-radius: 99px; background: #fff; box-shadow: 0 1px 2px #ddd; }
.timeline-message { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 9px 25px 13px; }
.clickable-message { cursor: pointer; }
.clickable-message:focus-visible { outline: 2px solid #1264a3; outline-offset: -2px; }
.timeline-message:hover { background: #f8f8f8; }
.avatar { display: inline-grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 8px; background: var(--avatar-bg); color: var(--avatar-fg); font-size: 18px; font-weight: 800; }
.avatar.small { width: 23px; height: 23px; margin-right: -5px; border: 2px solid #fff; border-radius: 6px; font-size: 10px; }
.message-content { flex: 1; min-width: 0; }
.message-meta { display: flex; align-items: baseline; gap: 9px; }
.message-meta strong { font-size: 15px; letter-spacing: -.01em; }
.message-meta time { color: #686868; font-size: 12px; }
.message-content p, .thread-entry p { margin: 3px 0 0; font-size: 15px; line-height: 1.48; overflow-wrap: anywhere; white-space: pre-wrap; }
.reply-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 9px; padding: 0; border: 0; background: none; color: #666; text-align: left; font-size: 12px; }
.reply-summary:hover strong, .reply-summary.empty:hover { text-decoration: underline; }
.reply-summary strong, .reply-summary.empty { color: #1264a3; font-weight: 800; }
.reply-avatars { display: inline-flex; align-items: center; gap: 1px; padding-right: 2px; }
.reply-summary.empty { margin-top: 8px; }
.hover-reactions { position: absolute; z-index: 2; top: -13px; right: 18px; display: flex; align-items: center; gap: 2px; padding: 4px 6px; border: 1px solid #d7d7dd; border-radius: 7px; background: #fff; box-shadow: 0 2px 8px #0002; opacity: 0; pointer-events: none; transition: opacity .12s ease; }
.timeline-message:hover .hover-reactions, .timeline-message:focus-within .hover-reactions, .thread-entry:hover .hover-reactions, .thread-entry:focus-within .hover-reactions { opacity: 1; pointer-events: auto; }
.hover-reactions span { margin-right: 4px; color: #777; font-size: 9px; font-weight: 700; }
.hover-reactions button { width: 28px; height: 25px; padding: 0; border: 0; border-radius: 4px; background: none; font-size: 15px; }
.hover-reactions button:hover { background: #f0f0f3; }
.hover-reactions [data-retry-reaction] { width: auto; padding: 0 6px; color: #1264a3; font-size: 11px; font-weight: 700; }
.reaction-pills { display: flex; gap: 5px; margin-top: 7px; }
.reaction-pills button { padding: 3px 7px; border: 1px solid #bcd5ee; border-radius: 12px; background: #e8f3ff; color: #1264a3; font-size: 12px; }
.reaction-pills button::after { content: " 1"; font-size: 10px; font-weight: 800; }
.reaction-pills button:hover { background: #d7ebff; }
.route-status { display: block; margin-top: 7px; padding: 0; border: 0; background: none; text-align: left; font-size: 11px; font-weight: 700; }
.route-status.checking, .route-status.kept { color: #147c5a; }
.route-status.review { color: #8b641c; }
.route-status.undone { color: #62616c; }
.route-status.error { color: #a63e32; }
.route-status:is(button):hover { text-decoration: underline; }
.review-suggestion { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 560px; margin-top: 9px; padding: 10px 12px; border: 1px solid #e4d8b9; border-radius: 6px; background: #fffaf0; color: #665936; font-size: 11px; line-height: 1.4; }
.review-suggestion strong { color: #895c17; font-size: 11px; }
.review-suggestion button { margin-top: 3px; padding: 4px 7px; border: 1px solid #d9c493; border-radius: 4px; background: #fff; color: #815718; font-size: 10px; font-weight: 800; }
.review-suggestion button:hover { background: #fff2d5; }
.decision-details { margin-top: 15px; color: #4a4d56; font-size: 11px; line-height: 1.45; }
.decision-details p { margin: 5px 0 9px; font-size: 11px; }
.decision-numbers { display: flex; flex-wrap: wrap; gap: 5px 16px; }
.decision-heading { margin-top: 12px !important; font-weight: 800; }
.choice-ranking, .timeline-context { margin: 0; padding: 0; list-style: none; }
.choice-ranking li { display: flex; justify-content: space-between; gap: 14px; padding: 4px 0; border-bottom: 1px solid #e8e9ed; }
.choice-ranking li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-context { max-height: 260px; overflow-y: auto; }
.timeline-context li { display: grid; grid-template-columns: 27px 76px minmax(0, 1fr); gap: 6px; padding: 4px 0; border-bottom: 1px solid #e8e9ed; }
.timeline-position { color: #1264a3; font-weight: 800; }
.timeline-kind { color: #777; text-transform: capitalize; }
.timeline-event { display: flex; flex-direction: column; min-width: 0; }
.timeline-event > span { white-space: pre-wrap; }
.timeline-event small { color: #7b7d83; font-size: 10px; overflow-wrap: anywhere; }
.decision-details .decision-foot { margin-bottom: 0; color: #777; }
.decision-dialog { width: min(720px, calc(100vw - 30px)); max-height: min(88vh, 780px); padding: 0; border: 1px solid #d5d6dc; border-radius: 10px; background: #fff; box-shadow: 0 16px 50px #0004; color: #1d1c1d; }
.decision-dialog::backdrop { background: #1a1028a6; }
.decision-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 17px 20px 14px; border-bottom: 1px solid #e8e8ea; }
.decision-dialog-head span { color: #777; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.decision-dialog-head h2 { margin: 3px 0 0; font-size: 19px; }
.decision-dialog-head button { border: 0; background: none; color: #666; font-size: 25px; line-height: 1; }
.decision-dialog-body { max-height: min(66vh, 600px); overflow-y: auto; padding: 16px 20px; }
.decision-message { display: flex; gap: 11px; align-items: flex-start; }
.decision-message > div { min-width: 0; }
.decision-message p { margin: 3px 0 0; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.decision-paused { margin: 10px 0; padding: 9px 10px; border-radius: 5px; background: #f1f3f7; color: #555d6b; font-size: 11px; }
.decision-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 12px 20px; border-top: 1px solid #e8e8ea; }
.decision-dialog-actions button { padding: 7px 10px; border: 1px solid #d6d6dc; border-radius: 5px; background: #fff; color: #333; font-size: 11px; font-weight: 800; }
.decision-dialog-actions button:hover { background: #f2f2f4; }
.toast { position: fixed; z-index: 20; right: 20px; bottom: 20px; max-width: min(420px, calc(100vw - 40px)); padding: 12px 15px; border: 1px solid #b96856; border-radius: 8px; background: #fff7f3; box-shadow: 0 8px 28px #0003; color: #792f21; font-size: 13px; font-weight: 700; line-height: 1.4; }
.message-actions { display: flex; gap: 16px; margin-top: 6px; opacity: 0; }
.timeline-message:hover .message-actions, .timeline-message:focus-within .message-actions { opacity: 1; }
.message-actions button { padding: 0; border: 0; background: none; color: #1264a3; font-size: 11px; font-weight: 700; }
.message-actions button:hover { text-decoration: underline; }
.message-actions button:disabled { cursor: not-allowed; opacity: .5; }
.moved-notice { display: flex; align-items: center; gap: 10px; margin: 9px 25px 9px 77px; padding: 10px 12px; border: 1px solid #dadce6; border-radius: 7px; background: #f7f7fa; color: #62616c; }
.moved-icon { display: grid; place-items: center; flex: 0 0 auto; width: 25px; height: 25px; border-radius: 50%; background: #e8e8f1; color: #646184; font-size: 17px; }
.moved-notice > div:not(.moved-actions) { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.moved-notice strong { font-size: 11px; }
.moved-notice > div:not(.moved-actions) span { font-size: 10px; }
.moved-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.moved-actions button { border: 0; background: none; color: #1264a3; white-space: nowrap; font-size: 11px; font-weight: 800; }
.moved-notice button:hover { text-decoration: underline; }
.empty-list { padding: 30px 25px; color: #888; font-size: 12px; }

.channel-bottom, .thread-composer { padding: 10px 20px 16px; border-top: 1px solid #e8e8e8; background: #fff; }
.composer-top { display: flex; align-items: end; justify-content: space-between; gap: 12px; min-height: 28px; margin-bottom: 8px; }
.composer-top > label { color: #4e4e4e; font-size: 11px; font-weight: 800; }
.sample-picker { display: flex; align-items: center; gap: 7px; min-width: 0; }
.sample-picker label { color: #727272; white-space: nowrap; font-size: 10px; }
.sample-picker select { max-width: 205px; min-width: 0; padding: 5px 7px; border: 1px solid #d6d6d6; border-radius: 5px; background: #fff; color: #555; font-size: 10px; }
.composer-box { display: flex; align-items: flex-end; border: 1px solid #bdbdbd; border-radius: 8px; overflow: hidden; }
.composer-box:focus-within { border-color: #5b9c80; box-shadow: 0 0 0 2px #e2f2e9; }
.composer-box textarea { display: block; flex: 1; min-width: 0; min-height: 76px; max-height: 180px; padding: 12px; border: 0; outline: none; resize: vertical; color: #222; font-size: 13px; line-height: 1.4; }
.composer-box textarea::placeholder { color: #9a9a9a; }
.composer-box button { padding: 5px 10px; border: 0; border-radius: 5px; background: #007a5a; color: #fff; font-size: 11px; font-weight: 800; }
.composer-box button { flex: 0 0 auto; margin: 0 8px 8px 0; }
.composer-box button:hover:not(:disabled) { background: #006648; }
.composer-box button:disabled { opacity: .55; cursor: not-allowed; }

.thread-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid #ddd; background: #fff; }
.thread-header h2 { font-size: 16px; }
.thread-header button { border: 0; background: none; color: #656565; font-size: 25px; line-height: 1; }
.thread-header button:hover { color: #222; }
.thread-content { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 0; }
.thread-entry { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 9px 18px; }
.thread-entry > div { min-width: 0; }
.thread-entry .avatar { width: 34px; height: 34px; font-size: 15px; }
.thread-entry .message-meta strong { font-size: 13px; }
.thread-entry .message-meta time { font-size: 10px; }
.thread-entry p { font-size: 13px; }
.thread-entry.root { padding-bottom: 18px; }
.thread-divider { position: relative; margin: 6px 18px 10px 62px; text-align: center; color: #666; font-size: 11px; font-weight: 700; }
.thread-divider::before { position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: #ddd; content: ""; }
.thread-divider span { position: relative; display: inline-block; padding: 3px 11px; border: 1px solid #e2e2e2; border-radius: 99px; background: #fff; }
.thread-notice { margin: 0 15px 15px; color: #9b4f2a; font-size: 11px; }
.thread-notice:empty { display: none; }

@container (max-width: 1050px) { .app-layout { grid-template-columns: minmax(0, 1fr); } .app-layout.thread-open { grid-template-columns: minmax(0, 1fr) 350px; } .sidebar { display: none; } }
@container (max-width: 850px) { .app-layout.thread-open { grid-template-columns: minmax(0, 1fr); } .app-layout.thread-open::before { position: absolute; inset: 0; z-index: 4; background: #1a102880; content: ""; } .app-layout.thread-open .thread-pane { position: absolute; z-index: 5; top: 50%; left: 50%; width: min(560px, calc(100% - 24px)); height: min(720px, calc(100% - 24px)); transform: translate(-50%, -50%); overflow: hidden; border: 1px solid #d5d6dc; border-radius: 10px; box-shadow: 0 16px 50px #0004; } }
@container (max-width: 700px) { .topbar-brand { min-width: 0; } .count { display: none; } }
@media (hover: none) { .hover-reactions { position: static; margin-left: auto; opacity: 1; pointer-events: auto; box-shadow: none; } .hover-reactions span { display: none; } }
@container (max-width: 500px) { .topbar { padding: 0 9px; } .pane-header { padding: 10px 13px; } .timeline-message { padding: 9px 13px 13px; } .date-divider { margin-right: 13px; margin-left: 65px; } .moved-notice { margin: 9px 13px 9px 65px; flex-wrap: wrap; } .moved-actions { width: 100%; margin-left: 35px; } .sample-picker label { display: none; } .sample-picker select { max-width: 155px; } .decision-dialog-body, .decision-dialog-head, .decision-dialog-actions { padding-left: 13px; padding-right: 13px; } }
