/* Editor-only surfaces; the shared navigation is untouched. */
/* The author dialog uses the feed's light palette, even outside the feed page. */
html[data-theme="light"] #thought-author-modal{--feed-mode-accent:#356fd6;--feed-mode-active-text:#3567ba;font-family:-apple-system,BlinkMacSystemFont,Inter,sans-serif}
html[data-theme="light"][data-feed-background="midnight"] #thought-author-modal{--feed-mode-accent:#527dcc;--feed-mode-active-text:#365fad}
html[data-theme="light"][data-feed-background="aurora"] #thought-author-modal{--feed-mode-accent:#198f7b;--feed-mode-active-text:#126f61}
html[data-theme="light"][data-feed-background="violet"] #thought-author-modal{--feed-mode-accent:#c45d83;--feed-mode-active-text:#9f4164}
html[data-theme="light"][data-feed-background="ember"] #thought-author-modal{--feed-mode-accent:#d16948;--feed-mode-active-text:#a84d32}
html[data-theme="light"][data-feed-background="graphite"] #thought-author-modal{--feed-mode-accent:#687f9e;--feed-mode-active-text:#506780}
html[data-theme="light"] #thought-author-modal{
    --border:color-mix(in srgb,var(--feed-mode-accent) 22%,#e6e6e8);
    --bg-card:#fff;--bg-elevated:color-mix(in srgb,var(--feed-mode-accent) 4%,#fff);
    --text:color-mix(in srgb,var(--feed-mode-active-text) 12%,#29313d);
    --muted:color-mix(in srgb,var(--feed-mode-active-text) 15%,#626b79);
    --hover:color-mix(in srgb,var(--feed-mode-accent) 8%,#fff);
    --accent:var(--feed-mode-accent);--accent-light:var(--feed-mode-active-text);
    --t-border:var(--border);--t-input-b:var(--border);--t-input:var(--bg-elevated);
    --t-card:var(--bg-card);--t-elevated:var(--bg-elevated);--t-text:var(--text);
    --t-muted:var(--muted);--t-subtle:var(--muted);--t-hover:var(--hover);
}
html[data-theme="light"] #thought-author-modal :is(button,textarea){font-family:inherit}
html[data-theme="light"] #thought-author-modal .thought-modal__head{border-bottom-color:var(--border)!important}
html[data-theme="light"] #thought-compose-modal .thought-modal__head{border-bottom-color:var(--t-border,#dce6f3)!important}
/* Draw the close mark independently of font metrics; keep its accessible label. */
#thought-compose-modal .thought-modal__close{position:relative;display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;padding:0;font-size:0;line-height:1}
#thought-compose-modal .thought-modal__close::before,#thought-compose-modal .thought-modal__close::after{content:"";position:absolute;top:50%;left:50%;width:14px;height:2px;border-radius:1px;background:currentColor;transform:translate(-50%,-50%) rotate(45deg);pointer-events:none}
#thought-compose-modal .thought-modal__close::after{transform:translate(-50%,-50%) rotate(-45deg)}
html[data-theme="light"] #thought-compose-modal .thought-modal__close{color:#667994}
html[data-theme="light"] #thought-compose-modal .thought-modal__close:is(:hover,:focus-visible){color:#2563eb;background:#e5edfb}
#thought-compose-modal .thought-modal__close:focus-visible{outline:2px solid #487ff5;outline-offset:2px}
html[data-theme="light"] #thought-author-compose{padding:14px 15px 13px;border-color:var(--border);border-radius:16px;background:#fff}
html[data-theme="light"] #thought-author-modal .thought-card{background:#fff;border-color:#d9e2ef;color:#1b2940}
html[data-theme="light"] #thought-author-modal .thought-card__actions{border-color:var(--t-border)}
html[data-theme="light"] #thought-author-compose .thought-image-pick{background:transparent;border-color:var(--border);color:var(--muted)}
html[data-theme="light"] #thought-author-compose .thought-image-pick:hover{background:var(--hover);color:var(--accent-light)}
html[data-theme="light"] #thought-author-compose .thought-primary{background:var(--feed-mode-active-text);border-color:var(--feed-mode-active-text);color:#fff}
html[data-theme="light"] #thought-author-compose .thought-primary:not(:disabled):hover{background:color-mix(in srgb,var(--feed-mode-active-text) 88%,#000)}
@media(min-width:681px){
    html[data-theme="light"] #thought-author-compose{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:12px}
    html[data-theme="light"] #thought-author-compose>*{grid-column:1/-1;min-width:0}
    html[data-theme="light"] #thought-author-compose>.thought-author-compose__media{grid-column:1}
    html[data-theme="light"] #thought-author-compose>.thought-author-compose__footer{grid-column:2}
}
.thought-editor{border:1px solid var(--t-input-b,var(--t-border));border-radius:12px;background:var(--t-input,var(--t-elevated));color:var(--t-text);overflow:hidden;min-width:0;transition:border-color .15s ease}
.thought-editor:focus-within{border-color:color-mix(in srgb,var(--t-input-b,var(--t-border)) 76%,var(--t-muted))}
.thought-editor .thought-editor__input:focus{outline:none;box-shadow:none}
/* Only the active editor changes subtly; its surrounding card stays quiet. */
html[data-theme] .feed-scroll-surface .feed-thought-composer .feed-thought-composer__form:focus-within{border-color:var(--composer-border,var(--border,var(--t-border)));box-shadow:none}
.thought-editor__input{min-height:110px;max-height:320px;overflow-y:auto;outline:none;padding:12px;font-size:14px;font-weight:400;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere;cursor:text}
/* Align inline-composer text with the centered Bold glyph below it. */
.feed-thought-composer .thought-editor__input{padding-inline-start:17px}
.thought-editor__input[data-empty="true"]::before{content:attr(data-placeholder);color:var(--t-subtle,var(--t-muted));pointer-events:none;float:left;height:0}
.thought-editor__input p,.thought-editor__input div{margin:0}
.thought-editor__input ul{list-style:disc;margin:0;padding-left:22px}
.thought-editor__input li{margin:0;display:list-item}
.thought-editor__input :is(b,strong){font-weight:700}
.thought-editor__input :is(i,em){font-style:italic}
.thought-editor__toolbar{display:flex;gap:3px;align-items:center;padding:4px 7px 7px;min-height:39px}
.thought-editor__toolbar button{display:grid;place-items:center;width:30px;height:28px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--t-muted);font-size:14px;line-height:1;cursor:pointer;transition:background .15s,color .15s}
.thought-editor__toolbar button[data-editor-command="bold"]{font-weight:750}
.thought-editor__toolbar button[data-editor-command="italic"]{font-family:Georgia,serif;font-style:italic;font-size:17px}
.thought-editor__toolbar button[data-editor-command="removeFormat"]{margin-left:4px;font-size:13px}
.thought-editor__toolbar button:is(:hover,:focus-visible),.thought-editor__toolbar button[aria-pressed="true"]{background:color-mix(in srgb,var(--feed-mode-accent,var(--ac,#5685ee)) 12%,transparent);color:var(--feed-mode-active-text,var(--ac-l,#80aaff))}
html[data-theme="light"] .thought-editor__toolbar button:is(:hover,:focus-visible),html[data-theme="light"] .thought-editor__toolbar button[aria-pressed="true"]{color:var(--feed-mode-active-text,#2563eb)}
.thought-editor__toolbar button:focus-visible{outline:2px solid var(--feed-mode-accent,var(--ac,#5685ee));outline-offset:1px}
.thought-editor__toolbar button:disabled{opacity:.45;cursor:wait}
.thought-editor__emoji-trigger svg{width:17px;height:17px}
.thought-editor__toolbar .thought-editor__emoji-trigger{margin-inline-start:5px}
.thought-editor__toolbar .thought-editor__emoji-trigger[aria-expanded="true"]{background:color-mix(in srgb,var(--feed-mode-accent,var(--ac,#5685ee)) 12%,transparent);color:var(--feed-mode-active-text,var(--ac-l,#80aaff))}
html[data-theme="light"] .thought-editor__toolbar .thought-editor__emoji-trigger[aria-expanded="true"]{background:color-mix(in srgb,var(--feed-mode-accent,#2563eb) 14%,#fff);color:var(--feed-mode-active-text,#2563eb)}
.thought-editor__emoji-panel[hidden]{display:none!important}
.thought-editor__emoji-panel{padding:10px 12px 12px;border-top:1px solid var(--t-border);background:var(--t-elevated);color:var(--t-text)}
.thought-editor__emoji-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px;color:var(--t-muted);font-size:10px}
.thought-editor__emoji-head small{font:inherit}
.thought-editor__emoji-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(40px,1fr));gap:4px;width:100%}
.thought-editor__emoji-grid button{display:grid;place-items:center;width:100%;height:40px;min-width:0;padding:0;border:0;border-radius:7px;background:transparent;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;font-size:20px;line-height:1;cursor:pointer}
.thought-editor__emoji-grid button:is(:hover,:focus-visible){background:var(--t-hover, #8892aa18)}
.thought-editor__emoji-grid button:focus-visible{outline:2px solid var(--feed-mode-accent,var(--ac,#5685ee));outline-offset:-2px}
.thought-editor__emoji-grid button:disabled{opacity:.45;cursor:default}
.thought-editor.is-over-limit{border-color:#dc6475}
.thought-count-warning{color:var(--t-text)!important}.thought-count-error{color:#dc6475!important}
.thought-version{min-width:0;margin:10px 0}
.thought-version[hidden],.thought-version__panel[hidden],.thought-version__add[hidden]{display:none!important}
.thought-version__add{display:inline-flex;align-items:center;min-height:36px;padding:6px 0;border:0;background:transparent;color:var(--t-muted);font:inherit;font-size:13px;text-align:start;cursor:pointer}
.thought-version__add:hover{color:var(--t-text)}
.thought-version__panel{min-width:0;padding-top:4px}
.thought-version__heading{display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--t-text);font-size:13px;font-weight:600}
.thought-version__heading small{margin-inline-start:5px;color:var(--t-muted);font-size:12px;font-weight:400}
.thought-version__remove{display:grid;place-items:center;flex:none;width:32px;height:32px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--t-muted);font-size:22px;cursor:pointer}
.thought-version__remove:hover{background:var(--t-hover);color:var(--t-text)}
.thought-version__help{margin:0 0 9px;color:var(--t-muted);font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.thought-version__count{display:block;margin-top:7px;color:var(--t-muted);font-size:12px;text-align:end;font-variant-numeric:tabular-nums}
.thought-version__add:focus-visible,.thought-version__remove:focus-visible{outline:2px solid var(--feed-mode-accent,var(--ac,#5685ee));outline-offset:2px}
.thought-version button:disabled{opacity:.45;cursor:wait}
.feed-thought-composer__form>textarea[data-thought-editor][hidden],textarea[data-thought-editor][hidden]{display:none!important}
@media(max-width:680px){.thought-editor__input{min-height:120px;font-size:16px}.feed-thought-composer .thought-editor__input{padding-inline-start:20px}.thought-editor__toolbar button{width:36px;height:32px}.thought-editor__toolbar{min-height:43px}}
@media(prefers-reduced-motion:reduce){.thought-editor,.thought-editor__toolbar button{transition:none}}

/* Ship form layout with the versioned editor, not the cached site stylesheet. */
/* Adapt to the actual form width, including narrow desktop feed columns. */
.feed-thought-composer__form{container:feed-composer / inline-size;min-width:0;max-width:100%}
.thought-compose{container:thought-compose / inline-size;min-width:0}
.thought-author-compose{min-width:0}
.feed-thought-composer__footer,.thought-compose__footer,.thought-author-compose__media,.thought-author-compose__footer{flex-wrap:wrap}
.feed-thought-composer__image-pick,.thought-image-pick{flex-shrink:0;white-space:nowrap;max-width:100%}
.feed-thought-composer__image-pick svg,.thought-image-pick svg{flex-shrink:0}
.feed-thought-composer__submit-group{flex-shrink:0;margin-left:auto;white-space:nowrap}
.feed-thought-composer__submit-group button,.thought-compose__footer .thought-primary,.thought-author-compose__footer .thought-primary{flex-shrink:0;white-space:nowrap}
.thought-compose__meta{gap:10px;min-width:0}
.thought-compose__meta>span:first-child{min-width:0;overflow-wrap:anywhere}
[data-thought-inline-count],#thought-compose-count,#thought-author-compose-count{flex-shrink:0;white-space:nowrap;font-variant-numeric:tabular-nums}
.feed-thought-composer__upload-status:empty{display:none}
.feed-thought-composer__error,.thought-form-error{overflow-wrap:anywhere}
@container feed-composer (max-width:460px){
    .feed-thought-composer__footer{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:12px 10px}
    .feed-thought-composer__image-limit{justify-self:end}
    .feed-thought-composer__submit-group{grid-column:1 / -1;grid-row:2;margin-left:0;justify-content:space-between;min-width:0}
    .feed-thought-composer__upload-status:not(:empty){grid-column:1 / -1;grid-row:3;display:flex;justify-content:flex-start;white-space:normal;overflow-wrap:anywhere}
    .feed-thought-composer__image-pick,.feed-thought-composer__submit-group button{height:40px}
    .feed-thought-composer__previews{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@container thought-compose (max-width:340px){
    .thought-compose__footer{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
    .thought-compose__footer>.thought-image-pick,.thought-compose__footer>.thought-primary{width:100%;height:42px}
}

/* Comment fields share the editor's neutral focus, including legacy modals. */
html[data-theme] .thought-reply-input-wrap:focus-within{border-color:color-mix(in srgb,var(--t-border) 76%,var(--t-muted));box-shadow:none}
.thought-reply-form .thought-reply-input-wrap textarea:focus{outline:none;box-shadow:none}
html[data-theme] #post-modal #modal-comment-input:focus{border-color:color-mix(in srgb,var(--t-border) 76%,var(--t-muted))!important;outline:none;box-shadow:none}

/* Mobile Sketch lives inside the compose field, clear of text and formatting. */
.thought-compose__editor{position:relative;min-width:0}
.thought-compose__sketch{display:none}
@media(max-width:680px){
    .thought-compose__editor:has(.thought-compose__sketch) .thought-editor__toolbar{min-height:52px;padding-inline-end:96px}
    .thought-compose__editor:has(.thought-compose__sketch) .thought-editor__toolbar button{flex-shrink:0}
    .thought-compose__editor:has(.thought-compose__sketch)>textarea:not([hidden]){padding-bottom:56px}
    .thought-compose__sketch{position:absolute;inset-inline-end:8px;bottom:4px;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:0 8px;border-radius:8px;color:var(--t-muted);font-size:12px;font-weight:500;line-height:1.4;text-decoration:none;white-space:nowrap}
    .thought-compose__sketch svg{width:17px;height:17px;flex:none}
    .thought-compose__sketch:hover{background:var(--t-hover);color:var(--t-text)}
    .thought-compose__sketch:focus-visible{outline:2px solid var(--feed-mode-accent,var(--ac,#5685ee));outline-offset:1px}
}
/* An unsupported function inside a custom property does not activate var()'s
   fallback. Override the palette itself in older Safari, not just its users. */
@supports not (color:color-mix(in srgb,red,blue)){
 html[data-theme="light"] #thought-author-modal{--border:#d5deec;--bg-elevated:#f7f9fd;--text:#29313d;--muted:#626b79;--hover:#edf3fb}
 html[data-theme] .thought-editor:focus-within,html[data-theme] .thought-reply-input-wrap:focus-within{border-color:var(--t-input-b,var(--t-border))}
 html[data-theme] #post-modal #modal-comment-input:focus{border-color:var(--t-input-b,var(--t-border))!important}
 html[data-theme] .thought-editor__toolbar button[aria-pressed="true"],html[data-theme] .thought-editor__emoji-trigger[aria-expanded="true"]{background:rgba(86,133,238,.12)}
}
