.text-compose .compose-attach-actions .special-attach {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(128,128,128,.16);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.special-attach svg { width: 18px; height: 18px; }
.text-compose .special-attach:hover { background: var(--control-glass-hover); }
body.search-mode .text-compose .special-attach { display: none; }

.special-overlay { z-index: 75; }
.special-overlay .special-form {
  display: flex;
  flex-direction: column;
  width: min(100%, 500px);
  min-height: 0;
  max-height: min(82dvh, 760px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: 20px;
  background: var(--ui-surface);
  color: var(--ui-text);
  text-align: start;
}
.special-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--ui-border);
}
.special-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 16px; font-weight: 650; line-height: 1.25; }
.special-head .special-primary {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--control-glass);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.special-form .title-side-btn {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--control-radius);
  background: var(--control-glass);
  color: inherit;
}
.special-form .title-side-btn:hover { background: var(--control-glass-hover); }
.special-form .title-side-btn svg, #sticker-editor-close svg { width: 18px; height: 18px; }
.special-head .special-primary { background: var(--control-green); color: var(--control-green-ink); font-size: 14px; font-weight: 650; }
.special-head .special-primary:hover { background: var(--control-green-hover); }
.special-scroll { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 16px; }
.special-section {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--ui-text) 5%, transparent);
}
.special-section h3, .special-section > label[for] { margin: 0 0 3px; font-size: 14px; font-weight: 650; }
.special-form :is(textarea, input:not([type=checkbox], [type=radio])), .poll-suggest input {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  background: color-mix(in srgb, currentColor 5%, transparent);
  color: inherit;
  font: inherit;
  font-size: 16px;
}
.special-form textarea { resize: none; }
:is(.special-form, .poll-content) :is(input, textarea, button):focus {
  outline: none;
  box-shadow: none;
}
.special-form :is(textarea, input:not([type=checkbox], [type=radio])):focus, .poll-suggest input:focus {
  background: color-mix(in srgb, currentColor 8%, transparent);
  caret-color: currentColor;
}
:is(.special-form, .poll-content) button:focus-visible { text-decoration: underline; background-color: var(--control-glass-hover); }
.special-head .special-primary:focus-visible { background: var(--control-green-hover); color: var(--control-green-ink); }
:is(.special-form, .poll-content, .article-message) ::selection {
  color: inherit;
  background: color-mix(in srgb, var(--control-green) 28%, transparent);
}
.poll-editor-option { display: flex; gap: 8px; align-items: center; }
.poll-editor-option + .poll-editor-option { margin-top: 7px; }
.poll-editor-option button:disabled { opacity: .35; cursor: default; }
.special-inline {
  justify-self: start;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--accent-soft);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
html.light .special-inline { color: #086449; }
.special-inline:disabled { opacity: .45; cursor: default; }
.special-inline:hover:not(:disabled) { text-decoration: underline; }
.special-inline svg { width: 16px; height: 16px; }
#poll-add { display: inline-flex; align-items: center; gap: 6px; }
.poll-settings > label { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 4px 0; font-size: 14px; cursor: pointer; }
.poll-settings > label + label { border-top: 1px solid var(--ui-border); }
.poll-settings label > span { min-width: 0; }
.poll-settings small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.special-form input[role=switch] {
  appearance: none;
  position: relative;
  flex: 0 0 38px;
  height: 22px;
  margin: 0;
  border-radius: 12px;
  background: var(--control-glass-hover);
  cursor: pointer;
}
.special-form input[role=switch]::before { content: ''; position: absolute; inset: 3px auto 3px 3px; width: 16px; border-radius: 50%; background: var(--ui-text); }
.special-form input[role=switch]:checked { background: var(--control-green); }
.special-form input[role=switch]:checked::before { left: 19px; background: var(--control-green-ink); }
.special-form input[role=switch]:disabled { opacity: .45; cursor: default; }
.special-form label:has(:focus-visible) > span:first-child { text-decoration: underline; text-underline-offset: 3px; }
#poll-deadline { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#poll-deadline label { display: grid; gap: 4px; font-size: 13px; }
.special-form [hidden] { display: none !important; }
.special-error { margin: 0; color: #e36c70; font-size: 13px; }
.special-error:not(:empty) { margin-top: 10px; }
.article-content { line-height: 1.6; overflow-wrap: anywhere; }
.article-content a { color: var(--accent-soft); }
html.light .article-content a { color: #086449; }
.article-content :is(pre, table, .katex-display) { max-width: 100%; overflow: auto; }
.article-content :is(pre, code) { background: var(--control-glass); border-radius: 5px; }
.article-content pre { padding: 10px; }
.article-content pre code { background: none; }
.article-content pre :is(.hljs-keyword, .hljs-selector-tag, .hljs-doctag, .hljs-meta) { color: #e79ac8; }
.article-content pre :is(.hljs-string, .hljs-regexp, .hljs-addition) { color: #a8db91; }
.article-content pre :is(.hljs-number, .hljs-literal, .hljs-symbol) { color: #f5bc8e; }
.article-content pre :is(.hljs-title, .hljs-built_in, .hljs-attr, .hljs-variable, .hljs-name) { color: #a5caff; }
.article-content pre :is(.hljs-comment, .hljs-quote) { color: #a8b7c4; }
.article-content pre :is(.hljs-type, .hljs-params, .hljs-property) { color: #9ee7e2; }
.article-content pre :is(.hljs-keyword, .hljs-meta, .hljs-title) { font-weight: 600; }
html.light .article-content pre :is(.hljs-keyword, .hljs-selector-tag, .hljs-doctag, .hljs-meta) { color: #862761; }
html.light .article-content pre :is(.hljs-string, .hljs-regexp, .hljs-addition) { color: #306026; }
html.light .article-content pre :is(.hljs-number, .hljs-literal, .hljs-symbol) { color: #8c4117; }
html.light .article-content pre :is(.hljs-title, .hljs-built_in, .hljs-attr, .hljs-variable, .hljs-name) { color: #234f94; }
html.light .article-content pre :is(.hljs-comment, .hljs-quote) { color: #526370; }
html.light .article-content pre :is(.hljs-type, .hljs-params, .hljs-property) { color: #146064; }
.article-content pre[data-language]::before {
  content: attr(data-language);
  display: block;
  margin-bottom: 6px;
  font: 600 0.8em system-ui, sans-serif;
}
.article-content table { display: block; border-collapse: collapse; margin-block: 12px; }
.article-content :is(th, td) { padding: 6px 10px; border: 1px solid var(--ui-border); }
.article-content th { background: var(--control-glass); }
.article-content blockquote { margin-inline: 0; padding-inline-start: 12px; border-inline-start: 3px solid var(--control-green); }
.article-content hr { border: 0; border-top: 1px solid var(--ui-border); }
.article-content :is(h1, h2, h3, h4, h5, h6) { margin: .8em 0 .35em; font-weight: 650; line-height: 1.2; }
.article-content h1, .article-choices .article-level-1 { font-size: 1.85em; }
.article-content h2, .article-choices .article-level-2 { font-size: 1.55em; }
.article-content h3, .article-choices .article-level-3 { font-size: 1.34em; }
.article-content h4, .article-choices .article-level-4 { font-size: 1.18em; }
.article-content h5, .article-choices .article-level-5 { font-size: 1.08em; }
.article-content h6, .article-choices .article-level-6 { font-size: 1em; }
.article-content > :first-child { margin-top: 0; }
.article-content > :last-child { margin-bottom: 0; }
.article-content :is(td, th) > :is(p, div) { margin: 0; }
.article-content .article-formula { white-space: normal; }
.article-formula-number { display: block; text-align: end; font-size: .85em; }

.compose-field.article-active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 2px 6px;
  padding: 4px 5px;
}
.article-input {
  grid-column: 1 / -1;
  min-width: 0;
  max-height: min(45dvh, 360px);
  overflow: auto;
  border-radius: 18px 18px 6px 6px;
  color: var(--text);
  text-align: start;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.article-input .ProseMirror {
  position: relative;
  min-height: 40px;
  padding: 8px 9px;
  outline: none;
  white-space: pre-wrap;
  font-size: 16px;
  line-height: 1.45;
  -webkit-user-select: text;
  user-select: text;
}
.article-input[data-empty=true] .ProseMirror::before {
  position: absolute;
  inset-inline-start: 9px;
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}
.article-input .ProseMirror p { margin-block: 0 .45em; }
.article-input .ProseMirror > :last-child { margin-bottom: 0; }
.article-input .ProseMirror table { display: table; width: 100%; }
.article-input .ProseMirror :is(td, th) { min-width: 52px; padding: 4px 8px; }
.article-input .ProseMirror :is(td, th) > p { min-height: 1.45em; margin: 0; }
.article-input .selectedCell { background: var(--control-glass); }
.article-input .ProseMirror-selectednode { background: color-mix(in srgb, var(--control-green) 18%, transparent); outline: none; }
.article-input .ProseMirror ::selection, .article-value-form :is(input, textarea)::selection {
  color: inherit;
  background: color-mix(in srgb, var(--control-green) 30%, transparent);
}
#article-open[aria-expanded=true] { color: var(--accent-soft); background: var(--ui-surface-active); }
html.light #article-open[aria-expanded=true] { color: #086449; }
.article-tools {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 2px 4px;
  color: var(--text);
}
.article-tools button {
  display: inline-grid;
  place-items: center;
  padding: 0;
  min-width: 30px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.article-tools button:is(:focus-visible, [aria-pressed=true], [aria-expanded=true]) {
  background: var(--control-glass-hover);
  outline: none;
}
@media (hover: hover) {
  .article-tools button:hover { background: var(--control-glass-hover); }
}
.article-tools button svg { width: 18px; height: 18px; }
.article-popover {
  position: absolute;
  bottom: calc(100% + 6px);
  z-index: 42;
  padding: 8px;
  width: max-content;
  max-width: min(260px, calc(100vw - 28px));
  max-height: min(46dvh, 330px);
  overflow: auto;
  border: 1px solid var(--ui-border);
  border-radius: var(--control-radius);
  background: var(--ui-surface);
  color: var(--ui-text);
  box-shadow: 0 8px 28px #0004;
}
.article-choices { display: grid; font-size: 14px; }
.article-choices button { justify-items: start; padding: 4px 8px; height: auto; min-height: 30px; }
.article-table-size { margin: 2px 0 8px; color: var(--muted); font-size: 13px; }
.article-table-grid { display: grid; grid-template-columns: repeat(6, 26px); gap: 4px; }
.article-table-grid button { min-width: 0; height: 26px; border: 1px solid var(--ui-border); border-radius: 5px; background: var(--control-glass); }
.article-table-grid button.active { background: var(--ui-surface-active); border-color: var(--control-green); }
.article-value-form { display: grid; gap: 6px; }
.article-value-form :is(input:not([type=checkbox]), textarea) {
  width: 210px;
  max-width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: var(--control-glass);
  color: inherit;
  outline: none;
  font: inherit;
}
.article-value-form label { font-size: 13px; }
.article-value-form input[type=checkbox] { appearance: none; width: 14px; height: 14px; vertical-align: text-bottom; border: 1px solid var(--muted); border-radius: 4px; }
.article-value-form input[type=checkbox]:checked { background: var(--control-green); border-color: var(--control-green); }
.article-value-form input:focus-visible, .article-value-form textarea:focus-visible { outline: none; box-shadow: inset 0 -1px var(--muted); }

.file-list .poll-message { min-width: min(280px, 76%); }
body.messenger-mode .file-list :is(.poll-message, .article-message) .text-content,
.file-list :is(.poll-message, .article-message) .text-content { display: block; overflow: visible; white-space: normal; }
.file-list .article-without-bubble,
html body.messenger-mode .file-list .article-without-bubble:is(.mine, .theirs) { background: transparent; border: 0; box-shadow: none; }
.article-without-bubble .msg-tail { display: none; }
.article-message-body, .poll-content { min-width: 0; }
.article-message-heading { font-size: 1.25em; }
.article-message .article-content { -webkit-user-select: text; user-select: text; }
.special-message-label, .poll-status, .poll-voters, .poll-answer-percent { color: var(--muted); font-size: 12px; }
.special-message-title { display: block; margin: 0 0 2px; font-size: 16px; line-height: 1.3; }
.poll-description, .poll-status { margin: 6px 0 0; }
.poll-description { white-space: pre-wrap; }
.poll-ballot { display: grid; gap: 2px; margin-top: 8px; }
.poll-answer { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 0; }
.poll-answer:has(input:not(:disabled)) { cursor: pointer; }
.poll-choice, .poll-editor-option input[type=radio] {
  appearance: none;
  display: grid;
  place-items: center;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid color-mix(in srgb, currentColor 55%, transparent);
  border-radius: 50%;
  color: inherit;
  background: transparent;
  cursor: inherit;
}
.poll-choice[type=checkbox] { border-radius: 4px; }
.poll-choice:checked, .poll-editor-option input[type=radio]:checked { border-color: var(--control-green); }
.poll-choice:checked::after, .poll-editor-option input[type=radio]:checked::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: inherit;
  background: var(--control-green);
}
.poll-answer:has(:focus-visible), .poll-editor-option:has(input[type=radio]:focus-visible) { background: var(--control-glass); border-radius: 6px; }
.poll-answer-details { flex: 1; min-width: 0; }
.poll-answer-title, .poll-voters { display: block; }
.poll-answer-percent { min-width: 4ch; text-align: end; font-variant-numeric: tabular-nums; }
.poll-result-bar { display: block; height: 3px; margin: 3px 0; border-radius: 999px; background: var(--control-glass); }
.poll-result-bar::before { content: ''; display: block; width: var(--poll-share); height: 100%; border-radius: inherit; background: color-mix(in srgb, currentColor 55%, transparent); }
.poll-answer:has(input:checked) .poll-result-bar::before { background: var(--control-green); }
.poll-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 4px; }
.poll-actions .poll-secondary, html.light .poll-actions .poll-secondary { color: inherit; opacity: .8; font-weight: 400; }
.poll-correct { display: block; color: var(--accent-soft); }
html.light .poll-correct { color: #086449; }
.poll-suggest { display: flex; gap: 8px; margin-top: 6px; }
.poll-suggest input { padding: 5px 8px; font-size: 14px; }
.poll-suggest button { flex: none; }
.poll-content .special-inline:focus-visible { border-radius: 6px; }

@media (max-width: 600px) {
  .text-compose .compose-attach-actions { gap: 5px; }
  .text-compose .compose-attach-actions :is(#mobile-file-btn, #sticker-open, .special-attach) {
    min-width: 0;
    gap: 4px;
    padding-inline: clamp(5px, 2vw, 10px);
    font-size: 12px;
  }
  .text-compose .compose-attach-actions :is(#mobile-file-btn, #sticker-open, .special-attach) svg { width: 16px; height: 16px; }
  .special-overlay { place-items: end stretch; padding: 0; }
  .special-overlay .special-form { width: 100%; max-height: 88dvh; border-radius: 20px 20px 0 0; }
  .special-scroll { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}
