/* Shared long-text source, preview and reading styles across internal/public views. */
.long-text-field { display:flex; flex-direction:column; gap:8px; min-width:0; width:100%; grid-column:1 / -1; }
.long-text-field>label { font-weight:600; }
.markdown-editor { min-width:0; width:100%; border:1px solid #d8dfe8; border-radius:8px; background:#fff; overflow:visible; }
.markdown-editor:focus-within { border-color:#2563eb; box-shadow:0 0 0 2px #2563eb18; }
.markdown-controls { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 12px; border-bottom:1px solid #e5e9ef; background:#f8fafc; border-radius:8px 8px 0 0; }
.markdown-controls button,.markdown-tools button { appearance:none; cursor:pointer; background:transparent; border:1px solid transparent; border-radius:5px; font:inherit; font-size:12px; color:#536176; padding:6px 9px; min-height:32px; }
.markdown-modes { display:flex; gap:4px; }
.markdown-modes button[aria-pressed="true"] { color:#1559bd; background:white; border-color:#d8dfe8; font-weight:600; }
.markdown-tools { display:flex; flex-wrap:wrap; gap:2px; padding:5px 9px; border-bottom:1px solid #e5e9ef; }
.markdown-tools button:hover,.markdown-controls button:hover { color:#1559bd; background:#edf3ff; }
.markdown-editor button:focus-visible { outline:2px solid #2563eb; outline-offset:2px; }
.markdown-editor .long-text-input { display:block; width:100%; max-width:none; min-height:360px; padding:20px; margin:0; border:0; border-radius:0 0 8px 8px; box-sizing:border-box; resize:vertical; overflow:auto; font:15px/1.75 ui-monospace,SFMono-Regular,Consolas,monospace; color:#182435; background:white; box-shadow:none; }
.long-text-field.is-compact .long-text-input { min-height:160px; }
.markdown-editor .long-text-input:focus { outline:0; box-shadow:none; }
.markdown-preview { min-height:360px; max-height:75vh; overflow:auto; padding:20px; }
.markdown-status { color:#536176; padding:12px 20px; margin:0; }
.markdown-help { font-size:12px; color:#687589; line-height:1.5; margin:0 0 8px; }
.markdown-expanded { overflow:hidden; }
.markdown-editor.is-expanded { position:fixed; inset:20px; z-index:1000; width:auto; display:flex; flex-direction:column; box-shadow:0 0 0 100vmax #14223865; border-radius:10px; }
.markdown-editor.is-expanded .long-text-input,.markdown-editor.is-expanded .markdown-preview { flex:1; height:0 !important; min-height:0; max-height:none; resize:none; }
.markdown-editor.is-expanded .markdown-controls,.markdown-editor.is-expanded .markdown-tools { flex-shrink:0; }
.markdown-editor [hidden] { display:none !important; }
.long-text-reading { min-width:0; overflow-wrap:anywhere; }
.markdown-body { font-size:15px; line-height:1.75; overflow-wrap:anywhere; white-space:normal; min-width:0; }
.markdown-body>:first-child { margin-top:0; }
.markdown-body>:last-child { margin-bottom:0; }
.markdown-body p { margin:0 0 1em; white-space:normal; }
.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6 { margin:1.3em 0 .5em; line-height:1.3; font-weight:650; letter-spacing:normal; }
.markdown-body h1 { font-size:1.8em; }.markdown-body h2 { font-size:1.5em; }.markdown-body h3 { font-size:1.25em; }
.markdown-body ul,.markdown-body ol { margin:.6em 0 1em; padding-left:1.8em; }
.markdown-body li+li { margin-top:.25em; }
.markdown-body li>p { margin:.3em 0; }
.markdown-body blockquote { margin:1em 0; padding:.3em 1em; border-left:3px solid #acb9cf; color:#516074; background:#f7f9fc; }
.markdown-body pre { max-width:100%; overflow:auto; white-space:pre; padding:16px; background:#f4f6f9; color:#182435; border:1px solid #e1e6ed; border-radius:6px; line-height:1.6; tab-size:4; }
.markdown-body code { font: .9em/1.6 ui-monospace,SFMono-Regular,Consolas,monospace; padding:.12em .3em; background:#f0f3f7; border-radius:3px; }
.markdown-body pre code { padding:0; border:0; background:none; font-size:13px; }
.markdown-body table { display:block; max-width:100%; overflow:auto; border-collapse:collapse; margin:1em 0; }
.markdown-body th,.markdown-body td { border:1px solid #dbe2ec; padding:8px 12px; text-align:left; }
.markdown-body th { background:#f5f7fa; }
.markdown-body a { color:#1559bd; text-decoration:underline; text-underline-offset:2px; }
.markdown-body input[type="checkbox"] { width:auto; margin-right:8px; }
.markdown-body hr { border:0; border-top:1px solid #dbe2ec; margin:1.5em 0; }
.markdown-source { margin-top:16px; font-size:12px; color:#5b697c; }
.markdown-source>summary { cursor:pointer; padding:5px 0; }
.markdown-source pre { font:13px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace; padding:16px; background:#f8fafc; border:1px solid #e1e6ed; border-radius:6px; white-space:pre-wrap; overflow-wrap:anywhere; max-height:65vh; overflow:auto; color:#182435; user-select:text; }
.markdown-image-link::before { content:'↗ '; }
/* Description editing gets the entire workspace, not half a settings column. */
@media(min-width:1100px) { .software-page .ticket-form:has(.software-form-group) .software-form-group:first-of-type { grid-column:1 / -1; grid-row:auto; }.software-page .ticket-form:has(.software-form-group) .software-form-group:not(:first-of-type) { grid-column:auto; } }
.ticket-form:has(.long-text-field),.form-stack:has(.long-text-field) { max-width:none; }
.topic-workspace { width:100%; max-width:none; }
.import-json { min-height:360px; width:100%; max-width:none; resize:vertical; overflow:auto; }
@media(max-width:820px) { .markdown-editor .long-text-input { padding:16px; font-size:16px; }.markdown-preview { padding:16px; }.markdown-editor.is-expanded { inset:8px; }.markdown-controls { padding:8px; gap:4px; }.markdown-controls button { font-size:12px; }.markdown-tools button { min-height:38px; }.markdown-body { font-size:16px; } }

/* Item text is a single reading surface with quiet, right-aligned actions.
   Scoped reader controls deliberately avoid the shared primary-button styles. */
.text-reader-toolbar { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; min-width:0; margin:0 0 12px; }
.text-reader-label { font-size:12px; line-height:30px; font-weight:500; color:#68707d; min-width:0; overflow-wrap:anywhere; }
.text-copy-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:6px; margin-left:auto; flex-shrink:0; position:relative; }
.text-copy-actions[hidden],.copyable-long-text [data-copy-source] { display:none; }
.text-copy-button { appearance:none; display:inline-flex; align-items:center; justify-content:center; border:1px solid #e1e5eb; border-radius:6px; background:white; color:#4a5565; font:500 12px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; min-height:30px; padding:5px 9px; cursor:pointer; white-space:nowrap; }
.text-copy-button:hover { background:#f5f7fa; color:#24262b; border-color:#cad1dc; }
.text-copy-button:focus-visible { outline:2px solid #007aff; outline-offset:3px; }
.text-copy-status { position:absolute; right:0; top:100%; margin-top:2px; padding:2px 6px; background:white; font-size:11px; color:#526070; max-width:260px; z-index:1; }
.text-copy-status:empty { display:none; }
.admin-layout .item-text-panel { padding:20px 24px; }
.item-text-content .item-text-heading { font-size:15px; font-weight:600; margin:0 0 14px; }
.item-text-title { font-size:14px; font-weight:600; margin:0 0 8px; }
.item-description-variant+.item-description-variant { margin-top:20px; padding-top:20px; border-top:1px solid #edf0f4; }
.item-text-content .markdown-body { max-width:90ch; font-size:14px; line-height:1.75; }
.item-text-content .original-record { margin:0; padding:0; border:0; border-radius:0; }
.item-description-variant~.original-record { margin-top:20px; padding-top:14px; border-top:1px solid #e5e7eb; }
.item-text-content .original-record>summary,.item-text-content .original-record>.original-record-heading { display:flex; align-items:center; gap:8px; list-style:none; min-height:32px; width:fit-content; max-width:100%; padding:2px 0; font-size:14px; font-weight:600; color:#343b47; }
.item-text-content .original-record>summary::-webkit-details-marker,.description-language-editor>summary::-webkit-details-marker { display:none; }
.item-text-content .original-record>summary::before,.description-language-editor>summary::after { content:''; width:6px; height:6px; flex:0 0 6px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(-45deg); margin:0 4px 0 2px; }
.item-text-content .original-record[open]>summary::before,.description-language-editor[open]>summary::after { transform:rotate(45deg); }
.item-text-content .original-record[open]>summary,.item-text-content .original-record>.original-record-heading { margin:0 0 10px; }
.item-text-content .original-record>summary .language-chip,.item-text-content .original-record>.original-record-heading .language-chip { font-size:10px; font-weight:500; padding:2px 6px; border-radius:4px; background:#f0f2f5; color:#5d6572; }
.description-language-editor { margin-top:18px; padding-top:12px; border-top:1px solid #e5e7eb; }
.description-language-editor>summary { display:flex; align-items:center; justify-content:flex-end; gap:6px; width:fit-content; max-width:100%; min-height:32px; margin-left:auto; padding:4px 0; list-style:none; font-size:12px; line-height:1.5; font-weight:500; color:#536176; }
.description-language-editor>summary:hover { color:#007aff; }
.description-language-editor>summary .ui-icon { width:14px; height:14px; flex-basis:14px; }
.description-language-editor[open]>summary { margin-bottom:16px; }
.description-language-editor .translation-editor { margin:0; }
.description-language-editor>p { font-size:13px; margin:0 0 16px; }
/* With no additional description and both disclosures closed, only a single
   compact action row is needed. The native disclosure state drives the layout. */
.item-text-panel:has(details.original-record:not([open])):not(:has(.item-description-variant)):not(:has(.description-language-editor[open])) { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px 16px; }
.item-text-panel:has(details.original-record:not([open])):not(:has(.item-description-variant)) .description-language-editor:not([open]) { margin:0 0 0 auto; padding:0; border:0; }
@media(min-width:821px) {
    .item-text-content .original-record { position:relative; }
    .item-text-content .original-record[open]>summary,.item-text-content .original-record-static>.original-record-heading { width:100%; padding-right:250px; }
    .original-record[open]>.copyable-long-text>.text-reader-toolbar,.original-record-static>.copyable-long-text>.text-reader-toolbar { position:absolute; top:0; right:0; margin:0; }
    .item-description-variant~.original-record[open]>.copyable-long-text>.text-reader-toolbar { top:14px; }
}
@media(max-width:820px) {
    .admin-layout .item-text-panel { padding:16px; }
    .text-reader-toolbar { flex-wrap:wrap; gap:6px; }
    .text-copy-actions { flex-shrink:1; }
    .text-copy-button { min-height:40px; padding:8px 10px; }
    .item-text-content .original-record>summary,.description-language-editor>summary { min-height:40px; }
    .item-text-content .markdown-body { font-size:15px; }
}
