#record-activity [hidden], #record-activity[hidden], #activity-launcher[hidden] { display: none !important; }
:root { --record-activity-width: min(440px, calc(100vw - 2.5rem)); --record-activity-gap: 1rem; }
#record-activity { position: fixed; right: var(--record-activity-gap); top: calc(var(--erp-header-height, 64px) + 1rem); bottom: calc(var(--erp-footer-height, 40px) + 1rem); z-index: 1040; font-size: .875rem; width: var(--record-activity-width); pointer-events: none; }
#activity-launcher { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 1041; display: inline-flex; flex-direction: column; justify-content: center; gap: .6rem; align-items: center; width: 44px; min-width: 44px; min-height: 112px; padding: .75rem .5rem; white-space: nowrap; border-radius: .6rem 0 0 .6rem; background: #fff; border-color: #b8cfdf; box-shadow: -3px 2px 12px #12324d18; }
#activity-launcher > span { writing-mode: vertical-rl; font-size: .8rem; letter-spacing: .03em; }
#activity-launcher > i { font-size: 1rem; }
#activity-launcher.active { background: #e9f3fc; color: #0867aa; border-color: #8ab9df; }
#activity-launcher.active { right: calc(var(--record-activity-width) + var(--record-activity-gap)); border-right-color: transparent; }
#activity-panel { display: flex; flex-direction: column; width: 100%; height: 100%; pointer-events: auto; background: #fff; color: #24364a; border: 1px solid #d7e2ed; border-radius: .85rem; box-shadow: 0 12px 48px #17334e30; overflow: hidden; }
.activity-header { display: flex; align-items: flex-start; gap: .75rem; padding: 1rem 1.1rem; border-bottom: 1px solid #e4ebf2; background: #f8fbfe; }
.activity-header > div { flex: 1; min-width: 0; }
#record-activity #activity-heading { font-size: 1rem; font-weight: 650; color: #163d60; margin: 0 0 .4rem; }
#activity-record { font-size: .82rem; font-weight: 600; color: #365c7d; overflow-wrap: anywhere; }
.activity-close { color: #64788a; font-size: 1.4rem; line-height: 1; padding: .3rem .5rem; border-radius: .4rem; }
.activity-close:hover { background: #e6edf5; color: #163d60; }
#activity-status { padding: .65rem 1.1rem; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .8rem; background: #f8fbfe; }
#activity-status:empty { display: none; }
#activity-status.activity-error { color: #a21d2c; }
.activity-tools { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: .5rem; padding: .65rem 1.1rem; border-bottom: 1px solid #eef2f6; }
#activity-refresh { font-size: .75rem; border-color: #d7e2ed; color: #4d6b85; }
#activity-scroll { overflow-y: auto; overscroll-behavior: contain; overflow-anchor: none; flex: 1; min-height: 0; padding: 1rem 1.1rem; background: #fbfcfe; }
#activity-events { list-style: none; margin: 0; padding: 0 0 0 .45rem; }
.activity-event { position: relative; border-left: 2px solid #dce6f0; padding: 0 0 1.35rem 1rem; overflow-wrap: anywhere; }
.activity-event:last-child { padding-bottom: .25rem; }
.activity-event::before { content: ''; position: absolute; top: .35rem; left: -.32rem; width: .55rem; height: .55rem; border-radius: 50%; background: #7796b3; box-shadow: 0 0 0 3px #fbfcfe; }
.activity-date-divider { display: flex; align-items: center; gap: .6rem; margin: 0 0 .9rem -1.5rem; padding-top: .15rem; color: #61788d; font-size: .72rem; font-weight: 600; background: #fbfcfe; }
.activity-date-divider::before, .activity-date-divider::after { content: ''; height: 1px; flex: 1; background: #dce6f0; }
.activity-event.activity-starts-day::before { top: 2.35rem; }
.activity-event-comment::before { background: #1883c7; }
.activity-event-heading { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.activity-event-heading strong { font-size: .84rem; font-weight: 600; }
.activity-event-kind { font-size: .67rem; padding: .12rem .4rem; border-radius: .35rem; background: #eaf1f7; color: #5b758d; }
.activity-event-comment .activity-event-kind { background: #e4f2fd; color: #1375ad; }
.activity-event time { display: block; font-size: .72rem; color: #7a8c9d; margin-top: .2rem; }
.activity-message, .activity-change { white-space: pre-wrap; margin: .6rem 0 .35rem; line-height: 1.55; }
.activity-event-comment > .activity-message { padding: .65rem .8rem; background: #fff; border: 1px solid #e0e9f2; border-radius: 0 .6rem .6rem .6rem; }
.activity-event-you { font-size: .67rem; padding: .12rem .4rem; border-radius: .35rem; background: #dceffd; color: #075f94; font-weight: 600; }
.activity-event-mine > .activity-event-heading strong { color: #096da7; }
.activity-event-mine > .activity-message { background: #eef6fe; border-color: #bfd8ef; }
.activity-event-mine.activity-event-system > .activity-message { padding: .55rem .65rem; border-radius: .4rem; }
.activity-event summary { cursor: pointer; margin-top: .5rem; font-size: .77rem; color: #4d7597; }
.activity-baseline { border: 1px solid #c7d8ed; border-radius: .25rem; background: #f6f9fd; padding: .5rem; margin-top: .5rem; }
.activity-baseline > p { margin: .5rem 0; color: #536174; font-size: .8rem; }
.activity-change { font-size: .8rem; padding: .35rem .5rem; background: #f2f5f9; border-radius: .25rem; }
.activity-field-label { display: block; font-size: .74rem; color: #526a80; margin-bottom: .2rem; }
.activity-value, .activity-value-before, .activity-value-after { white-space: pre-wrap; overflow-wrap: anywhere; }
.activity-value-before { color: #758393; }
.activity-value-after { color: #234d6f; font-weight: 600; margin-top: .15rem; }
.activity-overview { margin: .5rem 0; padding: .4rem .65rem; background: #fff; border: 1px solid #e0e9f2; border-radius: .5rem; }
.activity-overview .activity-change { background: transparent; padding: .25rem 0; margin: .15rem 0; }
.activity-item-count { margin: .4rem 0 .2rem; font-size: .78rem; font-weight: 600; color: #3f6583; }
.activity-item-change { margin-top: .75rem; padding-top: .6rem; border-top: 1px solid #e0e9f2; }
.activity-item-change > strong { display: block; font-size: .8rem; margin-top: .2rem; }
.activity-item-action { font-size: .72rem; color: #52738e; }
#activity-comment { padding: .85rem 1.1rem; border-top: 1px solid #e0e9f2; background: #fff; }
#activity-comment label { display: block; margin-bottom: .25rem; }
#activity-message { resize: vertical; min-height: 64px; max-height: 160px; border-color: #d3e0eb; border-radius: .45rem; }
#activity-message::placeholder { color: #8b98a6; opacity: 1; font-style: italic; }
.activity-composer-footer { display: flex; justify-content: flex-end; align-items: center; gap: .75rem; margin-top: .55rem; }
.activity-composer-footer > span { font-size: .65rem; line-height: 1.35; color: #8192a1; flex: 1; }
.activity-composer-footer > .activity-character-count { flex: 0 0 auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.activity-composer-footer > .activity-count-warning { color: #966200; font-weight: 600; }
.activity-composer-footer > .activity-count-limit { color: #b42335; font-weight: 600; }
#activity-send { min-width: 65px; }
#activity-older { width: 100%; margin-top: 1rem; color: #4d7597; border: 1px dashed #cbdbea; background: #fff; }
#activity-launcher:focus-visible, #record-activity button:focus-visible, #activity-scroll:focus-visible { outline: 2px solid #2088d1; outline-offset: 3px; }
@media (max-width: 575px) {
    #record-activity { top: 4.5rem; right: .5rem; bottom: 3rem; width: calc(100% - 1rem); }
    #activity-panel { border-radius: .6rem; }
    #activity-launcher.active { display: none; }
}
@media (max-height: 600px) { #record-activity { top: calc(var(--erp-header-height, 64px) + .5rem); bottom: calc(var(--erp-footer-height, 40px) + .5rem); } }
