/* ─────────────────────────────────────────────────────────────
   Conversations on a day's log entry, and the Inbox (assets/js/logthreads.js).
   ───────────────────────────────────────────────────────────── */

/* ── the 💬 on a log entry ── */
.lt-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: none;
    height: 26px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-3);
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .12s, border-color .12s, color .12s;
}

.lt-btn .bi {
    font-size: 13px;
}

.lt-btn:hover {
    border-color: var(--primary);
    color: var(--primary-hover);
}

.lt-btn.has-n {
    border-color: transparent;
    background: var(--primary-soft);
    color: var(--primary-hover);
    font-weight: 600;
}

/* The footer under an entry: a quiet text button, "Comment" — then "2 comments" in the accent
   colour once there is a conversation to open. */
.lt-btn--foot {
    height: 28px;
    padding: 0 10px 0 8px;
    margin-left: -8px;          /* the icon lines up with the entry's text above */
    border-color: transparent;
    border-radius: var(--r-sm, 8px);
    background: transparent;
    color: var(--muted-ink, var(--ink-3));
    font-size: 12.5px;
    font-weight: 600;
}

.lt-btn--foot .bi {
    font-size: 14px;
}

.lt-btn--foot:hover {
    border-color: transparent;
    background: var(--surface-3);
    color: var(--primary-hover);
}

.lt-btn--foot.has-n {
    background: transparent;
    color: var(--primary-hover);
}

.lt-btn--foot.has-n:hover {
    background: var(--primary-soft);
}

.lt-btn--foot:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring, 0 0 0 3px var(--primary-soft));
}

/* a thread here is waiting on me */

.lt-btn.is-active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ── the side panel ── */
.lt-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    width: min(440px, 100vw);
    background: var(--surface);
    border-left: 1px solid var(--line);
    box-shadow: -12px 0 32px -12px rgba(16, 24, 40, .22);
    transform: translateX(16px);
    opacity: 0;
    transition: transform .18s var(--ease, ease), opacity .18s;
    font-size: var(--fs-sm);
    color: var(--ink);
}

.lt-panel.is-open {
    transform: none;
    opacity: 1;
}

.lt-panel[hidden] {
    display: none;
}

.lt-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.lt-head__t {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.lt-head__t b {
    font-size: var(--fs-md);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lt-head__t span {
    font-size: var(--fs-xs);
    color: var(--muted-ink);
}

.lt-key {
    border: 0;
    padding: 0;
    background: none;
    font: inherit;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
}

.lt-key:hover {
    text-decoration: underline;
}

.lt-back {
    flex: none;
    border: 0;
    background: none;
    padding: 4px 6px;
    border-radius: var(--r-sm);
    color: var(--primary);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 600;
    cursor: pointer;
}

.lt-back:hover {
    background: var(--primary-soft);
}

.lt-x {
    flex: none;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted-ink);
    cursor: pointer;
}

.lt-x:hover {
    background: var(--surface-3);
    color: var(--ink);
}

.lt-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px 18px;
}

.lt-loading,
.lt-empty {
    padding: 18px 16px;
    color: var(--muted-ink);
    font-size: var(--fs-sm);
}

.lt-body .lt-empty {
    padding: 4px 0 8px;
}

/* the log entry itself */
.lt-log {
    padding: 10px 12px;
    border-radius: var(--r-md);
    background: #EEF6F4;
    margin-bottom: 14px;
}

.lt-log__name {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--muted-ink);
    margin-bottom: 4px;
}

.lt-log__note {
    max-height: 9.5em;
    overflow-y: auto;
    line-height: 1.55;
}

.lt-log__none {
    margin: 0;
    color: var(--muted-ink);
}

.lt-threads__h {
    margin: 4px 0 8px;
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted-ink);
}

/* a thread */
.lt-thread {
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.lt-thread:first-of-type {
    border-top: 0;
}

.lt-c {
    display: flex;
    gap: 10px;
    border-radius: var(--r-md);
    transition: background-color .4s;
}

.lt-c.is-flash {
    background: var(--primary-soft);
}

.lt-av {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.lt-av--sm {
    width: 22px;
    height: 22px;
    font-size: 9px;
}

.lt-c__main {
    flex: 1;
    min-width: 0;
}

.lt-c__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.lt-c__top b {
    font-weight: 600;
}

.lt-c__top time {
    font-size: var(--fs-xs);
    color: var(--muted-ink);
}

.lt-chip {
    padding: 1px 7px;
    border-radius: 999px;
    background: #F4EBFF;
    color: #6941C6;
    font-size: 11px;
    font-weight: 600;
}

.lt-chip--you {
    background: var(--primary-soft);
    color: var(--primary-hover);
}

.lt-c__body {
    line-height: 1.55;
    overflow-wrap: anywhere;
    color: var(--ink-2, var(--ink));
}

.lt-at {
    padding: 0 3px;
    border-radius: 4px;
    background: var(--primary-soft);
    color: var(--primary-hover);
    font-weight: 600;
}

.lt-c__acts {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.lt-c__acts button {
    border: 0;
    padding: 0;
    background: none;
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
}

.lt-c__acts button:hover {
    text-decoration: underline;
}

.lt-replies {
    margin: 10px 0 0 40px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lt-replies__n {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--muted-ink);
}

.lt-replies__n::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--line);
}

.lt-replybox {
    margin: 10px 0 0 40px;
}

/* editing a comment */
.lt-edit__acts {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 6px;
}

/* ── writing ── */
.lt-compose {
    display: flex;
    gap: 10px;
    padding: 12px 16px 14px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.lt-compose--reply {
    padding: 0;
    border: 0;
}

.lt-compose__box {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    background: var(--surface);
    transition: border-color .12s, box-shadow .12s;
}

.lt-compose__box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.lt-ta {
    display: block;
    width: 100%;
    min-height: 44px;
    resize: none;
    border: 0;
    border-radius: var(--r-md);
    padding: 9px 12px 4px;
    background: transparent;
    font: inherit;
    font-size: var(--fs-sm);
    line-height: 1.5;
    color: var(--ink);
    outline: none;
}

.lt-edit .lt-ta {
    border: 1px solid var(--line-strong);
    background: var(--surface);
}

.lt-compose__tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    padding: 4px 8px 8px;
}

.lt-send {
    margin-left: auto;
}

.lt-ro {
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--muted-ink);
    font-size: var(--fs-xs);
}

/* the @mention list */
.lt-mention {
    position: fixed;
    z-index: 1060;
    min-width: 220px;
    max-width: 300px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

.lt-mention[hidden] {
    display: none;
}

.lt-mention__o {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    border: 0;
    border-radius: var(--r-sm);
    background: none;
    font: inherit;
    font-size: var(--fs-sm);
    text-align: left;
    color: var(--ink);
    cursor: pointer;
}

.lt-mention__o small {
    margin-left: auto;
    color: var(--muted-ink);
    font-size: 11px;
}

.lt-mention__o.is-on,
.lt-mention__o:hover {
    background: var(--primary-soft);
}

/* ── the Inbox ── */
.lt-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 16px 4px;
}

.lt-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 6px 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-3);
    cursor: pointer;
}

.lt-tab em {
    font-style: normal;
    font-weight: 600;
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--surface-3);
    text-align: center;
}

.lt-tab.is-on {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.lt-tab.is-on em {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

.lt-inbox {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lt-item {
    position: relative;
    display: flex;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
    font: inherit;
    font-size: var(--fs-sm);
    text-align: left;
    color: var(--ink);
    cursor: pointer;
    transition: border-color .12s, background-color .12s;
}

.lt-item:hover {
    border-color: var(--primary);
    background: var(--surface-2);
}

.lt-item.is-unread::before {
    content: "";
    position: absolute;
    top: 16px;
    left: -4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

.lt-item__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lt-item__top {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lt-item__top time {
    margin-left: auto;
    font-size: var(--fs-xs);
    color: var(--muted-ink);
}

.lt-item__where {
    font-size: var(--fs-xs);
    color: var(--muted-ink);
}

.lt-item__where code {
    font-size: 11px;
}

.lt-item__body {
    margin-top: 2px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.lt-kind {
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.lt-kind--mention  { background: var(--primary-soft); color: var(--primary-hover); }
.lt-kind--reply    { background: var(--surface-3); color: var(--ink-3); }

@media (max-width: 600px) {
    .lt-panel {
        width: 100vw;
    }

    .lt-replies,
    .lt-replybox {
        margin-left: 20px;
    }
}

/* where the button sits in each list of log entries: right by the entry it is about */
.rev-wl__top .lt-btn {
    margin-left: 4px;
}

/* the worksheet: at the right end — next to "edit", or alone there when the entry is locked */
.ws-logged__meta .lt-btn {
    margin-left: auto;
}

.ws-logged__meta button:not(.lt-btn) + .lt-btn {
    margin-left: 8px;
}

.ws-act__when + .lt-btn,
.ws-act__jump + .lt-btn {
    margin-left: 8px;
    vertical-align: middle;
}

/* the @mention list: "no one on this issue matches" */
.lt-mention__empty {
    margin: 0;
    padding: 10px 8px;
    font-size: var(--fs-sm);
    color: var(--muted-ink);
}

/* the @mention list: a title line */
.lt-mention::before {
    content: "Mention someone";
    display: block;
    padding: 4px 6px 6px;
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--muted-ink);
}

.lt-mention {
    width: 280px;
    max-width: none;
    padding: 6px;
}

/* a button with a word on it ("Day log"), the count as a small badge after it */
.lt-btn--label .lt-btn__t em {
    font-style: normal;
    min-width: 18px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.lt-btn--label.has-n {
    background: var(--primary-soft);
    color: var(--primary-hover);
}

/* the worksheet's composer row: the same size as Attach and the hour chips */
.ws-composer__tools .lt-btn {
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    border-color: var(--ws-line, var(--line));
    font-size: var(--fs-xs);
    font-weight: 600;
}

/* ── what is new since you last opened the entry ── */
.lt-new {
    padding: 1px 7px;
    border-radius: 999px;
    background: #FEF3F2;
    color: #B42318;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.lt-newcount {
    margin-left: 4px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #FEF3F2;
    color: #B42318;
    letter-spacing: normal;
    text-transform: none;
}

/* a thread with something new: a thin accent down its left side */
.lt-thread.has-new {
    margin-left: -16px;
    padding-left: 13px;
    border-left: 3px solid #F04438;
}

/* the comment box sits under the log entry, above the conversations (newest first) */
.lt-body > .lt-compose {
    padding: 0;
    margin: 0 0 16px;
    border-top: 0;
    background: none;
}

.lt-body > .lt-ro {
    margin: 0 0 16px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
}
.lt-kind--issue { background: #ECFDF3; color: #067647; }
