/* One shared layout for new tasks, follow-ups and sent messages on both desktop WebViews. */
html:root .lanmate-new-conversation-composer {
    box-sizing: border-box; padding: 16px 18px 12px; gap: 10px; grid-template-columns: minmax(0, 1fr);
}
html:root .lanmate-new-conversation-composer > .lanmate-compose-target-bar,
html:root .lanmate-new-conversation-composer > .lanmate-compose-authorization { margin: 0; }
html:root .lanmate-new-conversation-composer > .lanmate-compose-content {
    margin: 0; padding: 2px 0 10px;
    border-bottom: 1px solid var(--lb-border, rgba(136, 159, 191, .2));
}
html:root .lanmate-new-conversation-composer > label { display: block; min-width: 0; }
html:root .lanmate-new-conversation-composer textarea#lanmate-task-prompt {
    display: block; box-sizing: border-box; width: 100%; height: 80px; min-height: 80px; max-height: 260px; overflow-y: auto;
    margin: 0; padding: 4px 2px 8px; resize: none; font: 400 16px/1.6 "LanBridgeText", sans-serif;
}
html:root .lanmate-new-conversation-composer textarea#lanmate-task-prompt::placeholder { color: #9eafc5; opacity: 1; }
html[data-lb-effective-theme="light"] .lanmate-new-conversation-composer textarea#lanmate-task-prompt::placeholder { color: #65778b; }
html:root .lanmate-new-conversation-composer > footer { padding: 0 0 2px; gap: 12px; flex-wrap: wrap; }
html:root .lanmate-new-conversation-composer .lanmate-compose-tools { flex-wrap: wrap; row-gap: 8px; }
@media (max-width: 600px) { html:root .lanmate-new-conversation-composer { padding: 14px 14px 10px; gap: 10px; } }
.lanmate-attachments, .lanmate-follow-up-content {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    min-width: 0; max-height: 224px; overflow: auto; padding: 6px 4px;
    scrollbar-gutter: stable;
}
.lanmate-attachment, .lanmate-compose-tools, .lanmate-follow-up-tools {
    --attachment-ink: #e0e8f4;
    --attachment-muted: #a2b3c8;
    --attachment-line: rgba(136, 159, 191, .24);
    --attachment-surface: #17283b;
    --attachment-hover: #20364d;
    --attachment-accent: #8ebfe6;
    --attachment-error: #edabb0;
}
html[data-lb-effective-theme="light"] :is(.lanmate-attachment, .lanmate-compose-tools, .lanmate-follow-up-tools) {
    --attachment-ink: #284258;
    --attachment-muted: #687e90;
    --attachment-line: #d9e4ec;
    --attachment-surface: #f6f9fc;
    --attachment-hover: #edf4fa;
    --attachment-accent: #276eaa;
    --attachment-error: #af4655;
}
html:root .lanmate-attachment {
    position: relative; display: grid; grid-template-columns: minmax(0, 1fr);
    flex: 0 1 284px; width: 284px; max-width: 100%; min-width: 0;
    padding: 8px; gap: 0 8px; align-items: center; box-sizing: border-box;
    border: 1px solid var(--attachment-line); border-radius: 12px;
    background: var(--attachment-surface); color: var(--attachment-ink);
    user-select: none;
}
html:root .lanmate-attachment.is-removable { grid-template-columns: minmax(0, 1fr) 28px; }
html:root .lanmate-attachment .lanmate-attachment-open {
    display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; max-width: 100%;
    height: auto; min-height: 52px; padding: 0; margin: 0; border: 0;
    border-radius: 6px; background: transparent; color: var(--attachment-ink);
    text-align: left; box-shadow: none; font: inherit; cursor: pointer;
    transform: none; transition: color .15s ease;
}
html:root .lanmate-attachment .lanmate-attachment-open:is(:hover, :active, :disabled) {
    border: 0; background: transparent; box-shadow: none; transform: none;
}
html:root .lanmate-attachment .lanmate-attachment-open:hover:not(:disabled) { color: var(--attachment-accent); }
html:root .lanmate-attachment button:focus-visible { outline: 2px solid var(--attachment-accent); outline-offset: 2px; }
html:root .lanmate-attachment button:disabled { opacity: .5; cursor: default; filter: none; }
html:root .lanmate-attachment-open > svg {
    width: 26px; height: 26px; flex: 0 0 26px; margin: 0 6px; padding: 0;
    fill: none; stroke: var(--attachment-accent); stroke-width: 1.5;
    stroke-linecap: round; stroke-linejoin: round; border: 0; border-radius: 0; background: transparent;
}
html:root .lanmate-attachment-open > img {
    display: block; flex: 0 0 56px; width: 56px; max-width: 56px; height: 56px;
    object-fit: contain; border-radius: 6px; user-select: none; -webkit-user-drag: none;
}
html:root .lanmate-attachment-open > .lanmate-attachment-copy { display: grid; min-width: 0; gap: 5px; }
html:root .lanmate-attachment .lanmate-attachment-copy strong {
    display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: inherit; font: 550 14px/1.45 "LanBridgeText", sans-serif;
}
html:root .lanmate-attachment .lanmate-attachment-copy small {
    color: var(--attachment-muted); font: 400 12px/1.4 "LanBridgeText", sans-serif;
}
html:root .lanmate-attachment .lanmate-attachment-remove {
    position: static; display: grid; place-items: center; align-self: start;
    flex: none; width: 28px; min-width: 28px; height: 28px; min-height: 28px;
    margin: 0; padding: 0; border: 0; border-radius: 6px; opacity: 1;
    background: transparent; box-shadow: none; color: var(--attachment-muted); cursor: pointer; transform: none;
}
html:root .lanmate-attachment .lanmate-attachment-remove > svg {
    display: block; width: 16px; height: 16px; padding: 0; margin: 0;
    fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round;
    border-radius: 0; background: transparent;
}
html:root .lanmate-attachment .lanmate-attachment-remove:hover:not(:disabled) { background: var(--attachment-hover); color: var(--attachment-ink); }
html:root .lanmate-attachment .lanmate-attachment-remove:active:not(:disabled) { background: transparent; color: var(--attachment-accent); }
html:root .lanmate-attachment-error {
    grid-column: 1 / -1; display: block; min-width: 0; max-width: 100%;
    margin: 8px 2px 0; padding: 8px 0 0; border-top: 1px solid var(--attachment-line);
    color: var(--attachment-error); font: 400 12px/1.5 "LanBridgeText", sans-serif;
    white-space: normal; overflow-wrap: anywhere;
}
html:root :is(.lanmate-compose-tools, .lanmate-follow-up-tools) .lanmate-material-icon-button {
    position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    align-self: center; width: auto; min-width: 40px; height: 40px; min-height: 40px;
    margin: 0; padding: 0 10px; gap: 6px; border: 1px solid var(--attachment-line); border-radius: 10px;
    background: var(--attachment-surface); color: var(--attachment-ink); box-shadow: none; transform: none;
}
html:root :is(.lanmate-compose-tools, .lanmate-follow-up-tools) .lanmate-material-icon-button:is(:hover, :active, :disabled) {
    border-color: var(--attachment-line); box-shadow: none; transform: none;
}
html:root :is(.lanmate-compose-tools, .lanmate-follow-up-tools) .lanmate-material-icon-button:hover:not(:disabled) { background: var(--attachment-hover); color: var(--attachment-accent); }
html:root :is(.lanmate-compose-tools, .lanmate-follow-up-tools) .lanmate-material-icon-button:active:not(:disabled) { background: var(--attachment-surface); color: var(--attachment-accent); }
html:root :is(.lanmate-compose-tools, .lanmate-follow-up-tools) .lanmate-material-icon-button:focus-visible { outline: 2px solid var(--attachment-accent); outline-offset: 2px; }
html:root :is(.lanmate-compose-tools, .lanmate-follow-up-tools) .lanmate-material-icon-button:disabled { background: var(--attachment-surface); opacity: .5; }
html:root :is(.lanmate-compose-tools, .lanmate-follow-up-tools) .lanmate-material-label { color: inherit; white-space: nowrap; font: 500 14px/1.4 "LanBridgeText", sans-serif; }
html:root :is(.lanmate-compose-tools, .lanmate-follow-up-tools) .lanmate-material-icon-button > svg { flex: 0 0 20px; width: 20px; height: 20px; }
html:root :is(.lanmate-compose-tools, .lanmate-follow-up-tools) .lanmate-material-count {
    position: static; display: block; min-width: 12px; width: auto; height: auto;
    margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent;
    color: inherit; font: 600 12px/1 "LanBridgeText", sans-serif;
}
/* Bounded file chips share the picture row instead of forcing empty rows. */
html:root .lanmate-attachment:not(.is-image) {
    flex: 0 1 auto; width: auto; max-width: min(320px, 100%); min-height: 72px; padding: 8px 8px 8px 10px;
    border-color: var(--attachment-line); border-radius: 12px; background: var(--attachment-surface); gap: 0 8px;
}
html:root .lanmate-attachment:not(.is-image):hover,
html:root .lanmate-attachment:not(.is-image):focus-within { background: var(--attachment-hover); border-color: var(--attachment-accent); }
html:root .lanmate-attachment:not(.is-image) .lanmate-attachment-open { min-height: 52px; gap: 10px; }
html:root .lanmate-attachment:not(.is-image) .lanmate-attachment-open > svg { width: 26px; height: 26px; flex-basis: 26px; margin: 0; }
html:root .lanmate-attachment:not(.is-image) .lanmate-attachment-copy small { display: block; }
html:root .lanmate-attachment:not(.is-image) .lanmate-attachment-copy strong { color: var(--attachment-accent); }
html:root .lanmate-attachment:not(.is-image) .lanmate-attachment-open:hover strong { text-decoration: underline; text-underline-offset: 3px; }
html:root .lanmate-attachment .lanmate-attachment-remove { opacity: 0; transition: opacity .12s ease, background .12s ease; }
html:root .lanmate-attachment:hover .lanmate-attachment-remove,
html:root .lanmate-attachment:focus-within .lanmate-attachment-remove { opacity: 1; }
/* Equal viewports, object-fit keeps the whole portrait or landscape image. */
html:root .lanmate-attachment.is-image { flex-basis: 96px; width: 96px; height: 72px; aspect-ratio: 4 / 3; padding: 0; grid-template-columns: minmax(0, 1fr); }
html:root .lanmate-attachment.is-image .lanmate-attachment-open { flex-direction: column; gap: 0; align-items: stretch; min-height: 0; height: 100%; }
html:root .lanmate-attachment.is-image .lanmate-attachment-open > img,
html:root .lanmate-attachment-image-placeholder { flex: none; display: grid; place-items: center; width: 100%; max-width: 100%; height: 100%; object-fit: contain; border-radius: 11px; }
html:root .lanmate-attachment-image-placeholder > svg { width: 28px; height: 28px; fill: none; stroke: var(--attachment-muted); stroke-width: 1.5; }
html:root .lanmate-attachment.is-image .lanmate-attachment-copy { display: none; }
html:root .lanmate-attachment.is-image:hover,
html:root .lanmate-attachment.is-image:focus-within { border-color: var(--attachment-accent); background: var(--attachment-hover); }
html:root .lanmate-attachment.is-image .lanmate-attachment-remove {
    position: absolute; top: 5px; right: 5px; width: 24px; min-width: 24px; height: 24px; min-height: 24px;
    border: 1px solid var(--attachment-line); border-radius: 50%; background: var(--attachment-surface); color: var(--attachment-ink);
}
@media (hover: none) { html:root .lanmate-attachment .lanmate-attachment-remove { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { html:root .lanmate-attachment .lanmate-attachment-remove { transition: none; } }
.lanmate-attachment-viewer {
    width: min(1180px, calc(100vw - 40px)); max-width: calc(100vw - 40px);
    height: min(900px, calc(100dvh - 40px)); max-height: calc(100dvh - 40px);
    margin: auto; padding: 0; border: 1px solid #3e546d; border-radius: 16px;
    background: #152235; color: #e5edf8; box-shadow: 0 24px 72px rgba(0,0,0,.3);
}
.lanmate-attachment-viewer[open] { display: flex; flex-direction: column; }
.lanmate-attachment-viewer::backdrop { background: rgba(10,18,29,.52); backdrop-filter: blur(8px); }
.lanmate-attachment-viewer > header { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid #3e546d; }
.lanmate-attachment-viewer-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 15px/1.5 "LanBridgeText", sans-serif; }
html:root .lanmate-attachment-viewer button { flex: none; width: auto; min-width: 64px; min-height: 34px; padding: 6px 12px; border: 1px solid #536b85; border-radius: 8px; background: transparent; color: inherit; font: 500 14px/1.4 "LanBridgeText", sans-serif; box-shadow: none; cursor: pointer; }
html:root .lanmate-attachment-viewer button:hover { background: #253c54; }
html:root .lanmate-attachment-viewer button:active { background: #1e3146; }
html:root .lanmate-attachment-viewer button:focus-visible { outline: 2px solid #87b9e0; outline-offset: 2px; }
.lanmate-attachment-viewer-stage { flex: 1; min-height: 0; overflow: hidden; display: grid; place-items: center; padding: 16px; touch-action: none; }
.lanmate-attachment-viewer-stage.can-pan { cursor: grab; }
.lanmate-attachment-viewer-stage.is-panning { cursor: grabbing; }
.lanmate-attachment-viewer-stage img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lanmate-attachment-viewer-stage img[hidden], .lanmate-attachment-viewer-stage p[hidden] { display: none; }
.lanmate-attachment-viewer-stage.original-size { display: block; }
.lanmate-attachment-viewer-stage.original-size img { width: auto; height: auto; max-width: none; }
.lanmate-attachment-viewer-stage p { margin: 0; font-size: 14px; }
.lanmate-attachment-viewer > footer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 0 16px 14px; }
.lanmate-attachment-viewer output { min-width: 56px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.attachment-save-status { flex-basis: 100%; max-height: 4.5em; overflow: auto; text-align: center; overflow-wrap: anywhere; font-size: 13px; line-height: 1.5; user-select: text; }
.attachment-save-status:empty { display: none; }
html:root .lanmate-attachment-viewer button:disabled { opacity: .5; cursor: wait; }
html[data-lb-effective-theme="light"] .lanmate-attachment-viewer { background: #f7f9fc; color: #284258; border-color: #d3dfe9; }
html[data-lb-effective-theme="light"] .lanmate-attachment-viewer > header { border-color: #d3dfe9; }
html[data-lb-effective-theme="light"] .lanmate-attachment-viewer button { border-color: #cbdbe8; color: #284258; background: transparent; }
html[data-lb-effective-theme="light"] .lanmate-attachment-viewer button:hover { background: #e8f1f8; }
html[data-lb-effective-theme="light"] .lanmate-attachment-viewer button:active { background: #ddeaf4; }
html[data-lb-effective-theme="light"] .lanmate-attachment-viewer button:focus-visible { outline-color: #276eaa; }
@media (max-width: 480px) { .lanmate-attachment-viewer { width: calc(100vw - 24px); max-width: calc(100vw - 24px); height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); } }
/* The composer owns the surface and focus ring, including theme fallback rules. */
html:root .lanmate-follow-up-compose textarea#lanmate-follow-up-prompt,
html:root .lanmate-follow-up-compose textarea#lanmate-follow-up-prompt:is(:hover, :active, :focus, :focus-visible),
html:root .lanmate-new-conversation-composer textarea#lanmate-task-prompt,
html:root .lanmate-new-conversation-composer textarea#lanmate-task-prompt:is(:hover, :active, :focus, :focus-visible) {
    border: 0; outline: 0; box-shadow: none; background: transparent;
}
.lanmate-follow-up-compose textarea { resize: none; }
.lanmate-follow-up-compose { display: flex; flex-direction: column; }
.lanmate-follow-up-compose .lanmate-follow-up-content { order: -1; }
.lanmate-inline-citations { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
html:root .lanmate-history-more {
    display: block; width: auto; min-height: 32px; padding: 4px 8px; margin: 4px auto 12px;
    border: 0; background: transparent; box-shadow: none; font-size: 13px;
    color: var(--lb-text-secondary, #bbc7df); cursor: pointer;
}
html:root .lanmate-history-more:hover:not(:disabled) { color: var(--lb-brand, #a69bed); }
html:root .lanmate-history-more:focus-visible { outline: 2px solid var(--lb-brand, #a69bed); outline-offset: 2px; }
html:root .lanmate-inline-citations > button {
    width: auto; max-width: 100%; min-height: 32px; padding: 4px 10px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--lb-text-secondary, #bbc7df); background: var(--lb-surface-raised, #202737);
    border: 1px solid var(--lb-border-control, #394252); border-radius: 8px; font-size: 13px; cursor: pointer;
}
html:root .lanmate-inline-citations > button:hover { background: var(--lb-control-hover, #2c3449); }
html:root .lanmate-inline-citations > button:active { background: var(--lb-control-pressed, #353b51); }
html:root .lanmate-inline-citations > button:focus-visible { outline: 2px solid var(--lb-brand, #9b90ed); outline-offset: 2px; }
@media (hover: none) { html .lanmate-attachment .lanmate-attachment-remove { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { html .lanmate-attachment .lanmate-attachment-open { transition: none; } }
