body { background: #111111; color: #dddddd; font-family: Arial, Helvetica, sans-serif; font-size: 14px; margin: 20px; }
a { color: #9bbcff; text-decoration: none; }
a:visited { color: #b9a2d6; }
a:hover { text-decoration: underline; }
#page { width: 94%; margin: 0 auto; }
.path { color: #888888; margin: 0 0 14px 0; }
table { width: 100%; border-collapse: collapse; }
th { color: #888888; text-align: left; font-size: 12px; font-weight: normal; border-bottom: 1px solid #444444; padding: 7px 8px; }
td { border-bottom: 1px solid #292929; padding: 9px 8px; }
.tools { border-top: 1px solid #333333; margin-top: 14px; padding-top: 12px; }
input { background: #181818; color: #dddddd; border: 1px solid #555555; padding: 6px; }
input.button, button.button { background: #252525; color: #dddddd; border: 1px solid #555555; padding: 6px 12px; cursor: pointer; }
select { background: #181818; color: #dddddd; border: 1px solid #555555; padding: 5px; max-width: 220px; }
.move-form { display: inline-block; margin-left: 8px; }
.move-form select { margin: 3px 0; }
input.password { width: 240px; }
.error { color: #ff9999; }
.good { color: #a8dfa8; }
.small { color: #888888; font-size: 12px; }
.logout { margin-top: 14px; }
.upload-progress { display: none; margin: 10px 0; }
.upload-progress-label { display:block; margin-top:4px; color:#888888; font-size:11px; }
.upload-progress-track { width: 100%; height: 10px; border: 1px solid #555555; background: #222222; }
.upload-progress-bar { width: 0%; height: 10px; background: #9bbcff; }
.preview { max-width: 100%; max-height: 80vh; }
.stream-controls { margin: 10px 0; padding: 9px; background: #1b1b1b; border: 1px solid #3b3b3b; }
.stream-controls select, .stream-controls button { margin: 3px 5px 3px 0; }
.stream-progress-track { display: block; width: 100%; height: 6px; margin-top: 6px; background: #333333; }
.stream-progress-bar { display: block; width: 0%; height: 6px; background: #9bbcff; }
.stream-status { display: block; margin-top: 5px; color: #aaaaaa; font-size: 12px; }
.filed-video-player { width: 100%; max-width: 100%; background: #000000; }
.filed-video-frame { width: 100%; min-height: 120px; max-height: 68vh; background: #000000; overflow: hidden; }
.filed-video-frame video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000000; }
.preview-frame { width: 100%; height: 75vh; border: 1px solid #444444; background: #ffffff; }
.css-editor { width: 100%; max-width: 900px; height: 360px; background: #080808; color: #dddddd; border: 1px solid #555555; font-family: monospace; font-size: 13px; }
.rename-form { display: inline-block; margin: 3px 6px 3px 0; }
.rename-form input[type=text] { width: 130px; }
.actions-cell { width: 44px; text-align: right; white-space: nowrap; }
.file-tools { display:block; }
.file-tools-main { display:flex; flex-wrap:wrap; align-items:center; gap:7px; }

.create-menu-panel {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin-left: 8px;
    vertical-align: middle;
}
.create-menu-panel button { margin: 0; }

.create-folder-panel { display:inline-flex; flex-wrap:wrap; align-items:center; gap:5px; padding:6px; background:#191919; border:1px solid #444; }
.create-folder-panel input[type=text] { width:170px; }
.file-upload-compact { display:inline-flex; flex-wrap:wrap; align-items:center; gap:7px; margin:0; padding:7px 0; }
.upload-file-input { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.upload-picker-link { display:inline-block; color:#9bbcff; text-decoration:underline; cursor:pointer; font-size:12px; }
.upload-picker-link:hover { color:#c2d7ff; }
.upload-file-input:focus + .upload-picker-link { outline:1px dotted #9bbcff; outline-offset:3px; }
.upload-file-name { display:inline-block; max-width:240px; color:#888888; font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; vertical-align:middle; }

.upload-submit { min-width:112px; }
.upload-form .upload-progress { flex-basis:100%; min-width:180px; }
.share-link-form { border-top:1px solid #333; padding-top:6px; }

.item-menu-wrap { position: relative; display: inline-block; text-align: left; }
.more-button { min-width: 34px; padding: 5px 8px; font-size: 16px; font-weight: bold; cursor: pointer; }
.context-menu { position: absolute; right: 0; top: 28px; z-index: 1000; min-width: 190px; max-width: 280px; padding: 9px; background: #1b1b1b; border: 1px solid #555555; box-shadow: 0 4px 14px #000000; }
.context-menu a { display: block; padding: 6px 4px; }
.context-menu form { display: block; margin: 7px 0; }
.context-menu .rename-form { display: block; margin: 7px 0; }
.context-menu .rename-form input[type=text] { width: 95%; }
.context-menu .move-form { display: block; margin: 7px 0; }
.context-menu select { display: block; width: 100%; max-width: none; }
.context-menu input.button { display: block; width: 100%; margin-top: 5px; }
.file-row[draggable="true"] { cursor: grab; }
.file-row.dragging td { opacity: .42; }
.file-row.drop-target td { background: #26392b; border-top: 1px solid #79b889; border-bottom: 1px solid #79b889; }
.path a.drop-target { background: #26392b; outline: 1px solid #79b889; padding: 3px 5px; }
/* Menus are closed by default even before the enhancement script runs. */
.context-menu { display: none; }
.context-menu.open { display: block; }
@media screen and (max-width: 640px) {
    body { margin: 8px; }
    #page { width: 100%; }
    td { padding: 7px 4px; }
    th { padding: 6px 4px; }
    .context-menu { position: fixed; top: auto; right: 8px; left: 8px; bottom: 8px; min-width: 0; max-width: none; max-height: 75%; overflow: auto; }
    .more-button { min-width: 40px; min-height: 36px; }
}

.chat-shell { margin-top: 10px; }
.chat-header { border-bottom: 1px solid #333333; padding: 0 0 10px 0; margin-bottom: 10px; }
.chat-header a { margin-right: 12px; }
.chat-layout { display: flex; gap: 12px; align-items: stretch; min-height: 72vh; }
.chat-files { box-sizing: border-box; flex: 0 0 31%; min-width: 220px; max-width: 380px; border: 1px solid #333333; padding: 10px; overflow-y: auto; max-height: 78vh; }
.chat-main { box-sizing: border-box; flex: 1 1 auto; min-width: 0; border: 1px solid #333333; padding: 10px; display: flex; flex-direction: column; }
.chat-main h2, .chat-files h3 { margin: 0 0 10px 0; font-size: 15px; }
#chat-messages { flex: 1 1 auto; min-height: 320px; max-height: 65vh; overflow-y: auto; border-bottom: 1px solid #333333; padding: 4px 2px 12px 2px; }
.chat-message { border-bottom: 1px solid #292929; padding: 9px 4px; overflow-wrap: anywhere; }
.chat-message-head { color: #999999; font-size: 12px; margin-bottom: 4px; }
.chat-message-head strong { color: #dddddd; font-size: 13px; }
.chat-message-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.chat-message-body a { overflow-wrap: anywhere; }
.chat-message-body .chat-youtube-card {
    display: flex; flex-direction: column; align-items: stretch; vertical-align: top;
    width: 240px; max-width: 100%; box-sizing: border-box; gap: 7px;
    margin: 8px 10px 9px 0; padding: 6px; overflow: hidden;
    border: 1px solid #383838; background: #141414; color: #e5e5e5;
    text-decoration: none; white-space: normal;
}
.chat-message-body .chat-youtube-card:hover { border-color: #777; background: #191919; }
.chat-youtube-thumbnail { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #090909; }
.chat-youtube-title {
    display: block; margin: 0 2px 2px; overflow-wrap: anywhere;
    color: #e5e5e5; font-size: 13px; font-weight: 700; line-height: 1.4;
}
@media screen and (max-width: 360px) {
    .chat-message-body .chat-youtube-card { width: 220px; margin-top: 7px; margin-bottom: 8px; }
    .chat-youtube-title { font-size: 12px; }
}
.chat-message-body .chat-file-path-link { color: #b9a2d6; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.chat-message-body .chat-file-path-link:hover { color: #e2d5f2; }
.chat-file-path-pending { color: inherit; }
.chat-reply-quote { border-left: 2px solid #7897c5; padding: 4px 8px; margin: 4px 0 7px 0; color: #999999; background: #181818; font-size: 12px; }
.chat-attachment { display: block; max-width: 100%; max-height: 360px; margin-top: 7px; }
.chat-attachment img { max-width: 100%; max-height: 360px; }
.chat-attachment video { max-width: 100%; max-height: 360px; }
.chat-attachment .filed-video-frame video { max-width: none; max-height: none; }
.chat-attachment .chat-video-embed { position: relative; display: block; width: 100%; max-width: 480px; aspect-ratio: 16 / 9; height: auto; max-height: 270px; overflow: hidden; background: #000000; }
.chat-attachment .chat-video-embed .filed-video-player { position: absolute; inset: 0; box-sizing: border-box; display: block; width: 100%; height: 100%; max-height: none; }
.chat-attachment .chat-video-embed .filed-video-frame { position: absolute; inset: 0; box-sizing: border-box; width: 100%; height: 100%; min-height: 0; max-height: none; }
.chat-attachment .chat-video-preview { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; background: #000000; }
.chat-attachment audio { max-width: 100%; }
.chat-message-actions { margin-top: 6px; font-size: 12px; }
.chat-message-actions button, .chat-reactions button { margin: 0 4px 0 0; padding: 3px 7px; }
.chat-reactions { display: inline-block; margin-left: 6px; }
.chat-compose { margin-top: 10px; }
#chat-compose { box-sizing: border-box; width: 100%; min-height: 76px; background: #080808; color: #dddddd; border: 1px solid #555555; padding: 8px; font-family: Arial, Helvetica, sans-serif; font-size: 14px; }
.chat-toolbar { display: flex; gap: 7px; align-items: center; margin-top: 6px; }
.chat-toolbar button { background: #252525; color: #dddddd; border: 1px solid #555555; padding: 6px 10px; cursor: pointer; }
#chat-emoji-picker { border: 1px solid #444444; background: #181818; padding: 8px; margin-top: 8px; max-height: 300px; overflow-y: auto; }
#chat-emoji-search { box-sizing: border-box; width: 100%; padding: 7px; background: #080808; color: #dddddd; border: 1px solid #555555; }
.chat-emoji-categories { display: flex; flex-wrap: wrap; gap: 4px; margin: 7px 0; }
.chat-emoji-categories button { padding: 4px 6px; font-size: 11px; }
.chat-emoji-categories button.active { border-color: #8db8ff; color: #ffffff; }
.chat-emoji-grid { display: flex; flex-wrap: wrap; gap: 2px; }
.chat-emoji-choice { font-size: 21px; min-width: 36px; min-height: 36px; padding: 3px; }
.chat-emoji-item { display:inline-flex; flex-direction:column; align-items:center; justify-content:flex-start; gap:2px; }
.chat-emoji-edit { font-size:10px !important; line-height:1.2; padding:2px 4px !important; min-height:0; }
.chat-emoji-upload #chat-emoji-shortcode[readonly] { opacity:.75; }
.chat-emoji-more { width: 100%; font-size: 12px !important; }

.chat-file-row { padding: 8px 2px; border-bottom: 1px solid #292929; overflow-wrap: anywhere; }
.chat-file-row img { max-width: 100%; max-height: 90px; display: block; margin-bottom: 5px; }
.chat-file-actions { margin-top: 5px; }
.chat-file-actions button { margin-right: 5px; }
.chat-progress { display: none; margin: 8px 0; }
.chat-progress-track { height: 9px; border: 1px solid #555555; background: #222222; }
.chat-progress-bar { height: 9px; width: 0; background: #9bbcff; }
.chat-status { min-height: 18px; color: #999999; font-size: 12px; margin-top: 5px; }
#chat-app .chat-typing-indicator { display: none; margin: 0; color: #929292; font: 11px/1.35 ui-monospace, SFMono-Regular, Consolas, monospace; }
.chat-custom-emoji { width: 25px; height: 25px; object-fit: contain; vertical-align: middle; }
.chat-join { max-width: 520px; }
.chat-join .chat-form { border-top: 1px solid #333333; padding: 12px 0; }
.chat-join input[type=text], .chat-join input[type=password] { width: 220px; max-width: 90%; }
@media screen and (max-width: 760px) {
    .chat-layout { display: block; min-height: 0; }
    .chat-files { max-width: none; width: 100%; max-height: 33vh; margin-bottom: 9px; }
    .chat-main { min-height: 65vh; }
    #chat-messages { max-height: 48vh; min-height: 230px; }
    .chat-toolbar { flex-wrap: wrap; }
}

/* Compact spacing pass: keep chat panels, forms, and messages aligned. */
.chat-shell { margin-top: 2px; }
.chat-header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 0 7px 0; margin: 0 0 8px 0; }
.chat-header a { margin: 0 4px 0 0; }
.chat-header form { margin: 0; padding: 0; }
.chat-header .small { margin-left: auto; }
.chat-layout { gap: 8px; min-height: 0; height: 76vh; }
.chat-files { flex: 0 0 260px; width: 260px; min-width: 0; max-width: none; max-height: 76vh; padding: 8px; }
.chat-main { height: 76vh; min-height: 0; padding: 8px; }
.chat-main h2, .chat-files h3 { margin: 0 0 7px 0; line-height: 1.25; }
.chat-files h3:not(:first-child) { margin-top: 12px; }
.chat-files p { margin: 5px 0; }
.chat-files .small { margin: 4px 0 7px 0; line-height: 1.3; }
.chat-files input[type=file] { max-width: 100%; box-sizing: border-box; }
#chat-messages { min-height: 0; max-height: none; padding: 2px 2px 7px 2px; }
.chat-message { padding: 6px 4px; }
.chat-message-head { margin-bottom: 3px; line-height: 1.25; }
.chat-message-body { line-height: 1.35; }
.chat-message-actions { margin-top: 4px; }
.chat-reply-quote { margin: 3px 0 5px 0; }
#chat-reply-banner:empty { display: none; }
.chat-compose { margin-top: 7px; }
#chat-compose { min-height: 64px; padding: 7px; }
.chat-toolbar { gap: 5px; margin-top: 5px; }
.chat-toolbar button { padding: 5px 9px; }
#chat-emoji-picker { padding: 7px; margin-top: 6px; }
.chat-emoji-categories { gap: 3px; margin: 5px 0; }
.chat-emoji-grid { gap: 1px; }
.chat-emoji-choice { min-width: 32px; min-height: 32px; }
.chat-file-row { padding: 6px 2px; }
.chat-file-actions { margin-top: 4px; }
.chat-progress { margin: 6px 0; }
.chat-status { min-height: 14px; margin-top: 3px; }
.chat-join { max-width: 440px; }
.chat-join h2 { margin: 8px 0; }
.chat-join .chat-form { padding: 8px 0; }
.chat-join .chat-form p { margin: 6px 0; }
@media screen and (max-width: 760px) {
    .chat-header { gap: 7px; }
    .chat-header .small { margin-left: 0; }
    .chat-layout { display: block; height: auto; min-height: 0; }
    .chat-files { width: 100%; max-width: none; max-height: 260px; margin: 0 0 8px 0; padding: 8px; }
    .chat-main { width: 100%; height: 72vh; min-height: 430px; padding: 8px; }
    #chat-messages { height: auto; min-height: 0; max-height: none; }
    .chat-toolbar { flex-wrap: wrap; }
}
@media screen and (max-width: 420px) {
    body { margin: 6px; }
    #page { width: 100%; }
    .chat-main { height: 70vh; min-height: 390px; }
    .chat-files { max-height: 230px; }
    .chat-message-head { font-size: 11px; }
}

/* Chat viewport fit: lock the page and let the message/file panes scroll internally. */
html { height: 100%; }
body.chat-page { height: 100%; min-height: 0; margin: 0; padding: 0; overflow: hidden; }
.chat-page #page { width: 100%; height: 100vh; height: 100dvh; max-width: none; margin: 0; padding: 6px; box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden; }
.chat-page .chat-shell { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; height: 100%; margin: 0; overflow: hidden; }
.chat-page .chat-header { flex: 0 0 auto; gap: 6px; padding: 0 0 5px 0; margin: 0 0 6px 0; }
.chat-page .chat-layout { display: flex; flex: 1 1 auto; flex-direction: row; gap: 7px; height: auto; min-height: 0; overflow: hidden; }
.chat-page .chat-files { flex: 0 0 clamp(190px, 25vw, 310px); width: auto; height: 100%; min-height: 0; max-height: none; overflow: auto; padding: 7px; box-sizing: border-box; }
.chat-page .chat-main { display: flex; flex: 1 1 auto; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; padding: 7px; box-sizing: border-box; }
.chat-page .chat-main h2 { flex: 0 0 auto; margin: 0 0 5px 0; }
.chat-page #chat-messages { flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto; overscroll-behavior: contain; padding: 2px 3px 6px 3px; }
.chat-page .chat-compose { flex: 0 0 auto; position: relative; margin-top: 5px; }
.chat-page #chat-compose { height: 50px; min-height: 42px; max-height: 18vh; resize: vertical; overflow: auto; }
.chat-page .chat-toolbar { margin-top: 4px; }
.chat-page .chat-status { flex: 0 0 auto; min-height: 13px; margin-top: 2px; }
.chat-page #chat-emoji-picker { position: absolute; z-index: 3000; right: 0; bottom: calc(100% + 5px); width: min(440px, 96%); max-height: min(44vh, 330px); margin: 0; box-sizing: border-box; overflow: auto; box-shadow: 0 5px 20px #000000; }
.chat-page .chat-emoji-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.chat-page .chat-emoji-picker-head button { padding: 3px 7px; }
.chat-page .chat-reactions { display: inline-flex; flex-wrap: wrap; gap: 3px; margin-left: 5px; vertical-align: middle; }
.chat-page .chat-reactions button { margin: 0; padding: 2px 6px; }
.chat-page .chat-reaction-add { min-width: 27px; }
@media screen and (max-width: 760px) {
    .chat-page #page { padding: 4px; }
    .chat-page .chat-header { gap: 5px; padding-bottom: 4px; margin-bottom: 5px; }
    .chat-page .chat-layout { flex-direction: column; gap: 5px; }
    .chat-page .chat-files { flex: 0 1 22%; width: 100%; height: auto; min-height: 62px; max-height: none; padding: 6px; }
    .chat-page .chat-main { flex: 1 1 auto; width: 100%; height: auto; min-height: 0; padding: 6px; }
    .chat-page .chat-files h3 { display: inline-block; margin: 0 7px 4px 0; }
    .chat-page .chat-files h3:not(:first-child) { margin-top: 0; }
    .chat-page .chat-files .small { display: none; }
    .chat-page #chat-messages { max-height: none; min-height: 0; }
    .chat-page #chat-compose { height: 46px; max-height: 15vh; }
}
@media screen and (max-height: 560px) {
    .chat-page #page { padding: 3px; }
    .chat-page .chat-header { padding-bottom: 3px; margin-bottom: 3px; }
    .chat-page .chat-files { padding: 5px; }
    .chat-page .chat-main { padding: 5px; }
    .chat-page #chat-compose { height: 38px; min-height: 34px; }
    .chat-page .chat-message { padding-top: 4px; padding-bottom: 4px; }
}


/* Friend chat: conversation-first layout with presence and composer attachments. */
.chat-page .chat-layout { display:flex; flex-direction:row; gap:8px; min-height:0; }
.chat-page .chat-main { flex:1 1 auto; min-width:0; }
.chat-page .chat-online { flex:0 0 190px; width:190px; min-height:0; overflow:auto; border:1px solid #333; background:#141414; padding:8px; box-sizing:border-box; }
.chat-online-title { font-weight:bold; font-size:13px; margin:0 0 7px 0; color:#ddd; }
.chat-online-title span { color:#888; font-weight:normal; }
.chat-online-list { display:flex; flex-direction:column; gap:3px; }
.chat-online-user { display:flex; align-items:center; gap:7px; width:100%; text-align:left; border:0; background:transparent; color:#ddd; padding:6px 5px; cursor:pointer; }
.chat-online-user:hover { background:#222; }
.chat-online-dot { width:7px; height:7px; border-radius:0; background:#73c58a; display:inline-block; flex:0 0 7px; }
.chat-notification-toggle { background:#222; color:#ddd; border:1px solid #444; padding:5px 8px; cursor:pointer; }
#chat-notification-count { display:inline-block; background:#bd4e5b; color:white; border-radius:0; padding:1px 5px; font-size:10px; margin-left:3px; }
.chat-header { position:relative; }
.chat-notification-panel { position:absolute; right:60px; top:32px; width:min(340px,90vw); max-height:45vh; overflow:auto; z-index:4000; border:1px solid #555; background:#1b1b1b; box-shadow:0 5px 20px #000; padding:6px; }
.chat-notification-item { width:100%; display:block; text-align:left; background:transparent; color:#ddd; border:0; border-bottom:1px solid #333; padding:8px; cursor:pointer; }
.chat-notification-item strong, .chat-notification-item span { display:block; }
.chat-notification-item span { color:#aaa; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:3px; }
.chat-message-group { border-bottom:1px solid #292929; padding:5px 3px; }
.chat-message-group .chat-message-head { margin:0 0 3px 0; }
.chat-message-group .chat-message { border:0; padding:2px 34px 2px 0; }
.chat-message { position:relative; padding-right:34px; }
.chat-message-actions { display:none; position:absolute; right:2px; top:0; z-index:5; margin:0; padding:3px; gap:3px; align-items:center; background:#202020; border:1px solid #454545; box-shadow:0 2px 8px #000; }
.chat-message:hover .chat-message-actions, .chat-message:focus-within .chat-message-actions, .chat-message.actions-open .chat-message-actions { display:flex; }
.chat-message-actions button { margin:0; padding:3px 7px; }
.chat-message-more { display:none; position:absolute; top:0; right:0; margin:0; padding:2px 6px; font-size:13px; }
@media (hover:none) {
  .chat-message-more { display:inline-block; }
  .chat-message:hover .chat-message-actions { display:none; }
  .chat-message:focus-within .chat-message-actions { display:none; }
  .chat-message.actions-open .chat-message-actions { display:flex; }
}
.chat-mention { color:#a9c7ff; background:#28384d; border-radius:0; padding:0 2px; }
.chat-pending-file { margin:4px 0; padding:5px 8px; background:#202a22; border:1px solid #38543d; color:#c8e5cc; font-size:12px; }
.chat-pending-file button { margin-left:8px; }
.chat-tool-button { display:inline-block; background:#252525; color:#ddd; border:1px solid #555; padding:5px 9px; cursor:pointer; }
.chat-server-picker { position:absolute; right:0; bottom:calc(100% + 5px); z-index:3500; width:min(540px,96%); max-height:min(54vh,440px); overflow:auto; box-sizing:border-box; padding:8px; background:#181818; border:1px solid #555; box-shadow:0 5px 20px #000; }
#chat-server-search { width:100%; box-sizing:border-box; background:#080808; color:#ddd; border:1px solid #555; padding:7px; }
.chat-server-file-row { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:6px 2px; border-bottom:1px solid #333; font-size:12px; }
.chat-server-file-row span { overflow-wrap:anywhere; }
.chat-emoji-upload { border-top:1px solid #333; padding-top:7px; margin-top:8px; display:flex; flex-wrap:wrap; gap:5px; }
.chat-emoji-upload input[type=text] { min-width:100px; width:130px; }
.chat-emoji-upload input[type=file] { max-width:180px; }
.chat-compose { position:relative; }
.chat-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:5px; }
.chat-toolbar button, .chat-tool-button { font-size:12px; }
@media screen and (max-width:760px) {
  .chat-page .chat-layout { flex-direction:column; }
  .chat-page .chat-online { flex:0 0 auto; width:100%; max-height:90px; overflow:auto; }
  .chat-online-list { flex-direction:row; flex-wrap:wrap; }
  .chat-online-user { width:auto; }
  .chat-message-actions { right:28px; max-width:calc(100% - 38px); flex-wrap:wrap; }
  .chat-notification-panel { right:0; }
  .chat-server-picker { width:96%; right:2%; }
}


/* Final file/admin UI normalization: one toolbar, one row menu, consistent controls. */
.file-browser-shell, .admin-shell { width:100%; max-width:1120px; margin:0 auto; }
.file-browser-top { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px 18px; padding:0 0 10px 0; margin:0 0 10px 0; border-bottom:1px solid #333; }
.file-browser-top .path { margin:0; min-width:0; overflow-wrap:anywhere; }
.file-browser-nav { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.file-browser-nav form { display:inline; margin:0; }
.file-browser-nav a, .file-browser-nav button { font-size:12px; }
.quiet-button { background:transparent; color:#9bbcff; border:0; padding:2px 0; cursor:pointer; text-decoration:underline; }
.file-notice { margin:8px 0; }
.file-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:8px 14px; padding:8px 0 10px 0; margin:0 0 6px 0; border-bottom:1px solid #292929; }
.file-toolbar .file-tools-main { display:flex; align-items:center; flex-wrap:wrap; gap:8px 14px; width:100%; }
.file-toolbar .file-upload-url { display:inline-flex; align-items:center; flex-wrap:wrap; gap:5px 8px; margin:0; padding:0; border:0; }
.file-upload-url-label { color:#aaa; font-size:12px; }
.file-upload-url input[type="url"] { width:min(260px, 48vw); min-width:150px; max-width:100%; padding:5px 7px; }
.file-toolbar .file-upload-compact { display:inline-flex; align-items:center; flex-wrap:wrap; gap:5px 8px; margin:0; padding:0; border:0; }
.file-toolbar .upload-picker-link { font-size:13px; }
.file-toolbar .upload-file-name { max-width:180px; }
.file-toolbar .upload-submit { min-width:0; padding:4px 8px; font-size:12px; }
.file-toolbar .upload-progress { flex-basis:100%; min-width:180px; margin:3px 0 0 0; }
.file-table { width:100%; table-layout:auto; border-collapse:collapse; }
.file-table th { padding:7px 10px; white-space:nowrap; }
.file-table td { padding:8px 10px; vertical-align:middle; }
.file-table tbody tr:hover td { background:#171717; }
.file-table .file-name-cell { width:100%; overflow-wrap:anywhere; }
.file-table .file-name-cell a { font-weight:normal; }
/* Select tool: checkboxes live inside the name cell and only appear while selecting, so the table layout never changes. */
.file-pick { display:none; margin:0 9px 0 0; vertical-align:middle; cursor:pointer; }
.file-select-checkbox { width:15px; height:15px; margin:0; vertical-align:middle; accent-color:#929292; cursor:pointer; }
.file-table.is-selecting .file-pick { display:inline-block; }
.file-table.is-selecting .file-row { cursor:pointer; -webkit-user-select:none; user-select:none; }
.file-table.is-selecting .file-row:not([data-selectable]) { opacity:.45; cursor:default; }
.file-table.is-selecting .item-menu-wrap { visibility:hidden; pointer-events:none; }
.file-table.is-selecting .file-row:not([data-selectable]) .file-pick { display:none; }
/* File operations bar: Create | Upload | Select | Clipboard, as separated groups. */
.file-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:10px 0; padding:8px 0 10px 0; }
.file-toolbar .ops-group { display:flex; align-items:center; flex-wrap:wrap; gap:6px 12px; margin:0; padding:0 16px; border:0; border-left:1px solid #333; min-height:30px; }
.file-toolbar .ops-group:first-child { padding-left:0; border-left:0; }
.file-toolbar .ops-group.file-paste-form[style*="none"] { display:none !important; }
.file-toolbar .ops-upload { flex:1 1 100%; gap:6px 22px; padding:8px 0 0 0; border-left:0; border-top:1px solid #292929; }
.file-toolbar .ops-upload .upload-form, .file-toolbar .ops-upload .file-upload-url { padding:0; }
.file-toolbar > .create-folder-panel { flex:1 1 100%; order:10; margin:2px 0 0 0; }
.file-selection-actions { display:flex; align-items:center; flex-wrap:wrap; gap:6px 12px; }
.file-selection-actions[hidden] { display:none; }
.file-selection-count { min-width:96px; color:#999; font-size:12px; }
.file-selection-actions { gap:5px 10px; }
.file-selection-bar { min-width:0; }
.file-selection-bar button:disabled { opacity:.42; cursor:default; }
.file-selection-bar [data-file-select-toggle][aria-pressed="true"] { color:#ddd; }
.file-selection-bar [data-file-cut-selected] { color:#ddd; }
html body .file-table.is-selecting tbody tr.is-selected td {
    background:#202326 !important;
    box-shadow:inset 0 1px 0 #34383b, inset 0 -1px 0 #34383b;
}
html body .file-table.is-selecting tbody tr.is-selected td:first-child {
    box-shadow:inset 3px 0 #929292, inset 0 1px 0 #34383b, inset 0 -1px 0 #34383b;
}
@media screen and (max-width: 640px) {
    .file-toolbar .ops-group { width:100%; box-sizing:border-box; padding:8px 0 0 0; border-left:0; border-top:1px solid #2a2a2a; }
    .file-toolbar .ops-group:first-child { padding-top:0; border-top:0; }
    .file-toolbar .ops-select { margin-left:0; }
}
/* Playlist player */
.filed-playlist { margin:10px 0 14px 0; padding:12px; border:1px solid #383838; background:#151515; }
.fp-head { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; margin:0 0 10px 0; }
.fp-count { color:#999; font-size:12px; }
.fp-filter { flex:1 1 140px; max-width:260px; margin-left:auto; padding:4px 7px; font-size:13px; }
.fp-now { display:flex; flex-direction:column; gap:2px; margin:0 0 8px 0; min-height:36px; overflow-wrap:anywhere; }
.fp-now-title { font-size:16px; color:#fff; }
.fp-now-folder { color:#888; font-size:12px; }
.fp-now-folder:empty { display:none; }
.fp-seek { display:flex; align-items:center; gap:10px; margin:0 0 10px 0; }
.fp-time { color:#999; font-size:12px; min-width:38px; font-variant-numeric:tabular-nums; }
.fp-time:last-child { text-align:right; }
.fp-range { flex:1; min-width:0; height:18px; margin:0; accent-color:#9bbcff; cursor:pointer; }
.fp-controls { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; margin:0 0 6px 0; }
.fp-controls button[disabled] { opacity:.4; cursor:default; }
.fp-controls button[aria-pressed=true] { color:#9bbcff; text-decoration:underline; }
.fp-play { min-width:76px; }
.fp-volume { display:inline-flex; align-items:center; gap:8px; margin-left:auto; }
.fp-volume-range { flex:none; width:96px; }
.filed-playlist-audio { display:none; }
.filed-playlist-track-list { list-style:none; max-height:260px; overflow:auto; margin:8px 0 0 0; padding:0; border-top:1px solid #2a2a2a; }
.filed-playlist-track-list li { border-bottom:1px solid #222; }
.filed-playlist-track-list button { display:flex; align-items:baseline; gap:10px; width:100%; box-sizing:border-box; background:transparent; border:0; padding:7px 6px; color:#ccc; cursor:pointer; text-align:left; font:inherit; }
.filed-playlist-track-list button:hover { background:#1d1d1d; color:#fff; }
.filed-playlist-track-list button.is-playing { background:#1c2a47; color:#fff; }
.fp-num { flex:none; min-width:26px; color:#777; font-size:12px; text-align:right; font-variant-numeric:tabular-nums; }
.fp-title { flex:1; min-width:0; overflow-wrap:anywhere; }
.fp-folder { flex:none; max-width:35%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#777; font-size:12px; }
.fp-folder:empty { display:none; }
.filed-playlist-track-list button.is-playing .fp-num::before { content:"\25B6"; }
.filed-playlist-track-list button.is-playing .fp-num { font-size:0; }
.filed-playlist-track-list button.is-playing .fp-num::before { font-size:11px; color:#9bbcff; }
@media screen and (max-width: 640px) {
    .fp-volume { margin-left:0; width:100%; }
    .fp-volume-range { flex:1; width:auto; }
    .fp-filter { max-width:none; margin-left:0; }
    .fp-folder { display:none; }
}
.file-table .file-size-col, .file-table .file-date-col { color:#888; white-space:nowrap; font-size:12px; }
.file-table .actions-cell { width:42px; min-width:42px; text-align:right; white-space:nowrap; }
.file-table .parent-row td { color:#888; }
.file-table .empty-state { padding:22px 10px; color:#777; text-align:center; }
.more-button { background:transparent; color:#aaa; border:1px solid transparent; border-radius:0; min-width:32px; min-height:30px; padding:2px 7px; font-size:18px; line-height:1; }
.more-button:hover, .more-button[aria-expanded="true"] { color:#fff; background:#222; border-color:#444; }
.context-menu { min-width:220px; max-width:300px; padding:6px; border-radius:0; background:#191919; border:1px solid #444; box-shadow:0 8px 24px rgba(0,0,0,.45); }
.context-menu .menu-action, .context-menu .menu-action-button { display:block; width:100%; box-sizing:border-box; padding:7px 8px; color:#ddd; background:transparent; border:0; text-align:left; text-decoration:none; font:inherit; cursor:pointer; }
.context-menu .menu-action:hover, .context-menu .menu-action-button:hover { background:#282828; text-decoration:none; }
.context-menu .menu-form { display:block; margin:5px 0 0 0; padding:6px 2px 2px 2px; border-top:1px solid #333; }
.context-menu .menu-form label { display:block; margin:0 0 4px 0; color:#888; font-size:11px; }
.context-menu .menu-form-row { display:flex; align-items:center; gap:5px; }
.context-menu .menu-form-row input[type=text], .context-menu .menu-form-row select { flex:1 1 auto; min-width:0; max-width:none; width:100%; box-sizing:border-box; }
.context-menu .menu-form-row .button { flex:0 0 auto; margin:0; }
.context-menu .danger-action { color:#f09b9b; }
.context-menu .danger-action:hover { background:#382020; }
.admin-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; margin:8px 0; }
.admin-toolbar h2 { margin:0; font-size:18px; }
.admin-settings { margin-top:24px; padding-top:14px; border-top:1px solid #333; max-width:560px; }
.admin-settings h2 { font-size:16px; margin:0 0 12px 0; }
.settings-form { display:grid; grid-template-columns:1fr; gap:10px; }
.settings-form label { display:block; color:#999; font-size:12px; }
.settings-form input { display:block; box-sizing:border-box; width:100%; max-width:360px; margin-top:4px; }
.settings-form .button { width:auto; }
.admin-file-note { margin-top:12px; }
.file-readonly-note { margin:8px 0; }
/* Keep every action menu hidden unless its own row has been activated. */
.context-menu { display:none !important; }
.context-menu.open { display:block !important; }

@media screen and (max-width:700px) {
  .file-table .file-date-col { display:none; }
  .file-table th.file-date-col, .file-table td.file-date-col { display:none; }
  .file-table th, .file-table td { padding:7px 6px; }
  .file-toolbar { gap:8px; }
  .file-toolbar .file-upload-compact { flex-basis:100%; }
  .file-toolbar .upload-file-name { max-width:44vw; }
  .context-menu { position:fixed; top:auto; bottom:8px; right:8px; left:8px; min-width:0; max-width:none; max-height:70vh; overflow:auto; }
}


/* Voice channel */
.vc-shell { max-width: 1080px; margin: 0 auto; }
.vc-head { display:flex; align-items:center; gap:14px; min-height:42px; border-bottom:1px solid #333; margin-bottom:12px; }
.vc-head strong { color:#eee; font-size:16px; }
.vc-head .small { margin-left:auto; }
.vc-main { display:flex; flex-direction:column; gap:12px; }
.vc-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:7px; }
.vc-toolbar button { background:#252525; color:#ddd; border:1px solid #555; padding:7px 11px; cursor:pointer; }
.vc-toolbar button:disabled { opacity:.45; cursor:not-allowed; }
.vc-divider { height:24px; border-left:1px solid #444; margin:0 3px; }
.vc-people, .vc-recordings { border-top:1px solid #333; padding-top:9px; }
.vc-people h3 { margin:0 0 8px; color:#ddd; font-size:13px; font-weight:normal; }
#vc-people-list { display:flex; flex-wrap:wrap; gap:7px; }
.vc-person { display:flex; align-items:center; gap:7px; border:1px solid #383838; background:#191919; padding:7px 9px; }
.vc-dot { width:8px; height:8px; border-radius:0; background:#68b879; display:inline-block; }
.vc-dot.muted { background:#bb9956; }
.vc-person-name { color:#ddd; }
.vc-person-state { color:#888; font-size:11px; }
.vc-empty { color:#888; font-size:12px; }
.vc-screens { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:9px; }
.vc-screen-card { background:#090909; border:1px solid #333; padding:7px; min-width:0; }
.vc-screen-label { color:#aaa; font-size:12px; padding-bottom:6px; }
.vc-screen-card video { display:block; width:100%; max-height:56vh; object-fit:contain; background:#000; }
.vc-audio { display:none; }
.vc-recording-link { color:#9bbcff; text-decoration:underline; }
@media (max-width:640px) {
  .vc-head { gap:9px; flex-wrap:wrap; }
  .vc-toolbar { gap:5px; }
  .vc-toolbar button { padding:8px; }
  .vc-divider { display:none; }
}

/* File-backed voice action controls are intentionally styled as simple links. */
.voice-file-action { display: inline; margin: 0; padding: 0; }
.voice-file-action-link { display: inline; border: 0; padding: 0; margin: 0; color: #9bbcff; background: transparent; font: inherit; text-decoration: underline; cursor: pointer; }
.voice-file-action-link:hover { color: #c5d8ff; }
.voice-file-action-link:focus-visible { outline: 1px dotted currentColor; outline-offset: 3px; }


/* FILED RESPONSIVE LAYOUT FIX
   Additive overrides only: keep the site's existing colors, typography,
   borders, controls and spacing.  The goal is to prevent the document from
   becoming wider than the viewport, not to redesign the interface. */

html:root {
    max-width: 100vw !important;
    min-width: 0 !important;
    overflow-x: hidden !important; /* fallback */
    overflow-x: clip !important;
}

html body {
    width: auto !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    overflow-x: hidden !important; /* fallback */
    overflow-x: clip !important;
}

.file-browser-shell,
.admin-shell {
    width: 100% !important;
    max-width: 1120px !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

html body #page {
    width: 94% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.file-browser-shell,
.admin-shell,
.file-browser-top,
.file-browser-top .path,
.file-browser-nav,
.file-toolbar,
.file-toolbar > *,
.file-toolbar form,
.file-table,
.file-table th,
.file-table td {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* Long filenames and paths must wrap instead of setting the table width. */
.file-browser-shell,
.admin-shell,
.file-browser-top .path,
.file-table .file-name-cell,
.file-table .file-name-cell a,
.file-browser-shell p,
.admin-shell p {
    overflow-wrap: anywhere;
    word-break: break-word;
}

html body #page .file-table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
}

html body #page .file-table th:first-child,
html body #page .file-table td.file-name-cell {
    width: auto !important;
    min-width: 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

.file-table .file-name-cell a {
    display: inline;
    max-width: 100%;
}

html body #page .file-table th.file-size-col,
html body #page .file-table td.file-size-col {
    width: 78px !important;
    white-space: nowrap;
}

html body #page .file-table th.file-date-col,
html body #page .file-table td.file-date-col {
    width: 142px !important;
    white-space: nowrap;
}

html body #page .file-table th.actions-cell,
html body #page .file-table td.actions-cell {
    width: 44px !important;
    min-width: 44px !important;
    text-align: right;
    white-space: nowrap;
}

/* Toolbars and forms wrap naturally; their controls may never force a wider page. */
.file-toolbar {
    width: 100%;
    flex-wrap: wrap;
    align-items: center;
}

.file-toolbar > *,
.file-toolbar form,
.file-toolbar .file-upload-compact,
.file-toolbar .create-folder-panel {
    max-width: 100%;
    min-width: 0;
}

.file-toolbar input,
.file-toolbar select,
.file-toolbar textarea,
.file-toolbar button {
    max-width: 100%;
    box-sizing: border-box;
}

.file-toolbar .upload-file-name {
    max-width: min(180px, 36vw);
}

.file-toolbar .create-text-panel textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Media, form controls and long user-generated text stay inside the viewport. */
html body #page img,
html body #page video,
html body #page iframe,
html body #page canvas,
html body #page table,
html body #page input,
html body #page select,
html body #page textarea,
html body #page pre {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

#page pre,
#page code,
#page .small,
#page p,
#page label,
#page a {
    overflow-wrap: anywhere;
}

@media screen and (max-width: 760px) {
    html body #page {
        width: 100% !important;
        max-width: 100% !important;
    }

    .file-browser-top {
        align-items: flex-start;
        gap: 8px;
    }

    .file-browser-nav {
        flex-wrap: wrap;
        gap: 8px 12px;
    }

    .file-table th,
    .file-table td {
        padding: 7px 5px;
    }

    html body #page .file-table th.file-date-col,
    html body #page .file-table td.file-date-col {
        display: none !important;
    }

    html body #page .file-table th.file-size-col,
    html body #page .file-table td.file-size-col {
        width: 66px;
        font-size: 11px;
    }

    .file-toolbar {
        align-items: flex-start;
        gap: 8px;
    }

    .file-toolbar .file-upload-compact {
        flex: 1 1 220px;
    }

    .file-toolbar .upload-file-name {
        max-width: min(42vw, 180px);
    }

    .context-menu {
        width: auto;
        max-width: calc(100vw - 16px);
        box-sizing: border-box;
    }
}

@media screen and (max-width: 640px) {
    body { margin: 8px; }
}

@media screen and (max-width: 420px) {
    .file-table th,
    .file-table td {
        padding: 6px 4px;
    }

    html body #page .file-table th.file-size-col,
    html body #page .file-table td.file-size-col {
        display: none !important;
    }

    .file-table th.actions-cell,
    .file-table td.actions-cell {
        width: 40px;
        min-width: 40px;
    }

    .file-toolbar .create-folder-panel,
    .file-toolbar .create-text-panel,
    .file-toolbar .file-upload-compact {
        max-width: 100%;
    }

    .file-toolbar .create-folder-panel,
    .file-toolbar .create-text-panel {
        flex: 1 1 100%;
        width: 100%;
    }

    .file-toolbar .create-folder-panel input[type="text"],
    .file-toolbar .create-text-panel input[type="text"],
    .file-toolbar .create-text-panel textarea {
        width: 100% !important;
        max-width: 100% !important;
    }

    .file-toolbar .upload-file-name {
        max-width: calc(100vw - 150px);
    }
}


/* Filed finishing touches: viewport fit, accessible drag ordering, compact menus,
   and consistent text-document/editor presentation. Existing theme tokens stay intact. */
html, body {
    width: 100%;
    min-width: 0;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-x: clip;
    box-sizing: border-box;
}
html body #page {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 !important;
    padding: 14px;
    box-sizing: border-box;
}
.file-browser-shell, .admin-shell {
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    box-sizing: border-box;
}

/* Fine insertion targets between rows; a folder's central drop area remains a move-into target. */
.file-row.drop-before td { border-top: 2px solid #8fbd9b !important; }
.file-row.drop-after td { border-bottom: 2px solid #8fbd9b !important; }
.file-row.drop-target td { background: #26392b !important; }
.file-row[draggable="true"] { cursor: grab; }
.file-row[draggable="true"]:active { cursor: grabbing; }

/* Menus are anchored by the viewport-aware menu helper and arranged into columns
   when needed, so their complete contents stay visible without a scroll area. */
.context-menu,
.context-menu.open {
    box-sizing: border-box;
    width: min(340px, calc(100vw - 16px));
    min-width: 0 !important;
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    overflow: hidden;
    gap: 2px 6px;
    padding: 7px;
    font-size: 12px;
    line-height: 1.2;
}
.context-menu.open { display: grid !important; }
.context-menu .menu-action,
.context-menu .menu-action-button {
    min-width: 0;
    padding: 5px 6px;
    font-size: 12px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.context-menu .menu-form {
    min-width: 0;
    margin: 1px 0;
    padding: 4px 2px 2px;
}
.context-menu .menu-form label { margin-bottom: 2px; font-size: 10px; }
.context-menu .menu-form-row { gap: 3px; }
.context-menu .menu-form-row input[type=text],
.context-menu .menu-form-row select { min-width: 0; padding: 4px; font-size: 11px; }
.context-menu .menu-form-row .button { padding: 4px 6px; font-size: 11px; }
.context-menu .danger-action { color: #f09b9b; }

/* The selected text remains small only in the file-list embed; full previews remain readable. */
.inline-text-preview {
    max-width: 100%;
    max-height: 32vh;
    margin: 4px 0 2px;
    padding: 4px 6px;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 9px !important;
    line-height: 1.25;
    color: #999;
    background: #0b0b0b;
    border-left: 2px solid #383838;
}
.html-document-panel { width:100%; margin:12px 0; border:1px solid #444; background:#111; }
.html-document-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; padding:8px; border-bottom:1px solid #444; color:#bbb; font-size:12px; }
.html-document-toolbar strong { color:#ddd; }
.html-document-toolbar span { color:#888; }
.html-document-toolbar a { margin-left:auto; }
.html-document-preview { display:block; width:100%; height: min(78vh, 900px); min-height:420px; border:0; background:#fff; }
@media (max-width: 640px) { .html-document-preview { min-height:320px; height:70vh; } }
.html-document-panel { width:100%; margin:12px 0; border:1px solid #444; background:#111; }
.html-document-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; padding:8px; border-bottom:1px solid #444; color:#bbb; font-size:12px; }
.html-document-toolbar strong { color:#ddd; }
.html-document-toolbar span { color:#888; }
.html-document-toolbar a { margin-left:auto; }
.html-document-preview { display:block; width:100%; height: min(78vh, 900px); min-height:420px; border:0; background:#fff; }
@media (max-width: 640px) { .html-document-preview { min-height:320px; height:70vh; } }
.text-document-panel {
    width: 100%;
    max-width: 100%;
    margin: 12px 0;
    border: 1px solid #383838;
    background: #0a0a0a;
    box-sizing: border-box;
    overflow: hidden;
}
.text-document-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 14px;
    padding: 8px 11px;
    color: #999;
    background: #171717;
    border-bottom: 1px solid #383838;
    font-size: 11px;
}
.text-document {
    max-width: 100%;
    max-height: calc(100vh - 150px);
    max-height: calc(100dvh - 150px);
    margin: 0;
    padding: 14px;
    overflow: auto;
    box-sizing: border-box;
    color: #d4d4d4;
    background: #0a0a0a;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    tab-size: 4;
}
.text-editor-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: calc(100vh - 28px);
    min-height: calc(100dvh - 28px);
    box-sizing: border-box;
}
.text-editor-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px 16px;
    padding: 0 0 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid #333;
}
.text-editor-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-width: 0; overflow-wrap: anywhere; }
.text-editor-back { font-size: 12px; }
.text-editor-separator, .text-editor-file-meta { color: #777; font-size: 11px; }
.text-editor-heading strong { overflow-wrap: anywhere; }
.text-editor-header-status { color: #a8dfa8; font-size: 11px; }
.text-file-editor {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    gap: 7px;
}
.text-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 5px 14px;
    color: #888;
    font-size: 11px;
}
.text-file-editor-area {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 55vh;
    height: calc(100vh - 190px);
    height: calc(100dvh - 190px);
    max-height: none;
    box-sizing: border-box;
    resize: vertical;
    padding: 13px 15px;
    border: 1px solid #444;
    outline: none;
    border-radius: 0;
    background: #080808;
    color: #dedede;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 13px;
    line-height: 1.55;
    tab-size: 4;
    white-space: pre;
    overflow: auto;
}
.text-file-editor-area:focus { border-color: #777; box-shadow: inset 0 0 0 1px #292929; }
.text-file-editor-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 0 2px;
    border-top: 1px solid #333;
}
.text-editor-status { color: #8fbd9b; font-size: 11px; }
.text-editor-status.is-dirty { color: #d8b875; }
.text-editor-action-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.text-editor-action-buttons .button { margin: 0; }
.text-editor-saved-note { color: #a8dfa8; }

@media screen and (max-width: 640px) {
    #page { padding: 8px; }
    .text-file-editor-area { height: calc(100dvh - 210px); min-height: 45vh; padding: 9px; font-size: 12px; }
    .text-document { font-size: 12px; padding: 10px; }
    .context-menu, .context-menu.open { width: calc(100vw - 16px); }
}


/* Filed final polish: full viewport, drag affordances, compact menus and text tools. */
html, body {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: clip !important;
    box-sizing: border-box;
}
html body #page {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 !important;
    padding: 12px;
    box-sizing: border-box;
}
.file-browser-shell, .admin-shell {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box;
}
.file-row[draggable="true"] { cursor: grab; }
.file-row[draggable="true"]:active { cursor: grabbing; }
.file-row.dragging { opacity: .45; }
.file-row.drop-before td { border-top: 2px solid #8fbd9b !important; }
.file-row.drop-after td { border-bottom: 2px solid #8fbd9b !important; }
.file-row.drop-target td { background: #26392b !important; }

.context-menu, .context-menu.open {
    box-sizing: border-box;
    min-width: 0 !important;
    width: min(340px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    max-height: none !important;
    overflow: visible !important;
    padding: 6px;
    gap: 2px 5px;
    font-size: 11px;
    line-height: 1.15;
}
.context-menu.open { display: grid !important; }
.context-menu .menu-action, .context-menu .menu-action-button {
    min-width: 0;
    padding: 4px 5px;
    font-size: 11px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}
.context-menu .menu-form { min-width: 0; margin: 1px 0; padding: 3px 1px 1px; }
.context-menu .menu-form label { margin-bottom: 2px; font-size: 9px; }
.context-menu .menu-form-row { gap: 3px; }
.context-menu .menu-form-row input[type=text],
.context-menu .menu-form-row select { min-width: 0; padding: 3px; font-size: 10px; }
.context-menu .menu-form-row .button { padding: 3px 5px; font-size: 10px; }

.inline-text-preview {
    max-width: 100%;
    max-height: 28vh;
    margin: 4px 0 2px;
    padding: 4px 6px;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 9px !important;
    line-height: 1.2;
}
.text-document-panel { width: 100%; max-width: 100%; box-sizing: border-box; overflow: hidden; }
.text-document-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 7px 14px;
    padding: 8px 11px;
}
.text-document-meta, .text-document-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; }
.text-document-meta { color: #999; font-size: 11px; }
.text-document-actions { gap: 5px; }
.text-document-copy-status { display: block; min-height: 14px; padding: 0 10px 4px; color: #8fbd9b; font-size: 10px; }
.text-document {
    max-width: 100%;
    max-height: calc(100dvh - 160px);
    margin: 0;
    padding: 14px;
    overflow: auto;
    box-sizing: border-box;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    tab-size: 4;
}
.text-document.no-wrap { white-space: pre; overflow-wrap: normal; }
.text-editor-shell { display:flex; flex-direction:column; width:100%; min-width:0; min-height:calc(100dvh - 24px); box-sizing:border-box; }
.text-editor-header {
    display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between;
    gap:8px 16px; padding:0 0 10px; margin-bottom:8px; border-bottom:1px solid #333;
}
.text-editor-heading { display:flex; flex-wrap:wrap; align-items:center; gap:7px; min-width:0; overflow-wrap:anywhere; }
.text-editor-back { font-size:12px; }
.text-editor-separator, .text-editor-file-meta { color:#777; font-size:11px; }
.text-editor-heading strong { overflow-wrap:anywhere; }
.text-editor-header-actions, .text-editor-toolbar-controls { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; }
.text-editor-header-actions { font-size:11px; }
.text-file-editor { display:flex; flex:1 1 auto; flex-direction:column; min-width:0; gap:7px; }
.text-editor-toolbar { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:5px 14px; color:#888; font-size:10px; }
.text-editor-wrap-label { display:flex; align-items:center; gap:4px; font-size:10px; }
.text-editor-wrap-label input { margin:0; }
.text-file-editor-area {
    display:block; width:100%; min-width:0; min-height:50vh; height:calc(100dvh - 190px); max-height:none;
    box-sizing:border-box; resize:vertical; padding:13px 15px; border:1px solid #444;
    outline:none; border-radius:0; background:#080808; color:#dedede;
    font-family:ui-monospace, SFMono-Regular, Consolas, monospace; font-size:13px;
    line-height:1.55; tab-size:4; white-space:pre-wrap; overflow-wrap:anywhere; overflow:auto;
}
.text-file-editor-area.no-wrap { white-space:pre; overflow-wrap:normal; }
.text-file-editor-area:focus { border-color:#777; box-shadow:inset 0 0 0 1px #292929; }
.text-editor-footer { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:8px; padding:8px 0 2px; border-top:1px solid #333; }
.text-editor-status { color:#8fbd9b; font-size:11px; }
.text-editor-status.is-dirty { color:#d8b875; }
.text-editor-action-buttons { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.text-editor-action-buttons .button { margin:0; }
.text-editor-saved-note { color:#a8dfa8; font-size:11px; }
@media screen and (max-width:640px) {
    html body #page { padding:8px; }
    .text-file-editor-area { height:calc(100dvh - 210px); min-height:45vh; padding:9px; font-size:12px; }
    .text-document { font-size:12px; padding:10px; }
}


/* Final visual tune: readable embedded text and softer, outlined document surfaces.
   These rules intentionally override only text surfaces and small-screen fit. */
.inline-text-preview {
    font-size: 14px !important;
    line-height: 1.4 !important;
    color: #e0e0e0 !important;
    background: #303030 !important;
    border: 1px solid #686868 !important;
    border-left: 3px solid #b9a2d6 !important;
    outline: 1px solid #242424;
    outline-offset: 1px;
    border-radius: 0;
    padding: 7px 9px !important;
    max-width: 100%;
    box-sizing: border-box;
}

.text-document-panel {
    background: #292929 !important;
    border: 1px solid #666 !important;
    outline: 1px solid #202020;
    outline-offset: 1px;
    border-radius: 0;
}
.text-document-toolbar {
    background: #383838 !important;
    color: #dedede;
    border-bottom: 1px solid #666 !important;
}
.text-document {
    background: #303030 !important;
    color: #e2e2e2 !important;
    border: 0;
    font-size: 14px;
    line-height: 1.55;
}
.text-file-editor-area {
    background: #292929 !important;
    color: #e2e2e2 !important;
    border: 1px solid #666 !important;
}
.text-file-editor-area:focus {
    border-color: #999 !important;
    box-shadow: inset 0 0 0 1px #454545 !important;
}

/* Keep text tools and file controls usable at every viewport width. */
.text-document-panel,
.text-document-toolbar,
.text-document,
.text-editor-shell,
.text-editor-header,
.text-file-editor,
.text-editor-toolbar,
.text-editor-footer,
.text-editor-action-buttons,
.file-browser-shell,
.admin-shell {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.text-document-toolbar,
.text-document-meta,
.text-document-actions,
.text-editor-header-actions,
.text-editor-toolbar-controls,
.text-editor-action-buttons {
    flex-wrap: wrap;
    min-width: 0;
}
.text-document,
.inline-text-preview,
.text-file-editor-area {
    overflow-wrap: anywhere;
    word-break: break-word;
    tab-size: 4;
}
.text-file-editor-area.no-wrap,
.text-document.no-wrap {
    overflow-wrap: normal;
    word-break: normal;
}
.context-menu.open {
    max-width: min(620px, calc(100vw - 16px)) !important;
    box-sizing: border-box;
}
.context-menu .menu-form-row,
.context-menu .menu-form-row > * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
@media screen and (max-width: 640px) {
    .inline-text-preview { font-size: 13px !important; }
    .text-document { font-size: 13px; padding: 10px; }
    .text-file-editor-area { font-size: 12px; }
    .text-document-actions,
    .text-editor-action-buttons { gap: 5px; }
}

/* Filed conversation surface: a compact, purple-accented room with a clear composer. */
.chat-page #page { background: #101016; }
.chat-page .chat-shell { gap: 7px; padding: 6px; background: #101016; }
.chat-page .chat-header {
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin: 0;
    border: 1px solid #342b40;
    background: #17141d;
}
.chat-page .chat-header > strong { color: #f0eaf7; font-size: 15px; }
.chat-page .chat-back-link { color: #b9a2d6; font-size: 12px; }
.chat-page .chat-header .small { color: #a79eaf; }
.chat-page .chat-logout-form { margin-left: auto; }
.chat-page .chat-layout { gap: 9px; }
.chat-page .chat-main {
    border: 1px solid #3b3048;
    background: #15131b;
    padding: 10px;
}
.chat-page .chat-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 7px;
    padding: 1px 2px 8px;
    border-bottom: 1px solid #30283a;
}
.chat-page .chat-title-row h2 { margin: 0; color: #eee7f5; font-size: 14px; }
#chat-load-older { color: #c8b3e1; font-size: 12px; }
.chat-page #chat-messages { border-bottom: 1px solid #30283a; padding: 5px 5px 12px; }
.chat-page .chat-message-group { padding: 9px 7px; border-bottom: 1px solid #292331; }
.chat-page .chat-message-head { color: #958a9f; font-size: 11px; }
.chat-page .chat-message-head strong { color: #cbb7e0; font-size: 13px; }
.chat-page .chat-message-body { color: #e2dce8; line-height: 1.5; }
.chat-page .chat-message-body a,
.chat-page .chat-back-link,
.chat-page .chat-notification-item strong { color: #b9a2d6; }
.chat-page .chat-reply-quote { border-left-color: #9b7ac0; background: #201a29; color: #b5a9c0; }
.chat-page .chat-online {
    flex-basis: 205px;
    width: 205px;
    border: 1px solid #3b3048;
    background: #17141d;
    padding: 10px;
}
.chat-page .chat-online-title { color: #e8e0ef; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.chat-page .chat-online-user { color: #d8d0df; border: 1px solid transparent; padding: 7px; }
.chat-page .chat-online-user:hover { background: #241d2d; border-color: #453653; }
.chat-page .chat-compose { padding-top: 7px; border-top: 1px solid #30283a; }
.chat-page #chat-compose {
    background: #100e15;
    border: 1px solid #51415f;
    color: #f0eaf5;
    padding: 10px 11px;
    line-height: 1.4;
    outline: none;
}
.chat-page #chat-compose:focus { border-color: #b9a2d6; box-shadow: 0 0 0 1px #6c587f; }
.chat-page .chat-toolbar { align-items: center; gap: 6px; }
.chat-page .chat-toolbar button,
.chat-page .chat-tool-button,
.chat-page .chat-notification-toggle {
    background: #211b29;
    color: #d9c9e8;
    border: 1px solid #51415f;
    padding: 6px 9px;
    text-decoration: none;
}
.chat-page .chat-toolbar button:hover,
.chat-page .chat-tool-button:hover,
.chat-page .chat-notification-toggle:hover { background: #30243b; border-color: #8e72a7; }
.chat-page #chat-send { background: #6e5488; color: #fff; border-color: #9579ae; font-weight: bold; padding-inline: 15px; }
.chat-page #chat-send:hover { background: #806398; }
.chat-page .chat-message-actions { background: #211b29; border-color: #5a4968; }
.chat-page .chat-message-actions button { color: #dbc9ec; }
.chat-page .chat-notification-panel,
.chat-page .chat-server-picker,
.chat-page #chat-emoji-picker { background: #1a1621; border-color: #544361; }
.chat-page .chat-status { color: #a99ab7; }
.chat-page .chat-pending-file { background: #241f2b; border-color: #59476a; color: #d9c8e8; }
.chat-page .chat-message-more { color: #c9b6dc; }
.chat-page .chat-reaction-choice { border-color: #574665; background: #221c2a; color: #e0d5ea; }
.admin-shell .file-table { border: 1px solid #35313b; background: #141318; }
.admin-shell .file-table th { background: #1b1820; color: #b8a9c4; }
.admin-shell .file-table td { padding-top: 10px; padding-bottom: 10px; }
.admin-shell .file-table .file-name-cell a { color: #c3addb; }
.admin-shell .file-row.drop-target td { background: #30253a; border-color: #a88ac5; }
.admin-shell .file-row.drop-before td { border-top-color: #b9a2d6; }
.admin-shell .file-row.drop-after td { border-bottom-color: #b9a2d6; }
.admin-shell .admin-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.admin-shell .admin-toolbar h2 { margin: 0; }
.admin-shell .more-button { background: #201b26; color: #d8c6e8; border: 1px solid #51415f; }
@media screen and (max-width: 760px) {
    .chat-page .chat-shell { padding: 3px; gap: 4px; }
    .chat-page .chat-header { gap: 7px; padding: 6px; }
    .chat-page .chat-online { flex-basis: auto; width: 100%; }
    .chat-page .chat-main { padding: 6px; }
    .chat-page .chat-toolbar button,
    .chat-page .chat-tool-button { padding: 6px 7px; }
}

/* Private chat access controls */
.chat-header .chat-access-link {
    display: inline-flex;
    align-items: center;
    margin: 0 10px 0 12px;
    padding: 5px 10px;
    color: #c8b2df;
    border: 1px solid #554365;
    background: #201a29;
}
.chat-access-page {
    width: min(620px, 100%);
    margin: 22px auto;
    padding: 18px;
    box-sizing: border-box;
    color: #ddd;
    background: #151219;
    border: 1px solid #39313f;
}
.chat-access-header { display: grid; gap: 9px; padding-bottom: 14px; border-bottom: 1px solid #39313f; }
.chat-access-header a { width: fit-content; }
.chat-access-header h2 { margin: 0; font-size: 19px; }
.chat-access-header strong { color: #c8b2df; overflow-wrap: anywhere; }
.chat-access-form { display: grid; gap: 16px; padding-top: 16px; }
.chat-access-private { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.chat-access-private input, .chat-access-user input { accent-color: #9e78c2; }
.chat-access-users { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 5px 12px; }
.chat-access-user { display: flex; align-items: center; gap: 9px; padding: 8px 10px; min-width: 0; border: 1px solid #342d3a; background: #1b1720; }
.chat-access-user span { overflow-wrap: anywhere; }
.chat-access-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }

/* Chat files use the same quiet document surface as ordinary text previews. */
.chat-page #page {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100dvh;
    max-width: none;
    margin: 0;
    padding: 8px;
    box-sizing: border-box;
    overflow: hidden;
    background: #202020;
}
.chat-page .chat-document-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    max-height: 100%;
    margin: 0;
    background: #292929;
    border: 1px solid #666;
    outline: 1px solid #202020;
    outline-offset: 1px;
    border-radius: 0;
}
.chat-page .chat-document-toolbar {
    flex: 0 0 auto;
    min-width: 0;
    background: #383838;
    color: #dedede;
    border-bottom: 1px solid #666;
}
.chat-document-meta { min-width: 0; }
.chat-document-path { color: #999; overflow-wrap: anywhere; }
.chat-document-user { color: #888; }
.chat-back-link { color: #d0d0d0; text-decoration: underline; }
.chat-page .chat-transcript-wrap {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #303030;
}
.chat-page #chat-messages.chat-transcript {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 180px;
    max-height: none;
    margin: 0;
    padding: 12px 14px;
    overflow: auto;
    box-sizing: border-box;
    color: #e2e2e2;
    background: #303030;
    border: 0;
    border-left: 3px solid #b9a2d6;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: normal;
}
.chat-page .chat-message-group {
    margin: 0;
    padding: 5px 0 7px;
    border: 0;
    border-bottom: 1px solid #484848;
}
.chat-page .chat-message-head {
    margin: 0 0 3px;
    color: #a6a6a6;
    font: 11px ui-monospace, SFMono-Regular, Consolas, monospace;
}
.chat-page .chat-message-head strong { color: #e0e0e0; font-weight: 700; }
.chat-page .chat-message { padding: 1px 0; color: #e2e2e2; overflow-wrap: anywhere; }
.chat-page .chat-message-id { color: #818181; font-size: 10px; }
.chat-page .chat-message-body { color: #e2e2e2; line-height: 1.5; }
.chat-page .chat-message-body a { color: #c9d8e8; }
.chat-page .chat-reply-quote {
    margin: 3px 0;
    padding: 3px 7px;
    color: #aaa;
    background: #292929;
    border-left: 2px solid #888;
    font-size: 11px;
}
.chat-page .chat-reactions { display: inline-flex; flex-wrap: wrap; gap: 5px; margin-left: 8px; }
.chat-page .chat-reaction-text { color: #bfbfbf; font-size: 11px; }
.chat-page .chat-compose {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 5px;
    padding: 8px 10px;
    background: #383838;
    border-top: 1px solid #666;
}
.chat-page #chat-compose {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    max-height: 22vh;
    height: 52px;
    padding: 8px 10px;
    box-sizing: border-box;
    resize: vertical;
    overflow: auto;
    border: 1px solid #666;
    border-radius: 0;
    outline: none;
    background: #292929;
    color: #eee;
    font: 13px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.chat-page #chat-compose:focus { border-color: #aaa; box-shadow: inset 0 0 0 1px #555; }
.chat-page .chat-status { min-height: 13px; color: #aaa; font-size: 11px; }
.chat-page .chat-pending-file,
.chat-page #chat-reply-banner {
    margin: 0;
    padding: 3px 6px;
    color: #c7c7c7;
    background: #303030;
    border-left: 2px solid #8a8a8a;
    font: 11px ui-monospace, SFMono-Regular, Consolas, monospace;
}
.chat-page #chat-online {
    max-height: 120px;
    overflow: auto;
    padding: 5px 7px;
    color: #ccc;
    background: #303030;
    border: 1px solid #666;
    font-size: 11px;
}
.chat-page .chat-online-user { display: inline-flex; align-items: center; gap: 6px; margin: 2px 10px 2px 0; color: #ddd; }
.chat-page .chat-online-dot { width: 6px; height: 6px; border-radius: 0; background: #75b987; }
.chat-page .chat-notification-panel,
.chat-page .chat-server-picker,
.chat-page #chat-emoji-picker {
    position: absolute;
    z-index: 3500;
    right: 8px;
    bottom: calc(100% + 4px);
    width: min(540px, 96%);
    max-height: min(55vh, 440px);
    overflow: auto;
    padding: 8px;
    box-sizing: border-box;
    color: #ddd;
    background: #292929;
    border: 1px solid #777;
    box-shadow: 0 5px 18px #000;
}
.chat-page .chat-notification-item { padding: 6px 2px; border-bottom: 1px solid #4c4c4c; color: #ddd; }
.chat-page .chat-notification-item strong { color: #eee; }
.chat-page .chat-notification-item span { color: #aaa; }
.chat-page #chat-server-search,
.chat-page #chat-emoji-search,
.chat-page #chat-emoji-shortcode {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 7px;
    color: #eee;
    background: #202020;
    border: 1px solid #666;
}
.chat-page .chat-emoji-picker-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.chat-page .chat-emoji-categories { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.chat-page .chat-emoji-categories button,
.chat-page .chat-emoji-choice,
.chat-page .chat-emoji-more,
.chat-page .chat-emoji-picker-head button,
.chat-page .chat-server-file-row button {
    color: #ddd;
    background: #383838;
    border: 1px solid #666;
    padding: 5px 7px;
}
.chat-page .chat-emoji-categories button.active { background: #505050; border-color: #999; }
.chat-page .chat-emoji-grid { display: flex; flex-wrap: wrap; gap: 3px; }
.chat-page .chat-emoji-choice { min-width: 34px; min-height: 32px; font-size: 17px; }
.chat-page .chat-emoji-upload { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; padding-top: 7px; border-top: 1px solid #555; }
.chat-page .chat-emoji-upload input[type=file] { max-width: 100%; }
.chat-page .chat-server-file-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid #444; }
.chat-page .chat-server-file-row span { overflow-wrap: anywhere; color: #ccc; }
.chat-page .chat-attachment { max-width: min(420px, 100%); }
.chat-page .chat-legacy-controls[hidden] { display: none !important; }
.chat-page .chat-legacy-controls { display: none !important; }
@media screen and (max-width: 640px) {
    .chat-page #page { padding: 4px; }
    .chat-page .chat-document-toolbar { padding: 6px 8px; }
    .chat-page #chat-messages.chat-transcript { padding: 8px; font-size: 12px; }
    .chat-page .chat-compose { padding: 6px; }
    .chat-page #chat-compose { height: 44px; min-height: 38px; }
}
.chat-page .chat-upload-progress { width: 100%; height: 3px; background: #555; }
.chat-page .chat-upload-track { width: 100%; height: 3px; background: #555; }
.chat-page #chat-upload-bar { width: 0; height: 3px; background: #9bbcff; }
.chat-page .chat-file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.chat-page .chat-account-document {
    width: min(520px, 100%);
    max-height: calc(100dvh - 24px);
    margin: auto;
    overflow: auto;
}
.chat-page .chat-account-content { padding: 14px; color: #ddd; background: #303030; }
.chat-page .chat-account-content h2 { margin: 0 0 12px; font-size: 15px; }
.chat-page .chat-account-content .chat-form { padding: 10px 0; border-top: 1px solid #555; }
.chat-page .chat-account-content .chat-form p { margin: 6px 0; }
.chat-page .chat-account-content input[type=text],
.chat-page .chat-account-content input[type=password] {
    width: min(320px, 100%);
    padding: 7px 8px;
    box-sizing: border-box;
    color: #eee;
    background: #242424;
    border: 1px solid #666;
}
.chat-page .chat-account-content input[type=submit] {
    padding: 6px 10px;
    color: #eee;
    background: #444;
    border: 1px solid #777;
}
/* Private chat permissions match the neutral file/document controls. */
.chat-page .chat-access-page {
    width: min(620px, 100%);
    margin: auto;
    padding: 16px;
    color: #ddd;
    background: #303030;
    border: 1px solid #666;
    outline: 1px solid #202020;
    outline-offset: 1px;
}
.chat-page .chat-access-header { border-bottom-color: #666; }
.chat-page .chat-access-header a,
.chat-page .chat-access-header strong { color: #ddd; }
.chat-page .chat-access-private input,
.chat-page .chat-access-user input { accent-color: #aaa; }
.chat-page .chat-access-user { color: #ddd; background: #292929; border-color: #666; }
.chat-page .chat-access-actions .button,
.chat-page .chat-access-actions .quiet-button {
    color: #eee;
    background: #444;
    border: 1px solid #777;
}
.chat-page .chat-document-toolbar .chat-back-link { color: #d0d0d0 !important; }

/* Keep the complete Filed browser visible while a chat file is open. */
.chat-filesystem-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.88fr) minmax(380px, 1.22fr);
    gap: 12px;
    align-items: stretch;
    width: 100%;
    height: calc(100dvh - 205px);
    min-height: 490px;
    margin-top: 8px;
}
.chat-filesystem-list {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding: 8px;
    border: 1px solid #444;
    background: #242424;
    box-sizing: border-box;
}
.chat-filesystem-list .file-sort-toolbar { margin-top: 0; }
.chat-filesystem-list #file-list { width: 100%; }
.chat-document-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    margin: 0;
    overflow: hidden;
    box-sizing: border-box;
    background: #292929;
    border: 1px solid #666;
    border-radius: 0;
}
.chat-document-toolbar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding: 9px 11px;
    color: #dedede;
    background: #383838;
    border-bottom: 1px solid #666;
}
.chat-document-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 10px; min-width: 0; }
.chat-document-meta strong { color: #f0f0f0; }
.chat-document-path { color: #999; overflow-wrap: anywhere; }
.chat-document-user { color: #888; }
.chat-document-actions { flex: 0 0 auto; }
.chat-back-link { color: #d0d0d0; text-decoration: underline; }
.chat-transcript-wrap { display: flex; flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden; background: #303030; }
#chat-messages.chat-transcript {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    max-height: none;
    margin: 0;
    padding: 12px 14px;
    overflow: auto;
    box-sizing: border-box;
    color: #e2e2e2;
    background: #303030;
    border: 0;
    border-left: 3px solid #b9a2d6;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
}
.chat-document-panel .chat-message-group { margin: 0; padding: 5px 0 7px; border: 0; border-bottom: 1px solid #484848; }
.chat-document-panel .chat-compose { position: relative; flex: 0 0 auto; margin: 0; padding: 9px; background: #383838; border-top: 1px solid #555; }
.chat-document-panel #chat-compose { width: 100%; min-height: 54px; max-height: 18vh; resize: vertical; box-sizing: border-box; background: #222; color: #eee; border: 1px solid #666; }
.chat-document-panel .chat-status { min-height: 14px; margin-top: 3px; }
.chat-document-panel .chat-legacy-controls { display: none; }
@media (max-width: 900px) {
    .chat-filesystem-layout { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
    .chat-filesystem-list { max-height: 34vh; }
    .chat-document-panel { height: 66vh; min-height: 420px; }
}
@media (max-width: 560px) {
    .chat-filesystem-layout { gap: 8px; }
    .chat-filesystem-list { padding: 5px; }
    .chat-document-toolbar { align-items: flex-start; padding: 7px; }
    .chat-document-panel .chat-compose { padding: 7px; }
    .chat-help-grid { grid-template-columns: minmax(0, 1fr); }
    .chat-help-grid > div { grid-template-columns: minmax(0, auto) minmax(0, 1fr); }
}


/* Chat is a rich inline text-file preview inside the regular file table. */
.chat-document-panel {
    display:flex; flex-direction:column; width:min(100%, 980px); min-width:0; margin:8px 0 3px;
    color:#dedede; background:#303030; border:1px solid #555; border-radius:0; box-sizing:border-box;
}
.chat-document-panel .chat-document-toolbar {
    display:flex; align-items:center; justify-content:space-between; gap:10px; min-width:0;
    padding:7px 10px; background:#383838; color:#dedede; border-bottom:1px solid #555;
}
.chat-document-panel .text-document-meta { display:flex; flex-wrap:wrap; align-items:center; gap:8px; min-width:0; }
.chat-document-panel .chat-document-path,.chat-document-panel .chat-document-user { color:#999; font-size:11px; overflow-wrap:anywhere; }
.chat-document-panel .chat-back-link { color:var(--link-color, #b9a2d6); font-size:11px; }
.chat-document-panel .chat-transcript-wrap { display:flex; min-width:0; min-height:120px; max-height:340px; overflow:hidden; background:#303030; }
.chat-document-panel #chat-messages.chat-transcript {
    flex:1 1 auto; width:100%; min-width:0; min-height:120px; max-height:340px; margin:0; padding:10px 12px;
    overflow:auto; box-sizing:border-box; color:#e2e2e2; background:#303030; border:0;
    border-left:3px solid var(--link-color, #b9a2d6); font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace; white-space:normal;
}
.chat-document-panel .chat-message-group { margin:0; padding:4px 0 6px; border:0; border-bottom:1px solid #484848; }
.chat-document-panel .chat-message-head { margin:0 0 2px; color:#999; font:11px ui-monospace,SFMono-Regular,Consolas,monospace; }
.chat-document-panel .chat-message-head strong { color:#e0e0e0; font-weight:700; }
.chat-document-panel .chat-message { padding:1px 0; color:#e2e2e2; overflow-wrap:anywhere; }
.chat-document-panel .chat-message-id { color:#858585; font-size:10px; }
.chat-document-panel .chat-message-body { color:#e2e2e2; line-height:1.5; }
.chat-document-panel .chat-message-body a { color:var(--link-color, #b9a2d6); }
.chat-document-panel .chat-reply-quote { margin:3px 0; padding:3px 7px; color:#aaa; background:#292929; border-left:2px solid #888; font-size:11px; }
.chat-document-panel .chat-reactions { display:inline-flex; flex-wrap:wrap; gap:4px; margin-left:6px; }
.chat-document-panel .chat-compose { position:relative; display:grid; gap:5px; margin:0; padding:8px; background:#383838; border-top:1px solid #555; }
.chat-document-panel #chat-compose {
    display:block; width:100%; min-height:42px; max-height:130px; padding:8px 9px; resize:vertical; box-sizing:border-box;
    color:#eee; background:#242424; border:1px solid #555; border-radius:0;
    font:12px/1.45 ui-monospace,SFMono-Regular,Consolas,monospace;
}
.chat-document-panel #chat-compose:focus { outline:none; border-color:var(--link-color, #b9a2d6); }
.chat-document-panel .chat-status { min-height:13px; color:#aaa; font-size:11px; }
.chat-document-panel .chat-pending-file,.chat-document-panel #chat-reply-banner { padding:5px 7px; color:#ccc; background:#292929; border:1px solid #555; font-size:11px; }
.chat-document-panel .chat-notification-panel,
.chat-document-panel .chat-server-picker,.chat-document-panel #chat-emoji-picker,.chat-document-panel .chat-sound-picker {
    z-index:2; padding:9px; color:#ddd; background:#252525; border:1px solid #666;
}
.chat-document-panel .chat-emoji-picker-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px; }
.chat-document-panel .chat-online-user { display:inline-flex; align-items:center; gap:6px; margin:2px 8px 2px 0; color:#ddd; }
.chat-document-panel .chat-online-dot { width:6px; height:6px; border-radius:0; background:#75b987; }
.chat-document-panel .chat-notification-item { padding:6px 2px; border-bottom:1px solid #4c4c4c; color:#ddd; }
.chat-document-panel #chat-server-search,.chat-document-panel #chat-emoji-search,.chat-document-panel #chat-emoji-shortcode {
    width:100%; min-width:0; padding:6px; box-sizing:border-box; color:#eee; background:#202020; border:1px solid #555;
}
.chat-document-panel .chat-emoji-categories { display:flex; flex-wrap:wrap; gap:4px; margin:6px 0; }
.chat-document-panel .chat-emoji-grid { display:flex; flex-wrap:wrap; gap:3px; }
.chat-document-panel .chat-emoji-choice { min-width:32px; min-height:30px; font-size:17px; }
.chat-document-panel .chat-emoji-upload { display:flex; flex-wrap:wrap; gap:5px; margin-top:7px; padding-top:7px; border-top:1px solid #555; }
.chat-document-panel .chat-legacy-controls[hidden] { display:none !important; }
.chat-document-panel .chat-file-input-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
.chat-file-inline-row > .file-name-cell { padding-bottom:10px; }
@media (max-width:700px) {
    .chat-document-panel { width:100%; }
    .chat-document-panel .chat-transcript-wrap,.chat-document-panel #chat-messages.chat-transcript { max-height:280px; }
    .chat-document-panel .chat-document-toolbar { align-items:flex-start; }
}

/* Chat identity styling. Older browsers keep the solid pink Root fallback. */
.chat-document-panel .chat-message-head { display:flex; align-items:center; flex-wrap:wrap; gap:5px; }
.chat-document-panel .chat-message-head > strong { color:#e0e0e0; }
.chat-document-panel .chat-avatar { display:inline-block; width:22px; height:22px; flex:0 0 22px; object-fit:cover; border-radius:0; vertical-align:middle; background:#3c3c3c; }
.chat-document-panel .chat-avatar-small { width:18px; height:18px; flex-basis:18px; }
.chat-document-panel .chat-role-badge { display:inline-block; margin-left:3px; padding:1px 5px; border:1px solid #777; border-radius:0; font-size:9px; line-height:1.3; }
.chat-document-panel .chat-role-badge { display:inline-flex; align-items:center; gap:4px; vertical-align:middle; }
.chat-document-panel .chat-role-icon { width:16px; height:16px; object-fit:contain; display:inline-block; vertical-align:middle; }
.chat-document-panel .chat-role-badge-small { margin-left:3px; padding:0 4px; font-size:8px; }
.chat-document-panel .chat-role-badge-small .chat-role-icon { width:12px; height:12px; }
.role-image-settings { margin:18px 0; }
.role-image-list { display:grid; gap:10px; }
.role-image-row { display:flex; align-items:center; flex-wrap:wrap; gap:12px; padding:10px 0; border-bottom:1px solid var(--border,#444); }
.role-image-preview-wrap { width:44px; height:44px; display:flex; align-items:center; justify-content:center; border:1px solid var(--border,#555); }
.admin-role-image-preview { max-width:40px; max-height:40px; object-fit:contain; }
.admin-role-image-placeholder { font-size:10px; color:var(--muted,#999); text-align:center; }
.role-image-name { min-width:90px; }
.role-image-form { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
/* Root usernames keep the animated pink/blue rainbow identity in both the
   full /chat page and embedded ChatFile panels. Keep a solid text fill beneath
   the gradient overlay so an unsupported/failed text-clip paint never blanks it. */
.chat-page .chat-root-name,
.chat-document-panel .chat-root-name { color:#f07cba; font-weight:800; }
.chat-page .chat-message-head,
.chat-page .chat-online-user,
.chat-document-panel .chat-message-head,
.chat-document-panel .chat-online-user { isolation:isolate; }
.chat-page .chat-root-name,
.chat-document-panel .chat-root-name,
html body #page .chat-profile-card .chat-profile-title.chat-root-name {
    position:relative !important;
    display:inline-block !important;
    visibility:visible !important;
    opacity:1 !important;
    color:#f07cba !important;
    -webkit-text-fill-color:#f07cba !important;
    text-shadow:0 0 5px rgba(255,91,190,.42),0 0 10px rgba(91,151,255,.3) !important;
}
.chat-page .chat-root-name[data-glow-text]::after,
.chat-document-panel .chat-root-name[data-glow-text]::after,
html body #page .chat-profile-card .chat-profile-title.chat-root-name[data-glow-text]::after {
    content:attr(data-glow-text);
    position:absolute; left:0; top:0; z-index:1;
    color:transparent; -webkit-text-fill-color:transparent;
    font:inherit; line-height:inherit; letter-spacing:inherit; white-space:nowrap;
    background-image:linear-gradient(100deg,#ff77c8 0%,#e947a8 28%,#77aaff 68%,#b7a0ff 100%);
    background-size:220% 100%; background-position:0 50%;
    -webkit-background-clip:text; background-clip:text;
    text-shadow:none; pointer-events:none;
    animation:filed-root-name-shimmer 4.8s ease-in-out infinite alternate;
}
@keyframes filed-root-name-shimmer { from { background-position:0 50%; } to { background-position:100% 50%; } }
@media (prefers-reduced-motion:reduce) {
    .chat-page .chat-root-name,
    .chat-page .chat-root-name[data-glow-text]::after,
    .chat-document-panel .chat-root-name,
    .chat-document-panel .chat-root-name[data-glow-text]::after,
    html body #page .chat-profile-card .chat-profile-title.chat-root-name[data-glow-text]::after { animation:none !important; }
}
.chat-document-panel .chat-help-message { margin-top:4px; padding:0; color:#ddd; background:transparent; border:0; }
.chat-document-panel .chat-help-title { margin-bottom:6px; color:#eee; font-weight:700; }
.chat-document-panel .chat-help-line { display:grid; grid-template-columns:minmax(145px, auto) minmax(0,1fr); gap:10px; padding:2px 0; }
.chat-document-panel .chat-help-line code { color:#d9c6ef; font-size:11px; }
.chat-document-panel .chat-help-line span { color:#aaa; font-size:11px; }
.chat-document-panel .chat-system-group { margin-top:7px; }
@media (max-width:560px) {
    .chat-document-panel .chat-help-line { grid-template-columns:minmax(0,1fr); gap:1px; }
}

.chat-document-panel #chat-messages.chat-transcript { overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; scroll-behavior:auto; }


/* Admin is the same Filed filesystem UI, not a separate purple-themed app. */
.admin-shell { color:#ddd !important; background:transparent !important; border:0 !important; border-radius:0!important; box-shadow:none !important; padding:0 !important; }
.admin-shell h1,.admin-shell h2,.admin-shell h3,.admin-shell h4,.admin-shell label,.admin-shell p,.admin-shell .small { color:inherit; }
.admin-shell a,.admin-shell .file-name-cell a { color:#9bbcff !important; }
.admin-shell .file-table { border:0 !important; background:transparent !important; }
.admin-shell .file-table th { background:transparent !important; color:#888 !important; border-bottom:1px solid #444 !important; }
.admin-shell .file-table td { background:transparent; border-bottom:1px solid #292929 !important; padding-top:8px; padding-bottom:8px; }
.admin-shell .file-table tbody tr:hover td { background:#171717 !important; }
.admin-shell .file-row.drop-target td { background:#26392b !important; border-color:#8fbd9b !important; }
.admin-shell .file-row.drop-before td { border-top-color:#8fbd9b !important; }
.admin-shell .file-row.drop-after td { border-bottom-color:#8fbd9b !important; }
.admin-shell .more-button { background:transparent !important; color:#aaa !important; border:1px solid transparent !important; }
.admin-shell .more-button:hover,.admin-shell .more-button[aria-expanded="true"] { background:#222 !important; color:#fff !important; border-color:#444 !important; }
.admin-shell .admin-settings { border-top:1px solid #333 !important; background:transparent !important; box-shadow:none !important; }
.admin-shell input:not([type="checkbox"]):not([type="radio"]),.admin-shell select,.admin-shell textarea { background:#181818 !important; color:#ddd !important; border:1px solid #555 !important; border-radius:0!important; box-shadow:none !important; }
.admin-shell input[type="checkbox"],.admin-shell input[type="radio"] { accent-color:#9bbcff; }
.admin-shell button,.admin-shell .button { background:#252525 !important; color:#ddd !important; border:1px solid #555 !important; border-radius:0!important; box-shadow:none !important; }
.admin-shell button:hover,.admin-shell .button:hover { background:#303030 !important; border-color:#888 !important; }
.admin-shell .quiet-button { background:transparent !important; border:0 !important; color:#9bbcff !important; }
.admin-shell .context-menu { background:#191919 !important; border:1px solid #444 !important; box-shadow:0 8px 24px rgba(0,0,0,.45) !important; }
.admin-shell .context-menu .menu-action,.admin-shell .context-menu .menu-action-button { color:#ddd !important; }
.admin-shell .context-menu .menu-action:hover,.admin-shell .context-menu .menu-action-button:hover { background:#282828 !important; }

/* Everyday chat actions are visible; slash commands remain available. */
.chat-document-panel .chat-action-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:5px 9px; padding-top:5px; margin-top:2px; border-top:1px solid #4a4a4a; }
.chat-document-panel .chat-action-toolbar button { min-height:27px; padding:3px 8px; font-size:11px; line-height:1.2; color:#ddd; background:#252525; border:1px solid #555; border-radius:0; cursor:pointer; }
.chat-document-panel .chat-action-toolbar button:hover { color:#fff; background:#303030; border-color:#888; }
.chat-document-panel .chat-action-toolbar #chat-send { margin-left:auto; min-width:62px; }
.chat-document-panel .chat-action-toolbar #chat-load-older { margin-right:auto; }
@media (max-width:560px) { .chat-document-panel .chat-action-toolbar { gap:5px; } .chat-document-panel .chat-action-toolbar button { padding:5px 7px; } .chat-document-panel .chat-action-toolbar #chat-send { margin-left:0; } }

.chat-document-panel .chat-message-actions-inline { display:inline-flex; flex-wrap:wrap; gap:4px; margin-left:8px; vertical-align:middle; opacity:.78; }
.chat-document-panel .chat-message-actions-inline button { padding:1px 5px; color:#aaa; background:transparent; border:1px solid #555; border-radius:0; font:10px/1.4 Arial,sans-serif; cursor:pointer; }
.chat-document-panel .chat-message-actions-inline button:hover { color:#fff; background:#252525; border-color:#888; }
.chat-document-panel .chat-message-actions-inline .chat-delete-message { color:#e6a0a0; }


/* Final admin cleanup: the admin account uses the same neutral Filed controls. */
.admin-shell .file-table .file-name-cell a,
.admin-shell .file-table a { color:#9bbcff !important; }
.admin-shell .file-browser-top,
.admin-shell .file-browser-nav,
.admin-shell .file-toolbar,
.admin-shell .file-sort-toolbar,
.admin-shell .file-sort-controls,
.admin-shell .admin-toolbar { background:transparent !important; border-color:#3a3a3a !important; box-shadow:none !important; }
.admin-shell .file-browser-top,
.admin-shell .file-browser-nav,
.admin-shell .path,
.admin-shell .admin-toolbar,
.admin-shell .admin-settings { color:#ddd !important; }
.admin-shell .admin-settings h2,
.admin-shell .admin-settings h3,
.admin-shell h2,
.admin-shell h3 { color:#e5e5e5 !important; }
.admin-shell .good,
.admin-shell .file-notice { background:#18251c !important; color:#b9d7c1 !important; border-color:#45634c !important; }
.admin-shell .error { background:#281919 !important; color:#e0b0b0 !important; border-color:#694040 !important; }
.admin-shell .file-table .empty-state { color:#888 !important; background:transparent !important; }
.admin-shell .file-table tbody tr.drop-target td { background:#26392b !important; border-color:#8fbd9b !important; }
.admin-shell .file-table tbody tr:hover td { background:#171717 !important; }
.admin-shell .settings-form label,
.admin-shell label { color:#ccc !important; }
.admin-shell input[type="color"] { background:#181818 !important; border:1px solid #555 !important; }
.admin-shell .file-browser-nav a { color:#9bbcff !important; }
.admin-shell .file-browser-nav a:hover { color:#c5d9ff !important; }

/* Dark, low-contrast document embeds that sit naturally inside the Filed page. */
.text-document-panel {
    background: #111111 !important;
    border: 1px solid #292929 !important;
    outline: none !important;
    border-radius: 0;
}
.text-document-toolbar {
    background: #151515 !important;
    color: #aaaaaa;
    border-bottom: 1px solid #292929 !important;
}
.text-document { background: #111111 !important; color: #dddddd !important; }
.text-document-help {
    padding: 7px 12px 0;
    color: #777777;
    background: #111111;
    font-size: 11px;
    line-height: 1.5;
}
.text-document-help code {
    padding: 1px 4px;
    color: #c8c8c8;
    background: #1a1a1a;
    border: 1px solid #292929;
}
.text-document-image {
    display: inline-block;
    max-width: min(100%, 720px);
    max-height: 54vh;
    margin: 5px 3px;
    object-fit: contain;
    vertical-align: middle;
    border: 1px solid #292929;
}
.text-document-video {
    position: relative;
    display: inline-block;
    width: min(100%, 480px);
    max-width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 270px;
    margin: 5px 3px;
    overflow: hidden;
    vertical-align: middle;
    background: #000000;
}
.text-document-video .filed-video-player,
.text-document-video .filed-video-frame {
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
}
.text-document-video .filed-video-frame video,
.text-document-video .chat-video-preview {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #000000;
}
.text-document-video .chat-video-load { position: absolute; }
.text-document-emoji {
    display: inline-block;
    width: 1.35em;
    height: 1.35em;
    margin: 0 1px;
    object-fit: contain;
    vertical-align: -0.28em;
}
.inline-text-preview .text-document-image { max-width: min(100%, 340px); max-height: 180px; }
.inline-text-preview .text-document-emoji { width: 1.2em; height: 1.2em; }
.chat-document-panel {
    color: #dddddd !important;
    background: #111111 !important;
    border: 1px solid #292929 !important;
    border-radius: 0;
}
.chat-document-panel .chat-document-toolbar {
    color: #cccccc !important;
    background: #151515 !important;
    border-bottom: 1px solid #292929 !important;
}
.chat-document-panel .chat-transcript-wrap,
.chat-document-panel #chat-messages.chat-transcript {
    color: #dddddd !important;
    background: #111111 !important;
    border-left-color: #303030 !important;
}
.chat-document-panel .chat-message-group { border-bottom-color: #242424 !important; }
.chat-document-panel .chat-compose {
    background: #151515 !important;
    border-top-color: #292929 !important;
}
.chat-document-panel #chat-compose {
    color: #eeeeee !important;
    background: #0b0b0b !important;
    border-color: #333333 !important;
}
.chat-document-panel .chat-reply-quote,
.chat-document-panel .chat-pending-file,
.chat-document-panel #chat-reply-banner {
    color: #bbbbbb !important;
    background: #171717 !important;
    border-color: #303030 !important;
}
.chat-document-panel .chat-action-toolbar { border-top-color: #292929 !important; }
.chat-document-panel .chat-action-toolbar button {
    color: #cccccc;
    background: #191919;
    border-color: #333333;
}
.chat-document-panel .chat-action-toolbar button:hover {
    color: #ffffff;
    background: #222222;
    border-color: #555555;
}
.text-document-actions button:focus-visible,
.text-document-actions a:focus-visible,
.chat-document-panel button:focus-visible,
.chat-document-panel a:focus-visible {
    outline: 1px solid #a8c4ef;
    outline-offset: 2px;
}

.admin-shell table { width:100%; border-collapse:collapse; background:transparent !important; color:#ddd !important; }
.admin-shell th { padding:8px 10px; text-align:left; color:#888 !important; background:transparent !important; border-bottom:1px solid #444 !important; }
.admin-shell td { padding:8px 10px; background:transparent !important; border-bottom:1px solid #292929 !important; }
.admin-shell tr:hover td { background:#171717 !important; }
.admin-shell .tools { margin-top:16px; padding:12px 0; border-top:1px solid #333; background:transparent !important; }
.admin-shell .tools h3 { margin-top:0; }
.admin-shell .upload-picker-link { color:#9bbcff !important; }
.admin-shell .danger-action { color:#e3aaaa !important; }
.inline-text-preview {
    color: #d9d9d9 !important;
    background: #111111 !important;
    border: 1px solid #292929 !important;
    border-left: 2px solid #303030 !important;
    outline: none !important;
    border-radius: 0;
}
.chat-document-panel .chat-notification-panel,
.chat-document-panel .chat-server-picker,
.chat-document-panel #chat-emoji-picker,
.chat-document-panel .chat-sound-picker {
    color: #dddddd !important;
    background: #151515 !important;
    border-color: #303030 !important;
}
.chat-document-panel .chat-emoji-categories button.active {
    color: #ffffff !important;
    background: #242424 !important;
    border-color: #555555 !important;
}
.chat-document-panel .chat-action-toolbar #chat-send {
    color: #f0f0f0 !important;
    background: #242424 !important;
    border-color: #555555 !important;
}
.chat-document-panel .chat-action-toolbar #chat-send:hover {
    background: #303030 !important;
    border-color: #777777 !important;
}


/* Voice rooms share the document and control surfaces used by embedded chat. */
.vc-chat-style { width:min(100%, 980px); margin:8px 0 12px; }
.vc-chat-style .chat-document-toolbar { align-items:center; }
.vc-chat-style .vc-main { display:flex; flex-direction:column; gap:10px; padding:9px; background:#303030; }
.vc-chat-style .vc-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:6px; padding-bottom:9px; border-bottom:1px solid #484848; }
.vc-chat-style .vc-toolbar button { margin:0; }
.vc-chat-style .vc-note { min-height:14px; color:#aaa; font-size:11px; }
.vc-chat-style .vc-people,.vc-chat-style .vc-recordings { border-top:1px solid #484848; padding-top:9px; }
.vc-chat-style .vc-person { background:#242424; border:1px solid #4c4c4c; border-radius:0; }
.vc-chat-style .vc-screen-card { background:#202020; border:1px solid #4c4c4c; border-radius:0; }
.vc-chat-style .vc-recordings { color:#ddd; font-size:12px; }
.vc-chat-style .vc-recording-link { color:var(--link-color, #b9a2d6); }
.account-shell { max-width:900px; margin:0 auto; }
.account-card { margin:12px 0; padding:14px; background:#292929; border:1px solid #555; border-radius:0; }
.account-card h2,.account-card h3 { margin:0 0 9px; color:#eee; }
.account-card h4 { margin:12px 0 5px; color:#ddd; }
.account-identity { display:flex; flex-wrap:wrap; align-items:center; gap:8px 18px; }
.account-identity strong { font-size:17px; color:#eee; }
.account-identity span,.account-card .small { color:#999; font-size:12px; }
.account-role-list { display:flex; flex-wrap:wrap; gap:6px; margin:10px 0; }
.account-role { display:inline-block; padding:4px 8px; color:var(--role-color); background:#202020; border:1px solid var(--role-color); font-size:12px; }
.account-role-form { display:flex; flex-direction:column; align-items:flex-start; gap:7px; margin-top:10px; padding-top:10px; border-top:1px solid #484848; }
.account-role-option { display:flex; align-items:center; gap:8px; color:#ddd; padding:4px 0; }
.account-password-form { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:10px; align-items:end; }
.account-password-form label { display:grid; gap:5px; color:#bbb; font-size:12px; }
.account-password-form input { min-width:0; width:100%; box-sizing:border-box; padding:8px; color:#eee; background:#202020; border:1px solid #555; }
.account-password-form button { justify-self:start; }
@media (max-width:600px) { .account-card { padding:10px; } .account-password-form { grid-template-columns:minmax(0,1fr); } }

/* VC folders are visibly distinct in ordinary Filed listings. */
.vc-folder-badge,.filed-playlist-badge{display:inline-flex;align-items:center;margin-left:9px;padding:2px 7px;border:1px solid var(--border,#30343b);border-radius:0;color:var(--muted,#9ba3ad);font-size:10px;line-height:1.4;letter-spacing:.04em;vertical-align:middle}

/* Chat role directory: a compact, file-browser-style view. */
.role-files-shell .file-browser-top { margin-bottom: 18px; }
.role-files-shell > p { max-width: 760px; color: var(--muted, #aaa); }
.role-file-create { margin: 18px 0 24px; padding: 16px; border: 1px solid var(--border, #383838); background: rgba(0,0,0,.18); }
.role-file-create .settings-form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px 16px; }
.role-file-create .settings-form label { display: flex; flex-direction: column; gap: 6px; }
.role-file-create .settings-form label:has(input[type="checkbox"]) { flex-direction: row; align-items: center; padding-bottom: 8px; }
.role-file-create input:not([type="checkbox"]):not([type="color"]) { min-width: 210px; }
.role-file-directory { margin-top: 18px; }
.role-file-directory .file-table td { vertical-align: middle; }
.role-file-badge { display: inline-block; padding: 3px 8px; color: var(--role-color, #ddd); border: 1px solid var(--role-color, #777); background: rgba(0,0,0,.22); }
.role-file-content { max-width: 100%; overflow: auto; padding: 16px; color: #d9d9d9; background: #101010; border: 1px solid var(--border, #383838); font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Filed 1.2.9: fullscreen chat documents and account role picker. */
.chat-document-panel:fullscreen,
.chat-document-panel:-webkit-full-screen,
.chat-document-panel.chat-fullscreen-fallback {
    position:fixed !important;
    inset:0 !important;
    z-index:10000 !important;
    width:100vw !important;
    height:100vh !important;
    max-width:none !important;
    max-height:none !important;
    min-height:0 !important;
    margin:0 !important;
    display:flex !important;
    flex-direction:column !important;
    box-sizing:border-box !important;
    overflow:hidden !important;
    border:0 !important;
    border-radius:0!important;
    background:#111 !important;
}
.chat-document-panel:fullscreen .chat-transcript-wrap,
.chat-document-panel:-webkit-full-screen .chat-transcript-wrap,
.chat-document-panel.chat-fullscreen-fallback .chat-transcript-wrap {
    flex:1 1 auto !important;
    min-height:0 !important;
    max-height:none !important;
}
.chat-document-panel:fullscreen #chat-messages,
.chat-document-panel:-webkit-full-screen #chat-messages,
.chat-document-panel.chat-fullscreen-fallback #chat-messages {
    flex:1 1 auto !important;
    min-height:0 !important;
    max-height:none !important;
}
.chat-document-panel:fullscreen .chat-compose,
.chat-document-panel:-webkit-full-screen .chat-compose,
.chat-document-panel.chat-fullscreen-fallback .chat-compose { flex:0 0 auto !important; }
.chat-document-panel .chat-fullscreen-toggle { white-space:nowrap; }

.account-role-picker { margin-top:12px; }
.account-role-picker > summary { display:inline-flex; align-items:center; cursor:pointer; list-style:none; }
.account-role-picker > summary::-webkit-details-marker { display:none; }
.account-role-picker[open] { padding:12px; border:1px solid #444; background:#1a1a1a; }
.account-role-picker[open] > summary { margin-bottom:8px; }
.account-role-picker .account-role-form { margin-top:8px; padding-top:10px; }
.account-add-role { min-height:34px; }

/* A compact voice dock is shown only when this tab is carrying a room between pages. */
#filed-vc[data-persistent-dock="1"] { display:none; }
#filed-vc.vc-persistent-dock-active {
    position:fixed !important;
    right:14px !important;
    bottom:14px !important;
    z-index:9000 !important;
    display:block !important;
    width:min(520px,calc(100vw - 28px)) !important;
    max-width:520px !important;
    max-height:min(58vh,520px) !important;
    margin:0 !important;
    overflow:auto !important;
    box-shadow:0 12px 44px rgba(0,0,0,.58) !important;
    border:1px solid #555 !important;
    background:#111 !important;
}
#filed-vc.vc-persistent-dock-active .vc-main { gap:7px; padding:8px; }
#filed-vc.vc-persistent-dock-active .vc-screens video { max-height:22vh; }
#filed-vc.vc-persistent-dock-active .vc-recordings { display:none; }
#filed-vc.vc-persistent-dock-active .chat-document-toolbar { position:sticky; top:0; z-index:1; }
@media (max-width:600px) {
    #filed-vc.vc-persistent-dock-active { right:7px !important; bottom:7px !important; width:calc(100vw - 14px) !important; max-height:48vh !important; }
}

/* Admin screens: clearer hierarchy, consistent controls, and calmer surfaces. */
.admin-shell { width:min(1180px,calc(100% - 28px)); margin:12px auto 40px; }
.admin-shell .file-browser-top {
    display:flex !important; flex-wrap:wrap; align-items:center; justify-content:space-between;
    gap:10px 18px; padding:12px 14px; margin-bottom:22px;
    background:#151515 !important; border:1px solid #353535 !important;
}
.admin-shell .file-browser-nav { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.admin-shell .file-browser-nav a {
    display:inline-flex; align-items:center; padding:7px 10px; color:#c6d5ef !important;
    background:#202020; border:1px solid #383838; text-decoration:none;
}
.admin-shell .file-browser-nav a:hover { background:#292929; border-color:#666; }
.admin-shell > h2 { margin:20px 0 7px; font-size:22px; letter-spacing:.01em; }
.admin-shell > h2 + p { max-width:820px; color:#999 !important; line-height:1.55; }
.admin-shell .admin-toolbar {
    display:flex !important; flex-wrap:wrap; align-items:center; justify-content:space-between;
    gap:10px; margin:18px 0 10px; padding:12px 14px;
    background:#171717 !important; border:1px solid #353535 !important;
}
.admin-shell .admin-toolbar h2 { margin:0; font-size:18px; }
.admin-shell .admin-settings,
.admin-shell .role-file-create,
.admin-shell .role-file-directory,
.admin-shell .role-image-settings {
    margin:16px 0; padding:15px; background:#171717 !important;
    border:1px solid #373737 !important;
}
.admin-shell .admin-settings h2,
.admin-shell .admin-settings h3,
.admin-shell .role-file-directory h3 { margin-top:0; }
.admin-shell .settings-form { display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px 16px; }
.admin-shell .settings-form label { display:flex; flex-direction:column; gap:6px; min-width:160px; }
.admin-shell .settings-form label:has(input[type="checkbox"]) { flex-direction:row; align-items:center; min-width:0; }
.admin-shell input:not([type="checkbox"]):not([type="radio"]),
.admin-shell select,
.admin-shell textarea { border-radius:0!important; padding:8px 9px; }
.admin-shell button,.admin-shell .button { border-radius:0!important; padding:8px 12px; }
.admin-shell .file-table { overflow:hidden; border:1px solid #353535 !important; }
.admin-shell .file-table th { padding:10px 11px; color:#a5a5a5 !important; background:#191919 !important; }
.admin-shell .file-table td { padding:10px 11px; }
.admin-shell .file-table tbody tr:nth-child(even) td { background:#151515 !important; }
.admin-shell .file-table tbody tr:hover td { background:#222 !important; }
.admin-shell .file-notice,.admin-shell .error { padding:10px 12px; border:1px solid; }
.admin-shell .context-menu { border-radius:0!important; }
.admin-shell .admin-settings form { max-width:100%; }
@media (max-width:650px) {
    .admin-shell { width:calc(100% - 16px); margin:8px auto 24px; }
    .admin-shell .file-browser-top { padding:9px; }
    .admin-shell .file-table { display:block; overflow-x:auto; }
    .admin-shell .admin-settings,.admin-shell .role-file-create,.admin-shell .role-file-directory { padding:10px; }
}


/* Filed 1.2.11: make inline chat a full-width workspace and keep tools in one contained tray. */
.chat-active-file-table {
    display:block !important;
    width:100% !important;
    table-layout:auto !important;
    border-collapse:separate !important;
    overflow:visible !important;
}
.chat-active-file-table thead,
.chat-active-file-table tbody { display:block !important; width:100% !important; }
.chat-active-file-table thead tr {
    display:block !important;
    width:100% !important;
    border-bottom:1px solid #333;
}
.chat-active-file-table thead th:first-child {
    display:block !important;
    width:100% !important;
    padding:7px 10px !important;
    box-sizing:border-box !important;
}
.chat-active-file-table thead th:not(:first-child) { display:none !important; }
.chat-active-file-table tbody tr:not(.chat-file-inline-row) {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) 44px;
    align-items:center;
    width:100%;
    box-sizing:border-box;
    border-bottom:1px solid #292929;
}
.chat-active-file-table tbody tr:not(.chat-file-inline-row) > .file-name-cell {
    display:block !important;
    grid-column:1;
    grid-row:1;
    width:auto !important;
    min-width:0;
    box-sizing:border-box;
}
.chat-active-file-table tbody tr:not(.chat-file-inline-row) > .actions-cell {
    display:block !important;
    grid-column:2;
    grid-row:1;
    width:44px !important;
    min-width:44px !important;
    box-sizing:border-box;
}
.chat-active-file-table tbody tr:not(.chat-file-inline-row) > .file-size-col,
.chat-active-file-table tbody tr:not(.chat-file-inline-row) > .file-date-col { display:none !important; }
.chat-active-file-table tbody tr.chat-file-inline-row {
    display:block !important;
    width:100% !important;
    box-sizing:border-box !important;
    background:#101010 !important;
    border:1px solid #383838 !important;
    border-left:2px solid #777 !important;
}
.chat-active-file-table tbody tr.chat-file-inline-row > .file-name-cell {
    display:block !important;
    width:100% !important;
    min-width:0 !important;
    padding:10px !important;
    box-sizing:border-box !important;
}
.chat-active-file-table tbody tr.chat-file-inline-row > .file-size-col,
.chat-active-file-table tbody tr.chat-file-inline-row > .file-date-col,
.chat-active-file-table tbody tr.chat-file-inline-row > .actions-cell { display:none !important; }
.chat-active-file-table .chat-document-panel {
    display:flex !important;
    flex-direction:column !important;
    width:100% !important;
    max-width:none !important;
    height:min(74vh,760px) !important;
    min-height:420px !important;
    margin:12px 0 2px !important;
    overflow:visible !important;
    border:1px solid #383838 !important;
    border-radius:0!important;
    background:#101010 !important;
    box-sizing:border-box !important;
}
.chat-active-file-table .chat-document-panel .chat-document-toolbar {
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:space-between;
    gap:8px 14px;
    padding:10px 12px;
    background:#171717 !important;
    border-bottom:1px solid #303030 !important;
    border-radius:0;
}
.chat-active-file-table .chat-document-panel .text-document-meta { flex:1 1 220px; min-width:0; }
.chat-active-file-table .chat-document-panel .chat-document-actions {
    display:flex;
    flex:0 1 auto;
    flex-wrap:wrap;
    align-items:center;
    gap:7px;
    min-width:0;
}
.chat-active-file-table .chat-document-panel .chat-transcript-wrap {
    display:flex !important;
    flex:1 1 auto !important;
    min-width:0 !important;
    min-height:0 !important;
    max-height:none !important;
    overflow:hidden !important;
    background:#101010 !important;
}
.chat-active-file-table .chat-document-panel #chat-messages.chat-transcript {
    flex:1 1 auto !important;
    width:100% !important;
    min-width:0 !important;
    min-height:0 !important;
    max-height:none !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    padding:14px clamp(12px,2vw,24px) !important;
    color:#dedede !important;
    background:#101010 !important;
    border:0 !important;
    font:13px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace !important;
}
.chat-active-file-table .chat-document-panel .chat-message-group {
    margin:0;
    padding:9px 0 11px;
    border-bottom:1px solid #272727 !important;
}
.chat-active-file-table .chat-document-panel .chat-message-head { gap:7px; margin-bottom:4px; }
.chat-active-file-table .chat-document-panel .chat-message { line-height:1.5; }
.chat-active-file-table .chat-document-panel .chat-compose {
    position:relative !important;
    z-index:3;
    flex:0 0 auto !important;
    display:grid !important;
    gap:7px;
    padding:10px 12px !important;
    background:#171717 !important;
    border-top:1px solid #303030 !important;
    border-radius:0;
    overflow:visible !important;
}
.chat-active-file-table .chat-document-panel #chat-compose {
    min-height:52px !important;
    max-height:24vh !important;
    padding:10px 12px !important;
    border:1px solid #3a3a3a !important;
    border-radius:0!important;
    background:#0c0c0c !important;
    font:13px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace !important;
}
/* Every secondary tool opens in the same tray above the composer; one tray at a time. */
.chat-active-file-table .chat-document-panel .chat-notification-panel,
.chat-active-file-table .chat-document-panel .chat-server-picker,
.chat-active-file-table .chat-document-panel #chat-emoji-picker,
.chat-active-file-table .chat-document-panel .chat-sound-picker,
.chat-active-file-table .chat-document-panel #chat-online {
    position:absolute !important;
    top:auto !important;
    right:8px !important;
    bottom:calc(100% + 8px) !important;
    left:8px !important;
    width:auto !important;
    max-width:none !important;
    max-height:min(58vh,460px) !important;
    overflow:auto !important;
    overscroll-behavior:contain;
    box-sizing:border-box !important;
    z-index:80 !important;
    padding:12px !important;
    color:#ddd !important;
    background:#171717 !important;
    border:1px solid #3a3a3a !important;
    border-radius:0!important;
    box-shadow:0 16px 42px rgba(0,0,0,.68) !important;
}
.chat-active-file-table .chat-document-panel .chat-online-list {
    display:flex;
    flex-direction:row;
    flex-wrap:wrap;
    gap:5px 10px;
}
.chat-active-file-table .chat-document-panel .chat-online-user {
    display:inline-flex;
    width:auto;
    max-width:100%;
    margin:0;
    padding:5px 7px;
    border:1px solid #303030;
    border-radius:0;
    background:#202020;
    box-sizing:border-box;
}
.chat-active-file-table .chat-document-panel .chat-notification-item {
    display:block;
    padding:9px 4px;
    white-space:normal;
    overflow-wrap:anywhere;
    border-bottom:1px solid #303030;
}
.chat-active-file-table .chat-document-panel .chat-notification-item span {
    white-space:normal;
    overflow:visible;
    text-overflow:clip;
}
.chat-active-file-table .chat-document-panel .chat-emoji-picker-head { position:sticky; top:-12px; z-index:2; padding:2px 0 8px; background:#171717; }
.chat-active-file-table .chat-document-panel .chat-emoji-categories {
    position:sticky;
    top:28px;
    z-index:1;
    padding:6px 0;
    background:#171717;
}
.chat-active-file-table .chat-document-panel .chat-emoji-grid {
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(38px,1fr));
    gap:4px;
}
.chat-active-file-table .chat-document-panel .chat-emoji-choice {
    display:flex;
    align-items:center;
    justify-content:center;
    min-width:0;
    min-height:38px;
    padding:4px;
    border:1px solid #303030;
    border-radius:0;
    background:#202020;
}
.chat-active-file-table .chat-document-panel .chat-emoji-upload { align-items:center; }
.chat-active-file-table .chat-document-panel .chat-server-file-row {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:10px;
    padding:8px 2px;
    border-bottom:1px solid #303030;
}
.chat-active-file-table .chat-document-panel .chat-server-file-row span { min-width:0; overflow-wrap:anywhere; }
.chat-active-file-table .chat-document-panel .chat-action-toolbar {
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:6px;
    padding-top:7px;
    border-top:1px solid #292929;
}
.chat-active-file-table .chat-document-panel .chat-action-toolbar button {
    min-height:30px;
    padding:5px 9px;
    border:1px solid #353535;
    border-radius:0;
    background:#202020;
}
.chat-active-file-table .chat-document-panel .chat-action-toolbar #chat-send {
    margin-left:auto;
    color:#fff !important;
    background:#343434 !important;
    border-color:#555 !important;
}
@media (max-width:700px) {
    .chat-active-file-table .chat-document-panel { height:70vh !important; min-height:360px !important; }
    .chat-active-file-table .chat-document-panel .chat-document-toolbar { align-items:flex-start; }
    .chat-active-file-table .chat-document-panel .chat-document-actions { flex:1 1 100%; }
    .chat-active-file-table .chat-document-panel .chat-action-toolbar #chat-send { margin-left:0; }
}
@media (max-height:560px) {
    .chat-active-file-table .chat-document-panel { height:calc(100vh - 180px) !important; min-height:300px !important; }
}


/* Filed 1.2.11: hard-square interface and local chat sound embeds. */
*, *::before, *::after { border-radius: 0!important; }
.soundboard-shell { max-width: 1100px; margin: 0 auto; padding: 0 14px 28px; }
.soundboard-header { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin:20px 0 14px; }
.soundboard-header h2 { margin:0 0 5px; }
.soundboard-search { display:flex; flex-wrap:wrap; gap:8px; margin:14px 0 18px; }
.soundboard-search input { flex:1 1 260px; min-width:0; }
.soundboard-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr)); gap:8px; }
.soundboard-item { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; padding:12px; background:var(--panel,#191919); border:1px solid var(--border,#454545); min-width:0; }
.soundboard-item-main { display:flex; flex-direction:column; gap:3px; min-width:0; }
.soundboard-item-main strong { overflow-wrap:anywhere; }
.soundboard-item audio { display:block; width:100%; max-width:100%; min-width:0; }
.soundboard-copy { justify-self:start; }
.soundboard-empty { padding:20px; border:1px solid var(--border,#454545); background:var(--panel,#191919); }
.soundboard-help { margin-top:18px; }
.chat-sound-embed { display:inline-flex; align-items:center; gap:8px; max-width:100%; padding:3px 6px; margin:2px 3px; border:1px solid var(--border,#454545); background:var(--panel,#191919); vertical-align:middle; }
.chat-sound-label { overflow-wrap:anywhere; }
.chat-sound-play { padding:2px 8px; border:1px solid var(--border,#555); background:var(--button,#292929); color:inherit; font:inherit; cursor:pointer; }
.account-preferences-form { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.account-sound-toggle { display:flex; align-items:center; gap:8px; }
@media (max-width:600px) { .soundboard-shell { padding-left:8px; padding-right:8px; } .soundboard-item { padding:9px; } .soundboard-header { display:block; } .chat-sound-embed { display:flex; width:fit-content; } }


/* 1.2.12: searchable sound picker in the chat composer. */
.chat-document-panel .chat-sound-picker {
    position:absolute;
    right:0;
    bottom:calc(100% + 7px);
    left:0;
    z-index:90;
    max-height:min(58vh,460px);
    padding:12px;
    overflow:auto;
    box-sizing:border-box;
    color:#ddd;
    background:#171717;
    border:1px solid #3a3a3a;
    box-shadow:0 12px 32px rgba(0,0,0,.62);
}
.chat-document-panel #chat-sound-search {
    display:block;
    width:100%;
    min-width:0;
    margin:0 0 9px;
    padding:9px 10px;
    box-sizing:border-box;
    color:#eee;
    background:#0c0c0c;
    border:1px solid #444;
    font:inherit;
}
.chat-sound-results { display:grid; gap:5px; min-width:0; }
.chat-sound-result {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    min-width:0;
    padding:8px 9px;
    background:#202020;
    border:1px solid #363636;
}
.chat-sound-result-info { display:flex; flex:1 1 auto; flex-direction:column; gap:3px; min-width:0; }
.chat-sound-result-name { overflow-wrap:anywhere; color:#eee; }
.chat-sound-result-path { overflow-wrap:anywhere; color:#999; }
.chat-sound-result-actions { display:flex; flex:0 0 auto; align-items:center; gap:5px; }
.chat-sound-result-actions button { min-height:30px; padding:5px 9px; white-space:nowrap; }
.chat-sound-picker-help { margin:9px 0 0; color:#999; }
.chat-document-panel .chat-sound-picker .chat-emoji-picker-head { position:sticky; top:-12px; z-index:2; padding:2px 0 9px; background:#171717; }
@media(max-width:560px) {
    .chat-sound-result { align-items:flex-start; flex-direction:column; gap:7px; }
    .chat-sound-result-actions { width:100%; }
    .chat-sound-result-actions button { flex:1 1 0; }
}


/* Filed 1.2.14: secondary pages follow the existing homepage design.
   The original homepage rules above are intentionally left unchanged.
   Shared values are sampled from the homepage's own controls and surfaces. */
:root {
    --filed-ui-bg: #111111;
    --filed-ui-surface: #181818;
    --filed-ui-surface-raised: #1b1b1b;
    --filed-ui-control: #252525;
    --filed-ui-control-hover: #303030;
    --filed-ui-border: #555555;
    --filed-ui-border-soft: #333333;
    --filed-ui-divider: #292929;
    --filed-ui-text: #dddddd;
    --filed-ui-muted: #888888;
    --filed-ui-link: #9bbcff;
}

/* Do not restyle body, #page, the file table, or the ordinary homepage. */
.chat-page,
.chat-document-panel,
.text-document-panel,
.admin-shell,
.account-shell,
.soundboard-shell,
.role-files-shell,
#filed-vc {
    color: var(--filed-ui-text);
}

/* Common controls: consistent colors and borders, without changing geometry. */
.chat-page button,
.chat-document-panel button,
.text-document-panel button,
.text-document-panel .button,
.admin-shell button,
.admin-shell .button,
.account-shell button,
.account-shell .button,
.soundboard-shell button,
.soundboard-shell .button,
.role-files-shell button,
.role-files-shell .button,
#filed-vc button,
#filed-vc .button {
    color: var(--filed-ui-text);
    background: var(--filed-ui-control);
    background-image: none;
    border: 1px solid var(--filed-ui-border);
    box-shadow: none;
    text-shadow: none;
    font-family: inherit;
}
.chat-page button:hover,
.chat-document-panel button:hover,
.admin-shell button:hover,
.admin-shell .button:hover,
.account-shell button:hover,
.account-shell .button:hover,
.soundboard-shell button:hover,
.soundboard-shell .button:hover,
.role-files-shell button:hover,
.role-files-shell .button:hover,
#filed-vc button:hover,
#filed-vc .button:hover {
    color: #ffffff;
    background: var(--filed-ui-control-hover);
    border-color: #888888;
}
.chat-page button:disabled,
.chat-document-panel button:disabled,
.admin-shell button:disabled,
.account-shell button:disabled,
.soundboard-shell button:disabled,
.role-files-shell button:disabled,
#filed-vc button:disabled {
    opacity: .48;
    cursor: not-allowed;
}
.chat-page .quiet-button,
.chat-document-panel .quiet-button,
.admin-shell .quiet-button,
.account-shell .quiet-button,
.soundboard-shell .quiet-button,
.role-files-shell .quiet-button,
#filed-vc .quiet-button {
    color: var(--filed-ui-link);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}
.chat-page .quiet-button:hover,
.chat-document-panel .quiet-button:hover,
.admin-shell .quiet-button:hover,
.account-shell .quiet-button:hover,
.soundboard-shell .quiet-button:hover,
.role-files-shell .quiet-button:hover,
#filed-vc .quiet-button:hover {
    color: #c5d8ff;
    background: var(--filed-ui-control-hover);
    border-color: var(--filed-ui-border);
}

.chat-page input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.chat-document-panel input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.text-document-panel input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.text-document-panel select,
.text-document-panel textarea,
.chat-page select,
.chat-document-panel select,
.chat-page textarea,
.chat-document-panel textarea,
.admin-shell input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.admin-shell select,
.admin-shell textarea,
.account-shell input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.account-shell select,
.account-shell textarea,
.soundboard-shell input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.soundboard-shell select,
.soundboard-shell textarea,
.role-files-shell input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.role-files-shell select,
.role-files-shell textarea,
#filed-vc input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
#filed-vc select,
#filed-vc textarea {
    color: var(--filed-ui-text);
    background: var(--filed-ui-surface);
    border: 1px solid var(--filed-ui-border);
    box-shadow: none;
    font-family: inherit;
}
.chat-page input::placeholder,
.chat-document-panel input::placeholder,
.text-document-panel input::placeholder,
.text-document-panel textarea::placeholder,
.admin-shell input::placeholder,
.account-shell input::placeholder,
.soundboard-shell input::placeholder,
.role-files-shell input::placeholder,
#filed-vc input::placeholder,
.chat-page textarea::placeholder,
.chat-document-panel textarea::placeholder,
.admin-shell textarea::placeholder,
.account-shell textarea::placeholder,
.soundboard-shell textarea::placeholder,
.role-files-shell textarea::placeholder,
#filed-vc textarea::placeholder {
    color: var(--filed-ui-muted);
    opacity: 1;
}
.chat-page input[type="checkbox"],
.chat-page input[type="radio"],
.admin-shell input[type="checkbox"],
.admin-shell input[type="radio"],
.account-shell input[type="checkbox"],
.account-shell input[type="radio"],
#filed-vc input[type="checkbox"],
#filed-vc input[type="radio"] { accent-color: var(--filed-ui-link); }
.chat-page :focus-visible,
.chat-document-panel :focus-visible,
.admin-shell :focus-visible,
.account-shell :focus-visible,
.soundboard-shell :focus-visible,
.role-files-shell :focus-visible,
#filed-vc :focus-visible {
    outline: 1px solid var(--filed-ui-link);
    outline-offset: 2px;
}

/* Embedded and standalone chat use the same near-black document surfaces. */
.chat-page #page { background: var(--filed-ui-bg); }
.chat-page .chat-document-panel,
.chat-document-panel {
    color: var(--filed-ui-text);
    background: var(--filed-ui-bg);
    border: 1px solid var(--filed-ui-divider);
    outline: none;
}
.chat-page .chat-document-toolbar,
.chat-document-panel .chat-document-toolbar {
    color: var(--filed-ui-text);
    background: #151515;
    border-bottom: 1px solid var(--filed-ui-divider);
}
.chat-page .chat-transcript-wrap,
.chat-page #chat-messages.chat-transcript,
.chat-document-panel .chat-transcript-wrap,
.chat-document-panel #chat-messages.chat-transcript {
    color: var(--filed-ui-text);
    background: var(--filed-ui-bg);
    border-left-color: var(--filed-ui-border-soft);
}
.chat-page .chat-message-group,
.chat-document-panel .chat-message-group { border-bottom-color: var(--filed-ui-divider); }
.chat-page .chat-compose,
.chat-document-panel .chat-compose {
    background: #151515;
    border-top-color: var(--filed-ui-divider);
}
.chat-page #chat-compose,
.chat-document-panel #chat-compose {
    color: var(--filed-ui-text);
    background: #080808;
    border: 1px solid var(--filed-ui-border);
}
.chat-page #chat-compose:focus,
.chat-document-panel #chat-compose:focus { border-color: var(--filed-ui-link); box-shadow: none; }
.chat-page .chat-message-body a,
.chat-document-panel .chat-message-body a,
.chat-page .chat-back-link,
.chat-document-panel .chat-back-link { color: var(--filed-ui-link); }
.chat-page .chat-reply-quote,
.chat-page .chat-pending-file,
.chat-page #chat-reply-banner,
.chat-document-panel .chat-reply-quote,
.chat-document-panel .chat-pending-file,
.chat-document-panel #chat-reply-banner {
    color: #bbbbbb;
    background: #181818;
    border-color: var(--filed-ui-border-soft);
}
.chat-page .chat-action-toolbar,
.chat-document-panel .chat-action-toolbar { border-top-color: var(--filed-ui-divider); }
.chat-page .chat-action-toolbar button,
.chat-document-panel .chat-action-toolbar button,
.chat-page .chat-message-actions button,
.chat-document-panel .chat-message-actions button,
.chat-page .chat-message-actions-inline button,
.chat-document-panel .chat-message-actions-inline button,
.chat-page .chat-reactions button,
.chat-document-panel .chat-reactions button {
    color: var(--filed-ui-text);
    background: var(--filed-ui-control);
    border: 1px solid var(--filed-ui-border);
    box-shadow: none;
}
.chat-page .chat-action-toolbar button:hover,
.chat-document-panel .chat-action-toolbar button:hover,
.chat-page .chat-message-actions button:hover,
.chat-document-panel .chat-message-actions button:hover,
.chat-page .chat-message-actions-inline button:hover,
.chat-document-panel .chat-message-actions-inline button:hover,
.chat-page .chat-reactions button:hover,
.chat-document-panel .chat-reactions button:hover {
    background: var(--filed-ui-control-hover);
    border-color: #888888;
}
.chat-page .chat-action-toolbar #chat-send,
.chat-document-panel .chat-action-toolbar #chat-send {
    color: #ffffff;
    background: #303030;
    border-color: #777777;
}

/* Emoji, server-file, notification and sound panels share the homepage menu look. */
.chat-page .chat-notification-panel,
.chat-page .chat-server-picker,
.chat-page #chat-emoji-picker,
.chat-document-panel .chat-notification-panel,
.chat-document-panel .chat-server-picker,
.chat-document-panel #chat-emoji-picker,
.chat-document-panel .chat-sound-picker {
    color: var(--filed-ui-text);
    background: var(--filed-ui-surface-raised);
    border: 1px solid var(--filed-ui-border);
    box-shadow: 0 4px 14px #000000;
}
.chat-page .chat-emoji-picker-head,
.chat-document-panel .chat-emoji-picker-head { color: var(--filed-ui-text); }
.chat-page .chat-emoji-categories button,
.chat-page .chat-emoji-picker-head button,
.chat-page .chat-emoji-choice,
.chat-page .chat-emoji-more,
.chat-page .chat-server-file-row button,
.chat-document-panel .chat-emoji-categories button,
.chat-document-panel .chat-emoji-picker-head button,
.chat-document-panel .chat-emoji-choice,
.chat-document-panel .chat-emoji-more,
.chat-document-panel .chat-server-file-row button,
.chat-document-panel .chat-sound-result-actions button {
    color: var(--filed-ui-text);
    background: var(--filed-ui-control);
    border: 1px solid var(--filed-ui-border);
    box-shadow: none;
}
.chat-page .chat-emoji-categories button:hover,
.chat-page .chat-emoji-picker-head button:hover,
.chat-page .chat-emoji-choice:hover,
.chat-page .chat-emoji-more:hover,
.chat-page .chat-server-file-row button:hover,
.chat-document-panel .chat-emoji-categories button:hover,
.chat-document-panel .chat-emoji-picker-head button:hover,
.chat-document-panel .chat-emoji-choice:hover,
.chat-document-panel .chat-emoji-more:hover,
.chat-document-panel .chat-server-file-row button:hover,
.chat-document-panel .chat-sound-result-actions button:hover {
    background: var(--filed-ui-control-hover);
    border-color: #888888;
}
.chat-page .chat-emoji-categories button.active,
.chat-document-panel .chat-emoji-categories button.active {
    color: #ffffff;
    background: #303030;
    border-color: #888888;
}
.chat-page .chat-server-file-row,
.chat-document-panel .chat-server-file-row,
.chat-page .chat-notification-item,
.chat-document-panel .chat-notification-item { border-bottom-color: var(--filed-ui-divider); }
.chat-page .chat-sound-result,
.chat-document-panel .chat-sound-result {
    color: var(--filed-ui-text);
    background: var(--filed-ui-surface);
    border-color: var(--filed-ui-divider);
}
.chat-page .chat-sound-result-name,
.chat-document-panel .chat-sound-result-name { color: var(--filed-ui-text); }
.chat-page .chat-sound-result-path,
.chat-document-panel .chat-sound-result-path,
.chat-page .chat-sound-picker-help,
.chat-document-panel .chat-sound-picker-help { color: var(--filed-ui-muted); }

/* Admin remains a Filed file-browser page: flat sections, native tables, simple forms. */
.admin-shell .file-browser-top,
.admin-shell .file-browser-nav,
.admin-shell .file-toolbar,
.admin-shell .file-sort-toolbar,
.admin-shell .file-sort-controls,
.admin-shell .admin-toolbar { background: transparent; box-shadow: none; }
.admin-shell .file-table { border: 0; background: transparent; }
.admin-shell .file-table th {
    color: var(--filed-ui-muted);
    background: transparent;
    border-bottom: 1px solid #444444;
}
.admin-shell .file-table td { background: transparent; border-bottom: 1px solid var(--filed-ui-divider); }
.admin-shell .file-table tbody tr:hover td { background: #171717; }
.admin-shell .file-table tbody tr:nth-child(even) td { background: transparent; }
.admin-shell .file-row.drop-target td { background: #26392b; border-color: #8fbd9b; }
.admin-shell .file-row.drop-before td { border-top-color: #8fbd9b; }
.admin-shell .file-row.drop-after td { border-bottom-color: #8fbd9b; }
.admin-shell .admin-settings,
.admin-shell .role-file-create,
.admin-shell .role-file-directory,
.admin-shell .role-image-settings {
    color: var(--filed-ui-text);
    background: transparent;
    border: 0;
    border-top: 1px solid var(--filed-ui-border-soft);
    box-shadow: none;
}
.admin-shell .admin-settings h2,
.admin-shell .admin-settings h3,
.admin-shell .role-file-directory h3 { color: var(--filed-ui-text); }
.admin-shell .file-browser-nav a { color: var(--filed-ui-link); }
.admin-shell .file-browser-nav a:hover { color: #c5d8ff; }
.admin-shell .context-menu {
    color: var(--filed-ui-text);
    background: var(--filed-ui-surface-raised);
    border: 1px solid var(--filed-ui-border);
    box-shadow: 0 4px 14px #000000;
}
.admin-shell .context-menu .menu-action,
.admin-shell .context-menu .menu-action-button { color: var(--filed-ui-text); }
.admin-shell .context-menu .menu-action:hover,
.admin-shell .context-menu .menu-action-button:hover { background: var(--filed-ui-control-hover); }
.admin-shell .good,
.admin-shell .file-notice { color: #a8dfa8; background: transparent; border-color: #45634c; }
.admin-shell .error { color: #ff9999; background: transparent; border-color: #694040; }

/* Account, role files and soundboard use the same flat section rhythm as the homepage. */
.account-card {
    color: var(--filed-ui-text);
    background: transparent;
    border: 0;
    border-top: 1px solid var(--filed-ui-border-soft);
    box-shadow: none;
}
.account-card h2,
.account-card h3,
.account-card h4,
.account-identity strong { color: var(--filed-ui-text); }
.account-card .small,
.account-identity span,
.account-password-form label { color: var(--filed-ui-muted); }
.account-role-picker[open] {
    color: var(--filed-ui-text);
    background: var(--filed-ui-surface);
    border: 1px solid var(--filed-ui-border);
}
.account-role-option { color: var(--filed-ui-text); }
.account-password-form input { color: var(--filed-ui-text); background: var(--filed-ui-surface); border-color: var(--filed-ui-border); }
.role-file-create,
.role-file-directory { background: transparent; border-color: var(--filed-ui-border-soft); }
.role-file-content { color: var(--filed-ui-text); background: var(--filed-ui-bg); border-color: var(--filed-ui-border-soft); }
.soundboard-item {
    color: var(--filed-ui-text);
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--filed-ui-divider);
    box-shadow: none;
}
.soundboard-empty { color: var(--filed-ui-text); background: transparent; border: 1px solid var(--filed-ui-border); }
.soundboard-item audio { color-scheme: dark; }
.soundboard-item .small,
.soundboard-help { color: var(--filed-ui-muted); }
.chat-sound-embed { color: var(--filed-ui-text); background: var(--filed-ui-surface); border-color: var(--filed-ui-border); }

/* Context menus inside secondary pages match the homepage's own menu surface. */
.chat-page .context-menu,
.chat-document-panel .context-menu,
.account-shell .context-menu,
.soundboard-shell .context-menu,
.role-files-shell .context-menu,
#filed-vc .context-menu {
    color: var(--filed-ui-text);
    background: var(--filed-ui-surface-raised);
    border: 1px solid var(--filed-ui-border);
    box-shadow: 0 4px 14px #000000;
}
.chat-page .context-menu a,
.chat-document-panel .context-menu a,
.account-shell .context-menu a,
.soundboard-shell .context-menu a,
.role-files-shell .context-menu a,
#filed-vc .context-menu a { color: var(--filed-ui-link); }
.chat-page .context-menu .menu-action-button,
.chat-document-panel .context-menu .menu-action-button,
.account-shell .context-menu .menu-action-button,
.soundboard-shell .context-menu .menu-action-button,
.role-files-shell .context-menu .menu-action-button,
#filed-vc .context-menu .menu-action-button { color: var(--filed-ui-text); }



/* Match the older standalone chat/access selectors at their original specificity. */
.chat-page .chat-toolbar button,
.chat-page .chat-tool-button,
.chat-page .chat-notification-toggle,
#chat-app .chat-toolbar button,
#chat-app .chat-tool-button,
#chat-app .chat-notification-toggle {
    color: #dddddd;
    background: #252525;
    border-color: #555555;
    box-shadow: none;
}
.chat-page .chat-toolbar button:hover,
.chat-page .chat-tool-button:hover,
.chat-page .chat-notification-toggle:hover,
#chat-app .chat-toolbar button:hover,
#chat-app .chat-tool-button:hover,
#chat-app .chat-notification-toggle:hover {
    color: #ffffff;
    background: #303030;
    border-color: #888888;
}
.chat-page #chat-send,
#chat-app #chat-send {
    color: #ffffff;
    background: #303030;
    border: 1px solid #777777;
    font-weight: 600;
}
.chat-page #chat-send:hover,
#chat-app #chat-send:hover { background: #383838; }
.chat-page .chat-message-actions,
#chat-app .chat-message-actions {
    color: #dddddd;
    background: #1b1b1b;
    border-color: #444444;
}
.chat-page .chat-message-actions button,
#chat-app .chat-message-actions button,
.chat-page .chat-reaction-choice,
#chat-app .chat-reaction-choice {
    color: #dddddd;
    background: #252525;
    border-color: #555555;
}
.chat-page .chat-message-actions button:hover,
#chat-app .chat-message-actions button:hover,
.chat-page .chat-reaction-choice:hover,
#chat-app .chat-reaction-choice:hover { background: #303030; border-color: #888888; }
.chat-page .chat-online-title,
.chat-page .chat-online-user,
#chat-app .chat-online-title,
#chat-app .chat-online-user { color: #dddddd; }
.chat-page .chat-online-user:hover,
#chat-app .chat-online-user:hover { background: #181818; border-color: #444444; }
.chat-page .chat-status,
#chat-app .chat-status { color: #888888; }
.chat-page .chat-message-more,
#chat-app .chat-message-more { color: #9bbcff; }
.chat-page .chat-pending-file,
#chat-app .chat-pending-file { color: #bbbbbb; background: #181818; border-color: #333333; }
.chat-page .chat-access-page {
    color: #dddddd;
    background: #111111;
    border-color: #444444;
    outline: none;
}
.chat-page .chat-access-header { border-bottom-color: #333333; }
.chat-page .chat-access-header strong { color: #dddddd; }
.chat-page .chat-access-user { color: #dddddd; background: #181818; border-color: #444444; }
.chat-page .chat-access-private input,
.chat-page .chat-access-user input { accent-color: #9bbcff; }
.chat-page .chat-access-actions .button,
.chat-page .chat-access-actions .quiet-button {
    color: #dddddd;
    background: #252525;
    border-color: #555555;
}
.chat-page .chat-access-actions .quiet-button { color: #9bbcff; background: transparent; border-color: transparent; }

/* Embedded chat's older high-specificity row rules receive the same palette. */
#chat-app .chat-action-toolbar button,
#chat-app .chat-message-actions-inline button,
#chat-app .chat-reactions button,
#chat-app .chat-emoji-categories button,
#chat-app .chat-emoji-picker-head button,
#chat-app .chat-emoji-choice,
#chat-app .chat-emoji-more,
#chat-app .chat-server-file-row button,
#chat-app .chat-sound-result-actions button {
    color: #dddddd;
    background: #252525;
    border-color: #555555;
    box-shadow: none;
}
#chat-app .chat-action-toolbar button:hover,
#chat-app .chat-message-actions-inline button:hover,
#chat-app .chat-reactions button:hover,
#chat-app .chat-emoji-categories button:hover,
#chat-app .chat-emoji-picker-head button:hover,
#chat-app .chat-emoji-choice:hover,
#chat-app .chat-emoji-more:hover,
#chat-app .chat-server-file-row button:hover,
#chat-app .chat-sound-result-actions button:hover {
    background: #303030;
    border-color: #888888;
}
#chat-app .chat-emoji-categories button.active { color: #ffffff; background: #303030; border-color: #888888; }
#chat-app .chat-emoji-picker-head,
#chat-app .chat-emoji-categories { background: #1b1b1b; }
#chat-app .chat-emoji-choice { border-radius: 0; }
#chat-app .chat-sound-result { background: #181818; border-color: #333333; }

.admin-shell .more-button {
    color: #aaaaaa !important;
    background: transparent !important;
    border: 1px solid transparent !important;
}
.admin-shell .more-button:hover,
.admin-shell .more-button[aria-expanded="true"] {
    color: #ffffff !important;
    background: #222222 !important;
    border-color: #444444 !important;
}
.vc-folder-badge, .filed-playlist-badge { color: #888888; background: #181818; border-color: #444444; letter-spacing: 0; }


/* Finish normalizing the standalone chat's older room-level color overrides. */
.chat-page .chat-shell { background: #111111; }
.chat-page .chat-header {
    color: #dddddd;
    background: #181818;
    border-color: #444444;
}
.chat-page .chat-header > strong,
.chat-page .chat-title-row h2,
.chat-page .chat-message-head strong { color: #dddddd; }
.chat-page .chat-header .small,
.chat-page .chat-message-head,
.chat-page .chat-message-id,
.chat-page .chat-status { color: #888888; }
.chat-page .chat-header .chat-access-link {
    color: #9bbcff;
    background: transparent;
    border-color: #555555;
}
.chat-page .chat-main,
.chat-page .chat-files,
.chat-page .chat-online {
    color: #dddddd;
    background: #111111;
    border-color: #333333;
}
.chat-page .chat-title-row,
.chat-page #chat-messages { border-bottom-color: #333333; }
.chat-page .chat-message-group { border-bottom-color: #292929; }
.chat-page .chat-message-body,
.chat-page .chat-online-title { color: #dddddd; }
.chat-page .chat-message-body a,
.chat-page .chat-back-link,
.chat-page #chat-load-older,
.chat-page .chat-message-more,
.chat-page .chat-notification-item strong { color: #9bbcff; }
.chat-page .chat-online-user,
.chat-page .chat-notification-item { color: #dddddd; }
.chat-page .chat-online-user:hover { background: #181818; border-color: #444444; }
.chat-page .chat-reply-quote { color: #aaaaaa; background: #181818; border-left-color: #555555; }
.chat-page .chat-upload-progress,
.chat-page .chat-upload-track { background: #333333; }
.chat-page #chat-upload-bar { background: #9bbcff; }
.chat-page .chat-account-content { color: #dddddd; background: #111111; border-color: #333333; }
.chat-page .chat-account-content .chat-form { border-top-color: #333333; }
.chat-page .chat-account-content input[type="text"],
.chat-page .chat-account-content input[type="password"] {
    color: #dddddd;
    background: #181818;
    border-color: #555555;
}
.chat-page .chat-account-content input[type="submit"] {
    color: #dddddd;
    background: #252525;
    border-color: #555555;
}
.chat-document-panel .chat-help-line code { color: #c8c8c8; background: #1a1a1a; border: 1px solid #292929; }


/* ==========================================================================
   Filed 1.2.15: one site, one look. The "links" theme.
   The homepage is the reference: dark, plain, everything a link, boxes only
   where a form really needs a button. This layer is last on purpose; every
   page (admin, account, sounds, chat, voice, previews, login) is pulled onto
   the homepage's frame, top bar, link style and control style.
   ========================================================================== */
:root {
    color-scheme: dark;
    --links-bg: #111111;
    --links-text: #dddddd;
    --links-muted: #888888;
    --links-link: #9bbcff;
    --links-link-hover: #c5d8ff;
    --links-visited: #b9a2d6;
    --links-rule: #333333;
    --links-row-rule: #292929;
    --links-field: #181818;
    --links-button: #252525;
    --links-border: #555555;
}
::selection { background: #2c3e63; color: #ffffff; }
a:focus, button:focus, summary:focus { outline: 1px dotted var(--links-link); outline-offset: 2px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--links-link); }
code, kbd, samp { color: #cccccc; background: transparent; font-family: "DejaVu Sans Mono", Menlo, Consolas, monospace; font-size: 12px; }

/* One frame: every secondary page sits where the homepage sits. */
html body #page .admin-shell,
html body #page .account-shell,
html body #page .soundboard-shell,
html body #page .role-files-shell,
html body #page .text-editor-shell,
html body #page .vc-shell {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* One top bar: path on the left, links on the right, a hairline under it. */
html body #page .file-browser-top {
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid var(--links-rule) !important;
    box-shadow: none !important;
    padding: 0 0 10px 0 !important;
    margin: 0 0 10px 0 !important;
}
html body #page .file-browser-top .path { color: var(--links-muted); margin: 0; }
html body #page .file-browser-nav { gap: 12px !important; }
html body #page .file-browser-nav a,
html body #page .admin-shell .file-browser-nav a,
html body #page .account-shell .file-browser-nav a {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    color: var(--links-link) !important;
    font-size: 12px;
    text-decoration: none;
}
html body #page .file-browser-nav a:hover { color: var(--links-link-hover) !important; text-decoration: underline; }

/* Headings are quiet labels, not banners. */
html body #page .admin-shell h2, html body #page .account-shell h2, html body #page .soundboard-shell h2,
html body #page .role-files-shell h2, html body #page .text-document-panel h2, html body #page > h2 {
    font-size: 14px; font-weight: bold; color: var(--links-text); margin: 14px 0 6px 0; padding: 0;
}
html body #page .admin-shell h3, html body #page .account-shell h3, html body #page .soundboard-shell h3,
html body #page .role-files-shell h3, html body #page .text-document-panel h3, html body #page .vc-shell h3 {
    font-size: 14px; font-weight: normal; color: var(--links-text); margin: 0 0 6px 0; padding: 0;
}
html body #page .admin-shell h4, html body #page .account-shell h4 {
    font-size: 12px; font-weight: normal; color: var(--links-muted); margin: 10px 0 4px 0;
}

/* Sections: no cards. A hairline and some air, like the homepage's .tools. */
html body #page .account-card,
html body #page .admin-settings,
html body #page .role-image-settings,
html body #page .role-file-create,
html body #page .role-file-directory,
html body #page .admin-toolbar,
html body #page .soundboard-empty,
html body #page .account-role-picker[open],
html body #page .account-role-form {
    background: transparent !important;
    border: 0 !important;
    border-top: 1px solid var(--links-rule) !important;
    box-shadow: none !important;
    padding: 12px 0 !important;
    margin: 14px 0 0 0 !important;
}
html body #page .account-role-form { border-top: 0 !important; margin-top: 4px !important; }
html body #page .admin-toolbar { display: flex; align-items: center; justify-content: space-between; border-top: 0 !important; margin-top: 0 !important; }
html body #page .account-card:first-of-type { border-top: 0 !important; margin-top: 0 !important; }
html body #page .account-identity strong { font-size: 14px; color: var(--links-text); }
html body #page .account-identity span, html body #page .account-card .small { color: var(--links-muted); }
html body #page .account-role { background: transparent !important; border: 1px solid var(--role-color, var(--links-border)) !important; }
html body #page .account-role-picker > summary { list-style: none; }
html body #page .account-role-picker > summary::-webkit-details-marker { display: none; }

/* Sounds: rows, not tiles. */
html body #page .soundboard-list { display: block; }
html body #page .soundboard-item {
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid var(--links-row-rule) !important;
    box-shadow: none !important;
    padding: 9px 0 !important;
    margin: 0 !important;
}
html body #page .soundboard-search { margin: 8px 0 12px 0; }
html body #page .soundboard-help { margin-top: 14px; }

/* Forms: labels sit beside their fields, checkboxes read as a plain list. */
html body #page .settings-form,
html body #page .account-password-form,
html body #page .account-preferences-form {
    display: flex !important; flex-wrap: wrap; align-items: center; gap: 8px 20px;
    background: transparent !important; border: 0 !important; padding: 0 !important; margin: 6px 0 !important;
}
html body #page .settings-form label,
html body #page .account-password-form label,
html body #page .account-role-option,
html body #page .account-sound-toggle {
    display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 6px;
    color: var(--links-text) !important; font-size: 14px; width: auto !important; white-space: nowrap;
}
html body #page .account-password-form label { color: var(--links-muted) !important; font-size: 12px; }
html body #page input[type=checkbox], html body #page input[type=radio] { accent-color: #7ca6e8; margin: 0 4px 0 0; }
html body #page input[type=color] { background: var(--links-field); border: 1px solid var(--links-border); padding: 1px; width: 44px; height: 26px; }
html body #page select[multiple] { min-width: 160px; min-height: 52px; }
html body #page .empty-state, html body #page .soundboard-empty { color: var(--links-muted); text-align: left; }
html body #page table.file-table { border: 0 !important; background: transparent !important; }
html body #page table.file-table td.empty-state { text-align: left; padding-left: 8px; }

/* Text fields: exactly the homepage's field. */
html body #page input[type=text], html body #page input[type=search], html body #page input[type=password],
html body #page input[type=email], html body #page input:not([type]), html body #page textarea, html body #page select {
    background: var(--links-field); color: var(--links-text); border: 1px solid var(--links-border);
    border-radius: 0; font-family: Arial, Helvetica, sans-serif; font-size: 14px; padding: 6px;
}
html body #page textarea.css-editor, html body #page textarea.text-file-editor-area, html body #page #chat-compose { background: #0d0d0d; }
::placeholder { color: #707070; opacity: 1; }

/* Buttons are rare: the charcoal box is for real form submits only. */
html body #page input.button, html body #page button.button, html body #page a.button, html body #page .button-link {
    background: var(--links-button); color: var(--links-text); border: 1px solid var(--links-border);
    border-radius: 0; text-decoration: none; cursor: pointer; box-shadow: none;
}
html body #page input.button:hover, html body #page button.button:hover, html body #page a.button:hover { background: #303030; border-color: #777777; text-decoration: none; color: #ffffff; }
html body #page .button:disabled { opacity: .5; cursor: default; }

/* Everything else that used to be a chip is now a link, like "Upload file" and "Log out" on the homepage. */
html body #page .quiet-button,
html body #page .admin-shell .quiet-button,
html body #page .account-shell .quiet-button,
html body #page .soundboard-shell .quiet-button,
html body #page .role-files-shell .quiet-button,
html body #page .chat-document-panel .quiet-button,
html body #page .text-document-panel .quiet-button,
html body #page #filed-vc .quiet-button,
html body #page .chat-toolbar button:not(#chat-send),
html body #page .chat-message-actions button,
html body #page .chat-reactions button,
html body #page .chat-file-actions button,
html body #page .chat-emoji-categories button,
html body #page .text-document-actions button,
html body #page .text-document-actions .button,
html body #page #filed-vc .vc-toolbar button:not(.button),
html body #page .context-menu .menu-action-button:not(.danger-action) {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: var(--links-link) !important;
    padding: 2px 0 !important;
    margin: 0 10px 0 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}
html body #page .quiet-button:hover,
html body #page .chat-toolbar button:not(#chat-send):hover,
html body #page .chat-message-actions button:hover,
html body #page .chat-reactions button:hover,
html body #page .chat-file-actions button:hover,
html body #page .text-document-actions button:hover,
html body #page #filed-vc .vc-toolbar button:not(.button):hover { color: var(--links-link-hover) !important; background: transparent !important; }
html body #page .quiet-button:disabled,
html body #page #filed-vc .vc-toolbar button:disabled,
html body #page .chat-toolbar button:disabled { color: #666666 !important; text-decoration: none; cursor: default; }
html body #page .chat-emoji-categories button.active { color: #ffffff !important; text-decoration: none; }
html body #page .chat-emoji-choice, html body #page .chat-emoji-more { text-decoration: none; margin: 0; }
html body #page #chat-send { background: var(--links-button); color: var(--links-text); border: 1px solid var(--links-border); border-radius: 0; padding: 6px 14px; font-weight: normal; }
html body #page #chat-send:hover { background: #303030; color: #ffffff; }

/* Document / chat / voice surfaces: flat, same rules and background as the page. */
html body #page .text-document-panel,
html body #page .chat-document-panel,
html body #page #filed-vc,
html body #page .chat-account-document {
    background: transparent;
    border: 1px solid var(--links-rule);
    border-radius: 0;
    box-shadow: none;
    color: var(--links-text);
}
html body #page .text-document-toolbar,
html body #page .chat-document-toolbar,
html body #page .text-editor-header,
html body #page .text-editor-toolbar,
html body #page .text-editor-footer {
    background: transparent !important;
    border-color: var(--links-rule) !important;
    color: var(--links-muted);
}
html body #page .text-document-meta strong,
html body #page .chat-document-toolbar strong { color: var(--links-text); font-size: 13px; }
html body #page .text-document-help { color: var(--links-muted); border-color: var(--links-rule); }
html body #page pre.text-document, html body #page .text-document { background: transparent; color: var(--links-text); }
html body #page .chat-message { border-bottom: 1px solid var(--links-row-rule); }
html body #page .chat-message-head { color: var(--links-muted); }
html body #page .chat-reply-quote { background: transparent; border-left: 2px solid var(--links-visited); color: var(--links-muted); }
html body #page #chat-emoji-picker, html body #page .chat-tool-tray, html body #page .chat-tray {
    background: var(--links-field) !important; border: 1px solid var(--links-rule) !important;
}
html body #page #chat-messages { border-bottom-color: var(--links-rule); }

/* Voice: people are plain rows, status dots stay. */
html body #page #filed-vc .vc-person { background: transparent !important; border: 0 !important; border-bottom: 1px solid var(--links-row-rule) !important; padding: 5px 0 !important; }
html body #page #filed-vc .vc-people, html body #page #filed-vc .vc-recordings { border-top-color: var(--links-rule); }
html body #page #filed-vc .vc-screen-card { background: #0d0d0d !important; border-color: var(--links-rule) !important; }

/* Login / account-join: a left-aligned form on the page, not a floating card. */
html body #page .chat-join, html body #page .chat-account-document { max-width: none !important; margin: 0 !important; background: transparent !important; border: 0 !important; }
html body #page .chat-join .chat-account-content { padding: 0 !important; }
html body #page .chat-join .chat-form { border: 0 !important; background: transparent !important; padding: 0 !important; margin: 0 0 18px 0 !important; }
html body #page .chat-join .text-document-toolbar { border: 0 !important; border-bottom: 1px solid var(--links-rule) !important; padding: 0 0 10px 0 !important; margin: 0 0 14px 0 !important; }
html body #page .chat-join input[type=text], html body #page .chat-join input[type=password] { width: 240px !important; max-width: 100%; }

/* Status colours stay recognisable but calm. */
html body #page .error { color: #ff9999; }
html body #page .good { color: #a8dfa8; }
html body #page .file-notice { background: transparent !important; border: 0 !important; padding: 0 !important; }

/* Phones: same page, just tighter. */
@media screen and (max-width: 640px) {
    html body #page .file-browser-top { padding-bottom: 8px !important; }
    html body #page .settings-form label, html body #page .account-password-form label { white-space: normal; }
    html body #page .chat-join input[type=text], html body #page .chat-join input[type=password] { width: 100% !important; }
}

/* 1.2.15 refinements: admin tables match the homepage list, small actions read as links. */
html body #page .admin-settings,
html body #page .role-file-directory { max-width: none !important; }
html body #page .admin-shell .file-table th,
html body #page .admin-shell .file-table td,
html body #page .account-shell .file-table th,
html body #page .account-shell .file-table td { background: transparent !important; }
html body #page .admin-shell .file-table th { padding: 7px 10px !important; border-bottom: 1px solid #444444 !important; }
html body #page .admin-shell .file-table td { padding: 8px 10px !important; border-bottom: 1px solid var(--links-row-rule) !important; height: auto !important; }
html body #page .admin-shell .file-table tbody tr:hover td { background: #161616 !important; }
html body #page .admin-shell h3 { margin-top: 16px; }
html body #page .admin-shell h3:first-child,
html body #page .admin-shell section > h3:first-child { margin-top: 0; }
html body #page .account-add-role,
html body #page .soundboard-copy,
html body #page .soundboard-empty .button,
html body #page .soundboard-empty a.button {
    background: transparent !important; border: 0 !important; box-shadow: none !important;
    color: var(--links-link) !important; padding: 2px 0 !important; font-size: 12px;
    text-decoration: underline; cursor: pointer; list-style: none; display: inline-block;
}
html body #page .account-add-role:hover, html body #page .soundboard-copy:hover { color: var(--links-link-hover) !important; background: transparent !important; }
html body #page .soundboard-search { display: flex; align-items: center; gap: 10px; }
html body #page .soundboard-search input[type=search] { flex: 1 1 auto; min-width: 0; }
html body #page .vc-folder-badge, html body #page .filed-playlist-badge { background: transparent !important; border: 0 !important; color: var(--links-muted) !important; padding: 0 0 0 6px !important; font-size: 12px; }
html body #page .vc-folder-badge::before, html body #page .filed-playlist-badge::before { content: "["; }
html body #page .vc-folder-badge::after, html body #page .filed-playlist-badge::after { content: "]"; }
html body #page .account-card:first-of-type { padding-top: 0 !important; }

/* Join/login page uses the same page padding and full-width bar as every other page. */
html body.chat-page #page { padding: 12px !important; }
html body #page .chat-join, html body #page .chat-account-document { width: auto !important; min-height: 0 !important; position: static !important; transform: none !important; }
html body #page .file-tools .small, html body #page .file-tools-main .small { color: var(--links-muted); }

/* Phones: form rows stack cleanly and checkboxes never inherit a column width. */
html body #page input[type=checkbox], html body #page input[type=radio] { width: auto !important; min-width: 0 !important; flex: 0 0 auto !important; }
@media screen and (max-width: 640px) {
    html body #page .settings-form { display: block !important; }
    html body #page .settings-form label { display: flex !important; width: 100% !important; margin: 0 0 8px 0 !important; white-space: normal !important; }
    html body #page .settings-form label input[type=text], html body #page .settings-form label input:not([type]) { flex: 1 1 auto; min-width: 0; }
}

/* The homepage's own quiet links ("Manual order", "Log out") keep their original size and spacing. */
html body #page .quiet-button { font-size: inherit; margin: 0; font-family: inherit; }
html body #page .file-browser-nav .quiet-button { font-size: 12px; margin: 0; }

/* Filed 1.2.16: persistent voice is a full-width bottom bar, not a floating card. */
#filed-vc.vc-persistent-dock-active {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9000 !important;
    display: block !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(38vh, 300px) !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    border: 1px solid var(--links-rule, #333333) !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    background: var(--links-bg, #111111) !important;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, .42) !important;
}
#filed-vc.vc-persistent-dock-active .chat-document-toolbar {
    min-height: 0 !important;
    padding: 5px 12px !important;
    margin: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid var(--links-rule, #333333) !important;
}
#filed-vc.vc-persistent-dock-active .vc-main {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .9fr);
    grid-template-areas: "controls people" "note people" "screens screens";
    align-items: center;
    gap: 6px 16px !important;
    padding: 7px 12px !important;
    background: var(--links-bg, #111111) !important;
}
#filed-vc.vc-persistent-dock-active .vc-toolbar {
    grid-area: controls;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 9px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
}
#filed-vc.vc-persistent-dock-active .vc-note {
    grid-area: note;
    min-height: 0 !important;
    margin: 0 !important;
}
#filed-vc.vc-persistent-dock-active .vc-people {
    grid-area: people;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    min-width: 0;
    padding: 0 !important;
    border: 0 !important;
}
#filed-vc.vc-persistent-dock-active .vc-people h3 { margin: 0; white-space: nowrap; }
#filed-vc.vc-persistent-dock-active #vc-people-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    min-width: 0;
    max-height: 66px;
    overflow: auto;
}
#filed-vc.vc-persistent-dock-active .vc-person {
    padding: 3px 5px !important;
    white-space: nowrap;
}
#filed-vc.vc-persistent-dock-active .vc-screens {
    grid-area: screens;
    display: flex;
    gap: 8px;
    max-height: 92px;
    overflow: auto;
}
#filed-vc.vc-persistent-dock-active .vc-screens:empty { display: none; }
#filed-vc.vc-persistent-dock-active .vc-screen-card { flex: 0 0 170px; padding: 4px; }
#filed-vc.vc-persistent-dock-active .vc-screen-card video { max-height: 72px; }
#filed-vc.vc-persistent-dock-active .vc-recordings { display: none !important; }
body.vc-dock-open #page { padding-bottom: 154px !important; }
@media (max-width: 760px) {
    #filed-vc.vc-persistent-dock-active { max-height: 46vh !important; }
    #filed-vc.vc-persistent-dock-active .vc-main {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "controls" "people" "note" "screens";
        gap: 7px !important;
        padding: 7px 9px !important;
    }
    #filed-vc.vc-persistent-dock-active .vc-people { gap: 5px 9px; }
    body.vc-dock-open #page { padding-bottom: 190px !important; }
}

/* The chat toolbar stays above the transcript and has room on both sides. */
html body #page .chat-document-panel .chat-action-area {
    position: relative !important;
    z-index: 30;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}
html body #page .chat-document-panel .chat-action-toolbar {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 7px 11px !important;
    width: 100% !important;
    min-width: 0;
    box-sizing: border-box !important;
    padding: 8px 10px !important;
    margin: 0 0 9px 0 !important;
    border: 1px solid var(--links-rule, #333333) !important;
    overflow: visible !important;
}
html body #page .chat-document-panel .chat-action-toolbar button {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
    margin: 0 !important;
    padding: 5px 9px !important;
    box-sizing: border-box;
    white-space: normal;
    border-radius: 0!important;
}
html body #page .chat-document-panel .chat-action-toolbar #chat-send { margin-left: auto !important; }
html body #page .chat-document-panel .chat-action-area > #chat-online,
html body #page .chat-document-panel .chat-action-area > #chat-notification-panel,
html body #page .chat-document-panel .chat-action-area > #chat-emoji-picker,
html body #page .chat-document-panel .chat-action-area > #chat-server-picker,
html body #page .chat-document-panel .chat-action-area > #chat-sound-picker,
html body #page .chat-document-panel .chat-action-area > #chat-meme-picker {
    position: absolute !important;
    top: calc(100% + 5px) !important;
    right: 0 !important;
    bottom: auto !important;
    left: 0 !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(58vh, 460px) !important;
    overflow: auto !important;
    box-sizing: border-box !important;
    z-index: 4000 !important;
    padding: 10px !important;
    border: 1px solid var(--links-rule, #333333) !important;
    border-radius: 0!important;
    background: var(--links-field, #181818) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5) !important;
}
html body #page .chat-document-panel .chat-online-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 7px 0;
    color: var(--links-text, #dddddd);
}
html body #page .chat-document-panel .chat-online-title span {
    display: inline-block;
    color: var(--links-muted, #888888);
    font-weight: normal;
}
html body #page .chat-document-panel .chat-online-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 10px;
}
html body #page .chat-document-panel .chat-online-user {
    display: inline-flex;
    align-items: center;
    width: auto;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 5px 7px;
    box-sizing: border-box;
}
@media (max-width: 560px) {
    html body #page .chat-document-panel .chat-action-toolbar { gap: 6px !important; padding: 7px !important; }
    html body #page .chat-document-panel .chat-action-toolbar button { padding: 5px 7px !important; }
    html body #page .chat-document-panel .chat-action-toolbar #chat-send { margin-left: 0 !important; }
}

/* Large directories render a bounded page of rows instead of a huge document. */
.file-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 7px 12px;
    width: 100%;
    box-sizing: border-box;
    padding: 7px 0;
    margin: 5px 0;
    border-top: 1px solid var(--links-rule, #333333);
    border-bottom: 1px solid var(--links-rule, #333333);
}
.file-pagination-status { color: var(--links-muted, #888888); font-size: 12px; }
.file-pagination .is-disabled { opacity: .4; cursor: default; }
.file-pagination .quiet-button { display: inline-block; padding: 4px 8px; text-decoration: none; }


/* Filed 1.2.17: chat utility windows dock directly to their control strip. */
html body #page .chat-document-panel .chat-action-toolbar {
    margin-bottom: 0 !important;
}
html body #page .chat-document-panel .chat-action-area.chat-utility-open .chat-action-toolbar {
    border-bottom-width: 0 !important;
}
html body #page .chat-document-panel .chat-action-area > #chat-online,
html body #page .chat-document-panel .chat-action-area > #chat-notification-panel,
html body #page .chat-document-panel .chat-action-area > #chat-emoji-picker,
html body #page .chat-document-panel .chat-action-area > #chat-server-picker,
html body #page .chat-document-panel .chat-action-area > #chat-sound-picker,
html body #page .chat-document-panel .chat-action-area > #chat-meme-picker {
    top: 100% !important;
    margin: 0 !important;
    border-top: 0 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .42) !important;
}
html body #page .chat-document-panel #chat-online {
    padding-top: 8px !important;
}
html body #page .chat-document-panel #chat-online-list {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 5px 10px !important;
    margin: 0 !important;
}
html body #page .chat-document-panel .chat-online-title {
    display: none !important;
}
html body #page .chat-document-panel .chat-action-toolbar #chat-send {
    display: inline-block !important;
    flex: 0 0 auto !important;
    margin-left: auto !important;
    padding: 2px 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--links-link, #9bbcff) !important;
    box-shadow: none !important;
    font: inherit !important;
    font-size: 12px !important;
    font-weight: normal !important;
    text-decoration: underline !important;
    cursor: pointer !important;
}
html body #page .chat-document-panel .chat-action-toolbar #chat-send:hover {
    background: transparent !important;
    color: var(--links-link-hover, #c5d8ff) !important;
}
html body #page .chat-document-panel .chat-action-toolbar #chat-send:disabled {
    color: #666666 !important;
    text-decoration: none !important;
    cursor: default !important;
}
@media (max-width: 560px) {
    html body #page .chat-document-panel .chat-action-toolbar #chat-send {
        margin-left: 0 !important;
    }
}


/* Filed 1.2.18: message actions appear on hover; touch devices get a compact toggle. */
html body #page .chat-message-actions-inline {
    display: none !important;
    position: absolute !important;
    top: 0 !important;
    right: 2px !important;
    z-index: 5 !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    margin: 0 !important;
    padding: 3px !important;
    background: var(--links-field, #181818) !important;
    border: 1px solid var(--links-rule, #444444) !important;
}
html body #page .chat-message:hover .chat-message-actions-inline,
html body #page .chat-message:focus-within .chat-message-actions-inline,
html body #page .chat-message.actions-open .chat-message-actions-inline {
    display: flex !important;
}
html body #page .chat-message .chat-message-more {
    display: none !important;
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    z-index: 6 !important;
    margin: 0 !important;
    padding: 0 4px !important;
    color: var(--links-link, #9bbcff) !important;
    background: transparent !important;
    border: 0 !important;
    font: 16px/1.2 Arial, Helvetica, sans-serif !important;
    cursor: pointer !important;
}
html body #page .chat-message-group .chat-message {
    border-bottom: 0 !important;
}
@media (hover: none), (pointer: coarse) {
    html body #page .chat-message .chat-message-more {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 24px !important;
        min-height: 24px !important;
    }
    html body #page .chat-message-actions-inline {
        right: 28px !important;
        max-width: calc(100% - 36px) !important;
    }
    html body #page .chat-message:hover .chat-message-actions-inline,
    html body #page .chat-message:focus-within .chat-message-actions-inline {
        display: none !important;
    }
    html body #page .chat-message.actions-open .chat-message-actions-inline {
        display: flex !important;
    }
}


/* Filed 1.2.19: file copy/paste controls and recursive folder sizes. */
.file-toolbar .file-paste-form { display:inline-flex; align-items:center; flex-wrap:wrap; gap:5px 8px; margin:0; padding:0; border:0; }
.file-toolbar .file-paste-button { display:inline-block; padding:4px 0; color:var(--links-link, #9bbcff); }
.file-toolbar .file-paste-label { color:var(--links-muted, #888); font-size:11px; }
.context-menu .file-copy-action { color:var(--links-link, #9bbcff); }
.context-menu .file-copy-action:hover { color:var(--links-link-hover, #c4d8ff); }


/* Live @mention suggestions: only currently-online chat members are offered. */
#chat-app .chat-mention-suggestions {
    display:none;
    width:100%;
    max-height:180px;
    overflow-y:auto;
    box-sizing:border-box;
    margin:0 0 5px 0;
    border:1px solid var(--filed-ui-divider, #444);
    background:#101010;
}
#chat-app .chat-mention-suggestion {
    display:block;
    width:100%;
    box-sizing:border-box;
    padding:7px 9px;
    border:0;
    border-bottom:1px solid var(--filed-ui-divider, #333);
    background:transparent;
    color:var(--filed-ui-text, #ddd);
    text-align:left;
    font:inherit;
    cursor:pointer;
}
#chat-app .chat-mention-suggestion:last-child { border-bottom:0; }
#chat-app .chat-mention-suggestion { display:flex; align-items:center; gap:12px; }
#chat-app .chat-mention-suggestion-status { margin-left:auto; color:var(--links-muted, #888); font-size:11px; white-space:nowrap; }
#chat-app .chat-mention-suggestion-status.online { color:#83b78b; }
#chat-app .chat-mention-suggestion-status.offline { color:#999; }
#chat-app .chat-mention-suggestion-status.broadcast { color:#d9b36a; }
#chat-app .chat-path-suggestion-type { margin-left:auto; color:var(--links-muted, #888); font-size:11px; white-space:nowrap; }
#chat-app .chat-path-embed { display:block; margin:4px 0; }
#chat-app .chat-mention-suggestion:hover,
#chat-app .chat-mention-suggestion.active { background:#202020; color:#fff; }


/* User About Me profiles: crisp square overlay matching Filed's document UI. */
.chat-profile-overlay {
    position:fixed; inset:0; z-index:10050; display:flex; align-items:center; justify-content:center;
    padding:18px; box-sizing:border-box; background:rgba(0,0,0,.84);
}
.chat-profile-card {
    width:min(590px,100%); max-height:min(82vh,760px); overflow:auto; box-sizing:border-box;
    padding:0; color:#ddd; background:#111; border:1px solid #555; border-top:3px solid #9f8ab9;
    box-shadow:0 10px 34px rgba(0,0,0,.72);
}
.chat-profile-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 15px; background:#171717; border-bottom:1px solid #383838; }
.chat-profile-identity { display:grid; gap:4px; min-width:0; }
.chat-profile-kicker { color:#888; font:9px/1.3 ui-monospace,SFMono-Regular,Consolas,monospace; letter-spacing:.13em; }
.chat-profile-head strong { min-width:0; overflow-wrap:anywhere; color:#eee; font:700 16px/1.3 ui-monospace,SFMono-Regular,Consolas,monospace; }
.chat-profile-head .quiet-button { flex:0 0 auto; padding:5px 10px; color:#c8b3e1; background:#202020; border:1px solid #555; }
.chat-profile-head .quiet-button:hover { color:#fff; background:#292929; border-color:#888; }
.chat-profile-section { padding:13px 15px 15px; }
.chat-profile-card h3 { display:flex; align-items:center; gap:9px; margin:0 0 8px; color:#bbb; font:700 10px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace; letter-spacing:.12em; }
.chat-profile-card h3:after { content:""; height:1px; flex:1; background:#333; }
.chat-profile-aboutme {
    max-height:58vh; overflow:auto; margin:0; padding:13px; border:1px solid #333; border-left:2px solid #665576;
    background:#0c0c0c; color:#d5d5d5; font:12px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace;
    white-space:pre-wrap; overflow-wrap:anywhere;
}
@media (max-width:560px) {
    .chat-profile-overlay { padding:9px; }
    .chat-profile-head { padding:11px 12px; }
    .chat-profile-section { padding:11px 12px 13px; }
    .chat-profile-aboutme { max-height:65vh; padding:10px; }
}
.chat-document-panel .chat-profile-name {
    appearance:none; -webkit-appearance:none; display:inline; margin:0; padding:0; border:0; border-radius:0;
    background-color:transparent; color:inherit; font:inherit; font-weight:700; cursor:pointer; text-align:left;
}
.chat-document-panel .chat-profile-name:not(.chat-root-name) { background-image:none; }
.chat-document-panel .chat-profile-name.chat-root-name { color:#f07cba; font-weight:800; }
.chat-document-panel .chat-profile-name:hover { text-decoration:underline; }
.chat-document-panel button.chat-profile-name.chat-root-name,
.chat-document-panel button.chat-profile-name.chat-root-name:hover {
    background-color:transparent;
    color:#f07cba !important;
    -webkit-text-fill-color:#f07cba !important;
    text-shadow:0 0 5px rgba(255,91,190,.42),0 0 10px rgba(91,151,255,.3) !important;
}
.chat-document-panel .chat-online-user {
    appearance:none; -webkit-appearance:none; border:1px solid transparent; border-radius:0;
    background:transparent; font:inherit; text-align:left; cursor:pointer;
}
.chat-document-panel .chat-online-user:focus-visible,
.chat-document-panel .chat-profile-name:focus-visible { outline:1px dotted #aaa; outline-offset:2px; }
.account-aboutme-form { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; }
.account-aboutme-form label { min-width:100%; }
.account-aboutme-form select { flex:1 1 260px; min-width:0; max-width:100%; padding:7px; color:#ddd; background:#202020; border:1px solid #555; }


/* Filed 1.2.27: compact inline message editor. */
html body #page .chat-message-edit-form {
    display: block !important;
    width: min(640px, 100%);
    max-width: 100%;
    margin: 6px 0;
    box-sizing: border-box;
}
html body #page .chat-message-edit-form textarea {
    display: block;
    width: 100%;
    min-height: 64px;
    max-height: 220px;
    padding: 7px;
    box-sizing: border-box;
    resize: vertical;
    color: var(--links-text, #e0e0e0);
    background: var(--links-field, #181818);
    border: 1px solid var(--links-rule, #555);
    border-radius: 0;
    font: inherit;
}
html body #page .chat-message-edit-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
}
html body #page .chat-message-edit-controls button {
    min-height: 25px;
    padding: 3px 9px;
    color: var(--links-link, #9bbcff);
    background: transparent;
    border: 1px solid var(--links-rule, #555);
    border-radius: 0;
    cursor: pointer;
}
html body #page .chat-message-edit-controls button:hover {
    color: var(--links-link-hover, #c4d8ff);
    background: var(--links-hover, #242424);
}
html body #page .chat-message-edit-controls button:disabled { opacity: .55; cursor: wait; }
html body #page .chat-edited-marker {
    display: inline-block;
    margin-left: 5px;
    color: var(--links-muted, #888);
    font-size: 10px;
    font-style: italic;
}


/* Filed 1.2.28: empty-space file actions and consistent menu controls. */
html body #page .context-menu .menu-action-button {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: block !important;
    width: 100% !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 7px 8px !important;
    color: var(--links-text, #dddddd) !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0!important;
    box-shadow: none !important;
    text-align: left !important;
    text-decoration: none !important;
    font: inherit !important;
    cursor: pointer !important;
}
html body #page .context-menu .menu-action-button:hover:not(:disabled) {
    color: var(--links-text, #ffffff) !important;
    background: var(--links-hover, #282828) !important;
}
html body #page .context-menu .menu-action-button:disabled {
    color: var(--links-muted, #777777) !important;
    opacity: .55 !important;
    cursor: default !important;
}
.file-background-context-menu {
    position: fixed !important;
    z-index: 10020 !important;
    right: auto;
    bottom: auto;
    width: 248px;
    min-width: 210px;
    max-width: min(280px, calc(100vw - 16px));
    max-height: min(72vh, 560px);
    overflow: auto;
    box-sizing: border-box;
    padding: 6px !important;
}
.file-background-context-menu .menu-separator {
    height: 1px;
    margin: 5px 2px;
    background: var(--links-rule, #333333);
}
.file-background-context-menu .menu-action-button {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* On phones, keep chat actions in one sideways-scrollable strip, never a stack. */
@media (max-width: 700px) {
    html body #page .chat-document-panel .chat-action-toolbar,
    html body #page .chat-active-file-table .chat-document-panel .chat-action-toolbar,
    html body #page .chat-page .chat-action-toolbar,
    html body #page #chat-app .chat-action-toolbar,
    html body #page .chat-toolbar {
        display: flex !important;
        flex-flow: row nowrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 7px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        white-space: nowrap !important;
    }
    html body #page .chat-document-panel .chat-action-toolbar > *,
    html body #page .chat-active-file-table .chat-document-panel .chat-action-toolbar > *,
    html body #page .chat-page .chat-action-toolbar > *,
    html body #page #chat-app .chat-action-toolbar > *,
    html body #page .chat-toolbar > * {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        max-width: none !important;
    }
    html body #page .chat-document-panel .chat-action-toolbar #chat-send,
    html body #page .chat-active-file-table .chat-document-panel .chat-action-toolbar #chat-send {
        margin-left: 0 !important;
    }
}


/* Filed 1.2.31: keep the persistent voice channel as a compact bottom strip. */
#filed-vc.vc-persistent-dock-active {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9000 !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: none !important;
    max-height: min(132px, 31vh) !important;
    margin: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border: 1px solid var(--links-rule, #333333) !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    background: var(--links-bg, #111111) !important;
    box-shadow: 0 -5px 16px rgba(0, 0, 0, .34) !important;
}
#filed-vc.vc-persistent-dock-active .chat-document-toolbar {
    display: flex !important;
    flex: 0 0 25px !important;
    min-height: 25px !important;
    max-height: 25px !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 2px 10px !important;
    margin: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-bottom: 1px solid var(--links-rule, #333333) !important;
    box-sizing: border-box !important;
}
#filed-vc.vc-persistent-dock-active .chat-document-toolbar .text-document-meta {
    display: flex !important;
    flex: 0 1 auto !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 7px !important;
    min-width: 0 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
}
#filed-vc.vc-persistent-dock-active .chat-document-toolbar strong {
    flex: 0 0 auto !important;
    margin: 0 !important;
    font-size: 11px !important;
    line-height: 18px !important;
}
#filed-vc.vc-persistent-dock-active .chat-document-path {
    display: block !important;
    max-width: 28vw !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 10px !important;
}
#filed-vc.vc-persistent-dock-active #vc-status {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    margin-left: auto !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 10px !important;
    line-height: 18px !important;
}
#filed-vc.vc-persistent-dock-active .vc-main {
    display: flex !important;
    flex: 0 1 auto !important;
    flex-flow: row wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 2px 12px !important;
    min-height: 0 !important;
    max-height: 114px !important;
    padding: 3px 10px 4px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    background: var(--links-bg, #111111) !important;
}
#filed-vc.vc-persistent-dock-active .vc-toolbar {
    order: 1 !important;
    display: flex !important;
    flex: 1 1 390px !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    gap: 4px 7px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    scrollbar-width: thin;
    border: 0 !important;
}
#filed-vc.vc-persistent-dock-active .vc-toolbar button {
    flex: 0 0 auto !important;
    min-height: 24px !important;
    margin: 0 !important;
    padding: 3px 7px !important;
    font-size: 10px !important;
    line-height: 16px !important;
    white-space: nowrap !important;
}
#filed-vc.vc-persistent-dock-active .vc-divider {
    flex: 0 0 1px !important;
    height: 17px !important;
    margin: 0 2px !important;
}
#filed-vc.vc-persistent-dock-active .vc-people {
    order: 2 !important;
    display: flex !important;
    flex: 0 1 310px !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    gap: 7px !important;
    min-width: 120px !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
}
#filed-vc.vc-persistent-dock-active .vc-people h3 {
    flex: 0 0 auto !important;
    margin: 0 !important;
    font-size: 10px !important;
    line-height: 18px !important;
    white-space: nowrap !important;
}
#filed-vc.vc-persistent-dock-active #vc-people-list {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    gap: 4px !important;
    min-width: 0 !important;
    max-height: 26px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    scrollbar-width: thin;
}
#filed-vc.vc-persistent-dock-active .vc-person {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    gap: 4px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 2px 4px !important;
    font-size: 10px !important;
    line-height: 14px !important;
    white-space: nowrap !important;
}
#filed-vc.vc-persistent-dock-active .vc-dot {
    width: 6px !important;
    height: 6px !important;
    flex: 0 0 6px !important;
}
#filed-vc.vc-persistent-dock-active .vc-person-state {
    font-size: 9px !important;
    white-space: nowrap !important;
}
#filed-vc.vc-persistent-dock-active .vc-note {
    order: 3 !important;
    display: block !important;
    flex: 0 1 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    color: var(--links-muted, #888888) !important;
    font-size: 9px !important;
    line-height: 12px !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}
#filed-vc.vc-persistent-dock-active .vc-note:empty { display: none !important; }
#filed-vc.vc-persistent-dock-active .vc-screens {
    order: 4 !important;
    display: flex !important;
    flex: 0 1 100% !important;
    flex-flow: row nowrap !important;
    gap: 5px !important;
    min-width: 0 !important;
    max-height: 43px !important;
    margin: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
}
#filed-vc.vc-persistent-dock-active .vc-screens:empty { display: none !important; }
#filed-vc.vc-persistent-dock-active .vc-screen-card {
    display: flex !important;
    flex: 0 0 116px !important;
    flex-direction: column !important;
    gap: 0 !important;
    min-width: 0 !important;
    max-height: 40px !important;
    padding: 2px 4px !important;
}
#filed-vc.vc-persistent-dock-active .vc-screen-label {
    flex: 0 0 auto !important;
    padding: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 8px !important;
    line-height: 10px !important;
}
#filed-vc.vc-persistent-dock-active .vc-screen-card video {
    display: block !important;
    width: 100% !important;
    max-height: 26px !important;
    object-fit: contain !important;
}
#filed-vc.vc-persistent-dock-active .vc-recordings { display: none !important; }
#filed-vc.vc-persistent-dock-active .vc-audio { display: none !important; }
body.vc-dock-open #page { padding-bottom: 144px !important; }
@media (max-width: 760px) {
    #filed-vc.vc-persistent-dock-active .chat-document-toolbar { padding-right: 7px !important; padding-left: 7px !important; }
    #filed-vc.vc-persistent-dock-active .vc-main {
        gap: 3px 7px !important;
        padding: 3px 7px 4px !important;
    }
    #filed-vc.vc-persistent-dock-active .vc-toolbar {
        flex: 1 1 60% !important;
        min-width: 140px !important;
        max-width: 100% !important;
        gap: 4px !important;
    }
    #filed-vc.vc-persistent-dock-active .vc-people {
        flex: 0 1 38% !important;
        min-width: 90px !important;
    }
    #filed-vc.vc-persistent-dock-active .vc-screens { max-height: 36px !important; }
    #filed-vc.vc-persistent-dock-active .vc-screen-card { max-height: 33px !important; }
    #filed-vc.vc-persistent-dock-active .vc-screen-card video { max-height: 19px !important; }
    body.vc-dock-open #page { padding-bottom: 144px !important; }
}


/* Filed 1.2.32: the persistent VC dock uses only the space its visible content needs. */
#filed-vc.vc-persistent-dock-active {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9000 !important;
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 3px 9px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border: 1px solid var(--links-rule, #333333) !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    background: var(--links-bg, #111111) !important;
    box-shadow: 0 -3px 10px rgba(0, 0, 0, .24) !important;
}
#filed-vc.vc-persistent-dock-active .chat-document-toolbar {
    display: flex !important;
    flex: 0 1 auto !important;
    align-items: center !important;
    gap: 5px !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 7px 0 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-right: 1px solid var(--links-rule, #333333) !important;
    box-sizing: border-box !important;
}
#filed-vc.vc-persistent-dock-active .chat-document-toolbar .text-document-meta {
    display: flex !important;
    flex: 0 1 auto !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    min-width: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
}
#filed-vc.vc-persistent-dock-active .chat-document-toolbar strong {
    flex: 0 0 auto !important;
    margin: 0 !important;
    font-size: 10px !important;
    line-height: 16px !important;
}
#filed-vc.vc-persistent-dock-active .chat-document-path {
    display: block !important;
    max-width: 18vw !important;
    margin: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 9px !important;
    line-height: 14px !important;
}
#filed-vc.vc-persistent-dock-active #vc-status {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: 22vw !important;
    margin: 0 0 0 auto !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 9px !important;
    line-height: 14px !important;
}
#filed-vc.vc-persistent-dock-active .vc-main {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 7px !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    background: transparent !important;
}
#filed-vc.vc-persistent-dock-active .vc-toolbar {
    order: 1 !important;
    display: flex !important;
    flex: 0 1 auto !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    gap: 3px 5px !important;
    min-width: 0 !important;
    max-width: 58vw !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    scrollbar-width: thin !important;
    border: 0 !important;
}
#filed-vc.vc-persistent-dock-active .vc-toolbar button {
    flex: 0 0 auto !important;
    min-height: 22px !important;
    margin: 0 !important;
    padding: 2px 6px !important;
    font-size: 9px !important;
    line-height: 16px !important;
    white-space: nowrap !important;
}
#filed-vc.vc-persistent-dock-active .vc-divider {
    flex: 0 0 1px !important;
    height: 14px !important;
    margin: 0 1px !important;
}
#filed-vc.vc-persistent-dock-active .vc-people {
    order: 2 !important;
    display: flex !important;
    flex: 1 1 130px !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    gap: 5px !important;
    min-width: 0 !important;
    max-width: 44vw !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
}
#filed-vc.vc-persistent-dock-active .vc-people[hidden] { display: none !important; }
#filed-vc.vc-persistent-dock-active .vc-people h3 {
    flex: 0 0 auto !important;
    margin: 0 !important;
    font-size: 9px !important;
    line-height: 14px !important;
    white-space: nowrap !important;
}
#filed-vc.vc-persistent-dock-active #vc-people-list {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    gap: 3px !important;
    min-width: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    scrollbar-width: thin !important;
}
#filed-vc.vc-persistent-dock-active .vc-person {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    gap: 3px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 1px 3px !important;
    font-size: 9px !important;
    line-height: 13px !important;
    white-space: nowrap !important;
}
#filed-vc.vc-persistent-dock-active .vc-dot {
    width: 5px !important;
    height: 5px !important;
    flex: 0 0 5px !important;
}
#filed-vc.vc-persistent-dock-active .vc-person-state { font-size: 8px !important; }
#filed-vc.vc-persistent-dock-active .vc-note {
    order: 3 !important;
    display: block !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 20vw !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    color: var(--links-muted, #888888) !important;
    font-size: 8px !important;
    line-height: 12px !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}
#filed-vc.vc-persistent-dock-active .vc-note:empty { display: none !important; }
#filed-vc.vc-persistent-dock-active .vc-screens {
    order: 4 !important;
    display: flex !important;
    flex: 0 1 130px !important;
    flex-flow: row nowrap !important;
    gap: 4px !important;
    min-width: 0 !important;
    max-width: 18vw !important;
    max-height: 28px !important;
    margin: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
}
#filed-vc.vc-persistent-dock-active .vc-screens:empty { display: none !important; }
#filed-vc.vc-persistent-dock-active .vc-screen-card {
    display: flex !important;
    flex: 0 0 82px !important;
    flex-direction: column !important;
    min-width: 0 !important;
    max-height: 26px !important;
    padding: 1px 3px !important;
}
#filed-vc.vc-persistent-dock-active .vc-screen-label {
    flex: 0 0 auto !important;
    padding: 0 !important;
    font-size: 7px !important;
    line-height: 8px !important;
}
#filed-vc.vc-persistent-dock-active .vc-screen-card video {
    display: block !important;
    width: 100% !important;
    max-height: 16px !important;
    object-fit: contain !important;
}
#filed-vc.vc-persistent-dock-active .vc-recordings,
#filed-vc.vc-persistent-dock-active .vc-audio { display: none !important; }
body.vc-dock-open #page { padding-bottom: var(--vc-dock-space, 0px) !important; }
@media (max-width: 760px) {
    #filed-vc.vc-persistent-dock-active { gap: 5px !important; padding: 3px 5px !important; }
    #filed-vc.vc-persistent-dock-active .chat-document-toolbar { padding-right: 5px !important; }
    #filed-vc.vc-persistent-dock-active .chat-document-path { display: none !important; }
    #filed-vc.vc-persistent-dock-active #vc-status { max-width: 24vw !important; font-size: 8px !important; }
    #filed-vc.vc-persistent-dock-active .vc-main { gap: 5px !important; }
    #filed-vc.vc-persistent-dock-active .vc-toolbar { flex: 0 1 62% !important; max-width: 62% !important; gap: 3px !important; }
    #filed-vc.vc-persistent-dock-active .vc-toolbar button { padding: 2px 4px !important; font-size: 8px !important; }
    #filed-vc.vc-persistent-dock-active .vc-people { flex: 1 1 80px !important; max-width: 38% !important; gap: 3px !important; }
    #filed-vc.vc-persistent-dock-active .vc-people h3 { font-size: 8px !important; }
    #filed-vc.vc-persistent-dock-active .vc-person-state { display: none !important; }
}


/* Filed 1.2.33: account-level username color override. */
.account-name-color-form { display:flex; align-items:center; flex-wrap:wrap; gap:9px 14px; }
.account-name-color-choice { display:flex; align-items:center; gap:10px; }
.account-name-color-choice input[type="color"] { width:48px; height:32px; padding:2px; border:1px solid #555; background:#202020; cursor:pointer; }
.account-name-color-enable { display:flex; align-items:center; gap:7px; }
.account-name-color-form button { flex:0 0 auto; }

/* Filed 1.2.35: absolute paths in text previews navigate within Filed. */
.text-document-path-link { color: #9bbcff; text-decoration: underline; text-underline-offset: 2px; }
.text-document-path-link:hover { color: #c5a8ff; }

/* Automatic JS Audio failover status; no extra playback button is shown. */
.chat-reaction-button {
    display:inline-flex; align-items:center; gap:3px; margin:0; padding:2px 6px; color:#ccc;
    background:#202020; border:1px solid #444; border-radius:0; font:11px/1.3 ui-monospace,SFMono-Regular,Consolas,monospace; cursor:pointer;
}
.chat-reaction-button.chat-reaction-mine { color:#eee; background:#2a2530; border-color:#8c78a4; }
.chat-reaction-button:hover { background:#303030; border-color:#888; }
.chat-reaction-button:disabled { opacity:.55; cursor:wait; }
.chat-document-panel .chat-reaction-button { color:#ccc; background:#202020; border-color:#444; }
.chat-document-panel .chat-reaction-button.chat-reaction-mine { color:#eee; background:#2a2530; border-color:#8c78a4; }
#chat-app .chat-reactions button.chat-reaction-mine { color:#eee; background:#2a2530; border-color:#8c78a4; }

/* Filed 1.2.44: make the embedded transcript a definite scrollport on older
   flexbox implementations, so its history loader receives real scroll events. */
.chat-active-file-table .chat-document-panel {
    height:74vh !important;
    max-height:760px !important;
    min-height:420px !important;
    overflow:visible !important;
}
.chat-active-file-table .chat-document-panel .chat-action-area,
.chat-active-file-table .chat-document-panel .chat-document-toolbar,
.chat-active-file-table .chat-document-panel .chat-compose {
    flex:0 0 auto !important;
}
.chat-active-file-table .chat-document-panel .chat-transcript-wrap {
    display:flex !important;
    flex:1 1 0px !important;
    width:100% !important;
    height:0 !important;
    min-height:0 !important;
    max-height:none !important;
    overflow:hidden !important;
}
.chat-active-file-table .chat-document-panel #chat-messages.chat-transcript {
    display:block !important;
    flex:1 1 0px !important;
    width:100% !important;
    height:100% !important;
    min-height:0 !important;
    max-height:none !important;
    overflow-x:hidden !important;
    overflow-y:scroll !important;
    overscroll-behavior-y:contain;
    -webkit-overflow-scrolling:touch;
    box-sizing:border-box !important;
}
@media (max-width:700px) {
    .chat-active-file-table .chat-document-panel {
        height:70vh !important;
        max-height:none !important;
        min-height:360px !important;
    }
}
@media (max-height:560px) {
    .chat-active-file-table .chat-document-panel {
        height:calc(100vh - 180px) !important;
        min-height:300px !important;
    }
}
.chat-history-sentinel {
    display:block;
    width:100%;
    height:1px;
    min-height:1px;
    margin:0;
    padding:0;
    pointer-events:none;
}

/* Legacy layout fallback for browsers without flexbox/inset support.
   The later flex declarations below enhance this in current browsers. */
.chat-profile-overlay {
    top:0 !important; right:0 !important; bottom:0 !important; left:0 !important;
    display:block;
    overflow:auto;
    text-align:center;
}
.chat-profile-card {
    display:inline-block !important;
    vertical-align:middle;
    width:560px !important;
    max-width:94% !important;
    margin:5vh auto !important;
    text-align:left;
}

/* The About Me viewer is presented as a small Filed text-file window. */
.chat-profile-overlay {
    position:fixed !important;
    inset:0 !important;
    z-index:10050 !important;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:16px !important;
    box-sizing:border-box;
    background:rgba(0,0,0,.88) !important;
}
.chat-profile-card {
    display:flex !important;
    flex-direction:column !important;
    width:560px !important;
    max-width:calc(100vw - 32px) !important;
    max-height:82vh !important;
    margin:0 !important;
    padding:0 !important;
    overflow:hidden !important;
    box-sizing:border-box !important;
    color:#ddd !important;
    background:#111 !important;
    border:1px solid #4a4a4a !important;
    border-left:3px solid #777 !important;
    border-radius:0!important;
    box-shadow:0 14px 44px rgba(0,0,0,.8) !important;
}
.chat-profile-card .chat-profile-head {
    display:flex !important;
    align-items:center !important;
    gap:12px !important;
    padding:14px 15px !important;
    background:#181818 !important;
    border-bottom:1px solid #383838 !important;
}
.chat-profile-avatar {
    display:flex;
    flex:0 0 43px;
    align-items:center;
    justify-content:center;
    width:43px;
    height:43px;
    box-sizing:border-box;
    color:#e5e5e5;
    background:#292929;
    border:1px solid #666;
    font:700 18px/1 ui-monospace,SFMono-Regular,Consolas,monospace;
}
.chat-profile-card .chat-profile-identity {
    display:flex !important;
    flex:1 1 auto !important;
    flex-direction:column !important;
    gap:3px !important;
    min-width:0 !important;
}
.chat-profile-card .chat-profile-kicker {
    color:#929292 !important;
    font:9px/1.3 ui-monospace,SFMono-Regular,Consolas,monospace !important;
    letter-spacing:.14em !important;
}
.chat-profile-card .chat-profile-head strong {
    color:#eee !important;
    font:700 16px/1.25 ui-monospace,SFMono-Regular,Consolas,monospace !important;
    overflow-wrap:anywhere;
}
.chat-profile-account-id {
    color:#777;
    font:9px/1.3 ui-monospace,SFMono-Regular,Consolas,monospace;
    letter-spacing:.08em;
}
.chat-profile-card .chat-profile-head > .quiet-button {
    flex:0 0 auto;
    margin-left:4px;
    padding:6px 10px !important;
    color:#ddd !important;
    background:#242424 !important;
    border:1px solid #555 !important;
    border-radius:0!important;
}
.chat-profile-filebar {
    display:flex;
    align-items:center;
    gap:9px;
    min-height:39px;
    padding:5px 14px;
    box-sizing:border-box;
    background:#131313;
    border-bottom:1px solid #333;
}
.chat-profile-file-icon {
    display:inline-block;
    padding:3px 5px;
    color:#bbb;
    background:#242424;
    border:1px solid #555;
    font:700 9px/1.2 ui-monospace,SFMono-Regular,Consolas,monospace;
}
.chat-profile-file-name {
    color:#ddd;
    font:700 10px/1.3 ui-monospace,SFMono-Regular,Consolas,monospace;
    letter-spacing:.06em;
}
.chat-profile-file-kind {
    margin-left:auto;
    color:#777;
    font:9px/1.3 ui-monospace,SFMono-Regular,Consolas,monospace;
    text-align:right;
}
.chat-profile-card .chat-profile-section {
    display:flex;
    flex-direction:column;
    min-height:0;
    padding:13px 14px !important;
}
.chat-profile-card .chat-profile-section h3 {
    margin:0 0 9px !important;
    color:#c4c4c4 !important;
    font:700 10px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace !important;
    letter-spacing:.12em;
}
.chat-profile-card .chat-profile-aboutme {
    display:block;
    width:100%;
    min-height:110px;
    max-height:48vh !important;
    margin:0 !important;
    padding:13px !important;
    overflow:auto !important;
    box-sizing:border-box;
    color:#ddd !important;
    background:#090909 !important;
    border:1px solid #383838 !important;
    border-left:2px solid #777 !important;
    font:12px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace !important;
    white-space:pre-wrap;
    overflow-wrap:anywhere;
}
.chat-profile-footer {
    display:flex;
    justify-content:space-between;
    gap:10px;
    padding:7px 14px;
    color:#777;
    background:#151515;
    border-top:1px solid #333;
    font:9px/1.3 ui-monospace,SFMono-Regular,Consolas,monospace;
    letter-spacing:.07em;
}
@media (max-width:560px) {
    .chat-profile-overlay { padding:8px !important; }
    .chat-profile-card { max-width:calc(100vw - 16px) !important; max-height:88vh !important; }
    .chat-profile-card .chat-profile-head { padding:11px !important; }
    .chat-profile-filebar { padding-right:10px; padding-left:10px; }
    .chat-profile-card .chat-profile-section { padding:10px !important; }
    .chat-profile-card .chat-profile-aboutme { max-height:58vh !important; padding:10px !important; }
}


/* Filed 1.2.44: reliable scrolling and upgraded profile viewer */
html body #page .chat-active-file-table .chat-document-panel {
    display:flex !important;
    flex-direction:column !important;
    height:74vh !important;
    max-height:760px !important;
    min-height:360px !important;
    overflow:hidden !important;
    box-sizing:border-box !important;
}
html body .chat-page #page { height:100vh !important; height:100dvh !important; overflow:hidden !important; }
html body .chat-page .chat-document-panel {
    display:flex !important;
    flex:1 1 auto !important;
    flex-direction:column !important;
    width:100% !important;
    height:auto !important;
    max-height:100% !important;
    min-height:0 !important;
    overflow:hidden !important;
    box-sizing:border-box !important;
}
html body #page .chat-active-file-table .chat-document-panel .chat-document-toolbar,
html body #page .chat-active-file-table .chat-document-panel .chat-action-area,
html body #page .chat-active-file-table .chat-document-panel .chat-compose,
html body .chat-page .chat-document-panel .chat-document-toolbar,
html body .chat-page .chat-document-panel .chat-action-area,
html body .chat-page .chat-document-panel .chat-compose {
    flex:0 0 auto !important;
    min-height:0 !important;
}
html body #page .chat-active-file-table .chat-document-panel .chat-transcript-wrap,
html body .chat-page .chat-document-panel .chat-transcript-wrap {
    display:flex !important;
    flex:1 1 0px !important;
    width:100% !important;
    height:0 !important;
    min-height:0 !important;
    max-height:none !important;
    overflow:hidden !important;
}
html body #page .chat-active-file-table .chat-document-panel #chat-messages.chat-transcript,
html body .chat-page .chat-document-panel #chat-messages.chat-transcript {
    display:block !important;
    flex:1 1 0px !important;
    width:100% !important;
    height:100% !important;
    min-height:0 !important;
    max-height:none !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    overscroll-behavior-y:contain;
    -webkit-overflow-scrolling:touch;
    touch-action:pan-y;
    box-sizing:border-box !important;
}
.chat-history-sentinel { display:block; width:100%; height:1px; min-height:1px; margin:0; padding:0; pointer-events:none; }
.chat-history-loading {
    padding:4px 0 8px;
    color:#999;
    background:#111;
    font:10px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace;
    text-align:center;
}
@media (max-width:700px) {
    html body #page .chat-active-file-table .chat-document-panel { height:70vh !important; max-height:none !important; min-height:320px !important; }
}
@media (max-height:560px) {
    html body #page .chat-active-file-table .chat-document-panel { height:calc(100vh - 170px) !important; min-height:260px !important; }
}

/* Compact About Me window: account + roles, followed directly by the bio. */
html body #page .chat-profile-overlay {
    position:fixed !important;
    inset:0 !important;
    z-index:10050 !important;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:16px !important;
    box-sizing:border-box !important;
    background:rgba(0,0,0,.84) !important;
}
html body #page .chat-profile-card {
    display:flex !important;
    flex-direction:column !important;
    width:520px !important;
    max-width:calc(100vw - 32px) !important;
    max-height:82vh !important;
    margin:0 !important;
    padding:0 !important;
    overflow:hidden !important;
    box-sizing:border-box !important;
    color:#ddd !important;
    background:#101010 !important;
    border:1px solid #505050 !important;
    border-radius:0!important;
    box-shadow:0 10px 34px rgba(0,0,0,.72) !important;
}
html body #page .chat-profile-card .chat-profile-head {
    display:flex !important;
    align-items:center !important;
    gap:12px !important;
    padding:11px 13px !important;
    background:#181818 !important;
    border-bottom:1px solid #383838 !important;
}
html body #page .chat-profile-card .chat-profile-identity {
    display:flex !important;
    flex:1 1 auto !important;
    flex-direction:column !important;
    gap:6px !important;
    min-width:0 !important;
}
html body #page .chat-profile-card .chat-profile-title {
    min-width:0 !important;
    color:#eee;
    font:700 16px/1.25 ui-monospace,SFMono-Regular,Consolas,monospace !important;
    overflow-wrap:anywhere;
}
html body #page .chat-profile-card .chat-profile-roles {
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:4px;
    min-width:0;
}
html body #page .chat-profile-card .chat-profile-roles:empty { display:none; }
html body #page .chat-profile-card .chat-profile-roles .chat-role-badge {
    margin:0;
    padding:1px 5px;
    font-size:9px;
    line-height:1.3;
}
html body #page .chat-profile-card .chat-profile-roles .chat-role-icon { width:14px; height:14px; }
html body #page .chat-profile-card .chat-profile-head > .quiet-button {
    flex:0 0 auto !important;
    margin-left:4px !important;
    padding:5px 10px !important;
    color:#ddd !important;
    background:#242424 !important;
    border:1px solid #555 !important;
    border-radius:0!important;
}
html body #page .chat-profile-card .chat-profile-head > .quiet-button:hover {
    color:#fff !important;
    background:#303030 !important;
    border-color:#888 !important;
}
html body #page .chat-profile-card .chat-profile-section {
    display:flex !important;
    flex:1 1 auto !important;
    flex-direction:column !important;
    min-height:0 !important;
    padding:12px 13px 13px !important;
}
html body #page .chat-profile-card .chat-profile-section h3 {
    display:flex !important;
    align-items:center !important;
    gap:9px !important;
    margin:0 0 8px !important;
    color:#aaa !important;
    font:700 10px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace !important;
    letter-spacing:.1em !important;
}
html body #page .chat-profile-card .chat-profile-section h3:after {
    content:"";
    height:1px;
    flex:1 1 auto;
    background:#353535;
}
html body #page .chat-profile-card .chat-profile-aboutme {
    display:block !important;
    width:100% !important;
    min-height:86px !important;
    max-height:58vh !important;
    margin:0 !important;
    padding:11px !important;
    overflow:auto !important;
    box-sizing:border-box !important;
    color:#ddd !important;
    background:#090909 !important;
    border:1px solid #383838 !important;
    border-left:2px solid #777 !important;
    border-radius:0!important;
    font:12px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace !important;
    white-space:pre-wrap !important;
    overflow-wrap:anywhere !important;
}
/* Alice (account 1) receives the same animated pink/blue shine as her Root name. */
html body #page .chat-profile-card.chat-profile-owner {
    border:1px solid transparent !important;
    background:linear-gradient(#101010,#101010) padding-box,
               linear-gradient(100deg,#ff77c8 0%,#e947a8 28%,#77aaff 68%,#b7a0ff 100%) border-box !important;
    background-size:auto,220% 100% !important;
    background-position:0 0,0 50% !important;
    box-shadow:0 0 5px rgba(255,91,190,.42),0 0 10px rgba(91,151,255,.3),0 10px 34px rgba(0,0,0,.72) !important;
    animation:filed-profile-border-shimmer 4.8s ease-in-out infinite alternate;
}
@keyframes filed-profile-border-shimmer {
    from { background-position:0 0,0 50%; }
    to { background-position:0 0,100% 50%; }
}
@media (prefers-reduced-motion:reduce) {
    html body #page .chat-profile-card.chat-profile-owner { animation:none !important; }
    html body #page .chat-profile-card .chat-profile-title.chat-root-name { animation:none !important; }
}
@media (max-width:560px) {
    html body #page .chat-profile-overlay { padding:8px !important; }
    html body #page .chat-profile-card { width:100% !important; max-width:calc(100vw - 16px) !important; max-height:88vh !important; }
    html body #page .chat-profile-card .chat-profile-head { padding:10px !important; }
    html body #page .chat-profile-card .chat-profile-section { padding:10px !important; }
    html body #page .chat-profile-card .chat-profile-aboutme { max-height:65vh !important; padding:10px !important; }
}


/* Filed 1.2.47: file paths are simple highlighted links in chat and About Me. */
.chat-message-body .chat-file-path-link,
.chat-profile-aboutme .chat-file-path-link,
.chat-message-body .chat-inline-link,
.chat-profile-aboutme .chat-inline-link {
    color:#b9a2d6 !important;
    text-decoration:underline !important;
    text-decoration-thickness:1px;
    text-underline-offset:2px;
    overflow-wrap:anywhere;
}
.chat-message-body .chat-file-path-link:hover,
.chat-profile-aboutme .chat-file-path-link:hover,
.chat-message-body .chat-inline-link:hover,
.chat-profile-aboutme .chat-inline-link:hover {
    color:#e2d5f2 !important;
}
.chat-file-path-pending { color:inherit; }
.folder-owner-label {
    display:inline-block;
    margin:2px 0 2px 8px;
    padding:1px 5px;
    color:#aaa;
    background:#171717;
    border:1px solid #393939;
    font:9px/1.35 ui-monospace,SFMono-Regular,Consolas,monospace;
    vertical-align:middle;
}
.folder-owners-help { margin:10px 0 14px; }
.folder-owners-table td:first-child { overflow-wrap:anywhere; }
.folder-owners-table td:last-child { white-space:nowrap; }

/* A simpler About Me window: account/roles header, then plain bio text. */
html body #page .chat-profile-card .chat-profile-section {
    display:block !important;
    flex:1 1 auto !important;
    min-height:0 !important;
    padding:10px 13px 13px !important;
}
html body #page .chat-profile-card .chat-profile-aboutme {
    display:block !important;
    width:100% !important;
    min-height:0 !important;
    max-height:58vh !important;
    margin:0 !important;
    padding:0 !important;
    overflow:auto !important;
    box-sizing:border-box !important;
    color:#d0d0d0 !important;
    background:transparent !important;
    border:0 !important;
    font:12px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace !important;
    white-space:pre-wrap !important;
    overflow-wrap:anywhere !important;
}
@media (max-width:560px) {
    html body #page .chat-profile-card .chat-profile-section { padding:9px 10px 11px !important; }
    html body #page .chat-profile-card .chat-profile-aboutme { max-height:65vh !important; }
}

/* 1.2.53: ownership is a normal file-list field, not a badge beside the filename. */
.file-table .file-owner-col {
    width:112px;
    max-width:112px;
    color:#999;
    font-size:11px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
html body #page .file-table th.file-owner-col,
html body #page .file-table td.file-owner-col { width:112px !important; }
@media screen and (max-width:700px) {
    .file-table th.file-owner-col,
    .file-table td.file-owner-col { font-size:10px; }
}
@media screen and (max-width:420px) {
    .file-table th.file-owner-col,
    .file-table td.file-owner-col { width:82px !important; max-width:82px; }
}

/* External files can be dropped onto the current folder, a writable folder row, or a breadcrumb. */
.file-table.external-upload-target,
.file-row.external-upload-target td,
.parent-row.external-upload-target td,
.breadcrumb-drop.external-upload-target {
    outline:2px dashed #8fbd9b !important;
    outline-offset:-3px;
    background:#1c2b20 !important;
}

/* Dragging a Filed file into the chat composer attaches the existing server file. */
.chat-document-panel #chat-compose.chat-drag-over {
    border-color:#9bc7a5 !important;
    outline:1px dashed #9bc7a5;
    outline-offset:2px;
}

/* ChatFile is a separate workspace below the ordinary file list. Keep all sizing
   inside this panel and give the transcript a definite flex scrollport (including old WebKit). */
.chat-file-open-panel {
    display:block;
    clear:both;
    width:100%;
    max-width:100%;
    min-width:0;
    margin:14px 0 8px;
    box-sizing:border-box;
}
.chat-file-open-panel > .chat-document-panel {
    display:flex !important;
    flex-direction:column !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    min-height:360px !important;
    height:74vh !important;
    max-height:760px !important;
    margin:0 !important;
    overflow:hidden !important;
    box-sizing:border-box !important;
    border:1px solid #444;
    background:#202020;
}
.chat-file-open-panel .chat-document-toolbar,
.chat-file-open-panel .chat-action-area,
.chat-file-open-panel .chat-compose {
    flex:0 0 auto !important;
    min-height:0 !important;
}
.chat-file-open-panel .chat-transcript-wrap {
    display:flex !important;
    flex:1 1 0px !important;
    width:100% !important;
    height:0 !important;
    min-width:0 !important;
    min-height:0 !important;
    max-height:none !important;
    overflow:hidden !important;
}
.chat-file-open-panel #chat-messages.chat-transcript {
    display:block !important;
    flex:1 1 0px !important;
    width:100% !important;
    height:100% !important;
    min-width:0 !important;
    min-height:0 !important;
    max-height:none !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    overscroll-behavior-y:contain;
    -webkit-overflow-scrolling:touch;
    touch-action:pan-y;
    box-sizing:border-box !important;
}
@media (max-width:700px) {
    .chat-file-open-panel { margin-top:10px; }
    .chat-file-open-panel > .chat-document-panel { height:70vh !important; max-height:none !important; min-height:320px !important; }
}
@media (max-height:560px) {
    .chat-file-open-panel > .chat-document-panel { height:calc(100vh - 170px) !important; min-height:260px !important; }
}

/* Account color editor: compact, square-edged controls in the existing Filed style. */
.account-theme-group { min-width:0; margin:12px 0 0; padding:10px 0 0; border:0; border-top:1px solid var(--filed-ui-border-soft); }
.account-theme-group legend { padding:0 8px 0 0; color:var(--filed-ui-muted); font-size:12px; }
.account-theme-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:8px 18px; }
.account-theme-color { display:flex; align-items:center; justify-content:space-between; gap:10px; min-width:0; padding:4px 0; color:var(--filed-ui-text); font-size:12px; }
.account-theme-color-control { display:flex; align-items:center; gap:7px; flex:0 0 auto; }
.account-theme-color input[type="color"] { width:38px; height:26px; padding:1px; background:var(--filed-ui-surface); border:1px solid var(--filed-ui-border); cursor:pointer; }
.account-theme-color code { min-width:62px; color:var(--filed-ui-muted); font-size:11px; }
.account-theme-preview { display:flex; align-items:center; flex-wrap:wrap; gap:9px 16px; margin:14px 0 8px; padding:12px; border:1px solid var(--filed-ui-border); background:var(--filed-ui-surface); color:var(--filed-ui-text); }
.account-theme-preview strong { flex-basis:100%; }
.account-theme-preview span { font-size:12px; }
.account-theme-preview a { color:var(--filed-ui-link); text-decoration:underline; }
.account-theme-preview button { padding:5px 9px; color:var(--filed-ui-text); background:var(--filed-ui-control); border:1px solid var(--filed-ui-border); cursor:pointer; }
.account-theme-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.account-theme-actions button { margin:0; }
@media (max-width:560px) { .account-theme-grid { grid-template-columns:minmax(0,1fr); } }

/* Per-account palette hooks. These rules intentionally target only color
   properties so changing colors never alters Filed's familiar layout. */
body, #page { background-color:var(--theme-page-bg,#111111) !important; color:var(--theme-text,#dddddd) !important; }
a { color:var(--theme-link,#9bbcff) !important; }
a:visited { color:var(--theme-visited,#b9a2d6) !important; }
a:hover { color:var(--theme-link-hover,#c5d8ff) !important; }
.path, .small, .file-table .file-size-col, .file-table .file-date-col,
.account-identity span, .chat-message-head, .chat-status, .filed-video-status { color:var(--theme-muted,#888888) !important; }
th { color:var(--theme-table-heading,#888888) !important; border-color:var(--theme-subtle-border,#444444) !important; }
td, .chat-message, .chat-message-group { border-color:var(--theme-divider,#292929) !important; }
.tools, .file-browser-top, .file-toolbar, .share-link-form,
.chat-header, .chat-files, .chat-main, .chat-layout { border-color:var(--theme-subtle-border,#333333) !important; }
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea,
#chat-compose, #chat-emoji-search, #chat-server-search {
    background-color:var(--theme-input-bg,#080808) !important;
    color:var(--theme-text,#dddddd) !important;
    border-color:var(--theme-border,#555555) !important;
}
button:not(.chat-profile-name), .button, input.button, .chat-toolbar button, .filed-video-button,
.vc-toolbar button, .chat-tool-button {
    background-color:var(--theme-button-bg,#252525) !important;
    color:var(--theme-text,#dddddd) !important;
    border-color:var(--theme-border,#555555) !important;
}
button:not(.chat-profile-name):hover, .button:hover, input.button:hover, .chat-toolbar button:hover,
.filed-video-button:hover, .vc-toolbar button:hover, .chat-tool-button:hover {
    background-color:var(--theme-button-hover,#303030) !important;
}
input:focus, select:focus, textarea:focus, button:not(.chat-profile-name):focus-visible { outline-color:var(--theme-accent,#8db8ff) !important; border-color:var(--theme-accent,#8db8ff) !important; }
.error, .danger-action { color:var(--theme-error,#ff9999) !important; }
.good, .text-editor-status, .text-editor-saved-note { color:var(--theme-success,#a8dfa8) !important; }
.warning, .is-dirty { color:var(--theme-warning,#d8b875) !important; }
.context-menu, .chat-notification-panel, #chat-emoji-picker, .chat-server-picker,
.chat-sound-picker, .stream-controls, .filed-video-controls, .vc-screen-card {
    background-color:var(--theme-raised-bg,#1b1b1b) !important;
    border-color:var(--theme-border,#555555) !important;
}
.file-table tbody tr:hover td, .more-button:hover, .context-menu .menu-action:hover,
.context-menu .menu-action-button:hover, .chat-online-user:hover {
    background-color:var(--theme-row-hover,#171717) !important;
}
.chat-mention { color:var(--theme-mention-text,#a9c7ff) !important; background-color:var(--theme-mention-bg,#28384d) !important; }
#chat-notification-count { background-color:var(--theme-notification,#bd4e5b) !important; }
.chat-file-path-link, .chat-message-body a, .voice-file-action-link { color:var(--theme-link,#9bbcff) !important; }
.chat-file-path-link:hover, .chat-message-body a:hover, .voice-file-action-link:hover { color:var(--theme-link-hover,#c5d8ff) !important; }
.chat-reply-quote { border-left-color:var(--theme-quote-accent,#7897c5) !important; }
.file-row.drop-target td, .path a.drop-target { background-color:var(--theme-drop-bg,#26392b) !important; border-color:var(--theme-drop-border,#79b889) !important; }
.file-row.folder-drop-target td { background-color:var(--theme-drop-bg,#26392b) !important; border-top:2px solid var(--theme-drop-border,#79b889) !important; border-bottom:2px solid var(--theme-drop-border,#79b889) !important; box-shadow:inset 0 1px 0 var(--theme-drop-border,#79b889),inset 0 -1px 0 var(--theme-drop-border,#79b889); }
.upload-progress-track, .chat-progress-track { background-color:var(--theme-panel-bg,#181818) !important; border-color:var(--theme-border,#555555) !important; }
.upload-progress-bar, .chat-progress-bar, .stream-progress-bar, .chat-page #chat-upload-bar { background-color:var(--theme-link,#9bbcff) !important; }
::selection { background:var(--theme-selection-bg,#2c3e63) !important; color:var(--theme-selection-text,#ffffff) !important; }
code, kbd, samp { color:var(--theme-code-text,#cccccc) !important; }
.filed-video-player, .filed-video-frame, .filed-video-frame video, .chat-video-embed,
.chat-video-preview, .chat-attachment .chat-video-embed { background-color:var(--theme-media-bg,#000000) !important; }

/* Chat multi-attachment queue and dismissible reply target */
#chat-reply-banner.chat-reply-quote { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.chat-reply-cancel,.chat-pending-file-remove { flex:0 0 auto; min-width:24px; padding:1px 6px; margin-left:8px; border:1px solid #555; border-radius:0; background:#181818; color:#bbb; cursor:pointer; }
.chat-pending-file-row { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:2px 0; }
.chat-pending-file-row + .chat-pending-file-row { border-top:1px solid #383838; }


/* Filed 1.2.67: truncate role tags only; preserve usernames and profile role lists. */
html body #page .chat-message-head {
    display:flex !important;
    flex-wrap:nowrap !important;
    align-items:center !important;
    min-width:0 !important;
    max-width:100% !important;
    overflow:visible !important;
    white-space:nowrap !important;
}
html body #page .chat-message-head > .chat-profile-name,
html body #page .chat-message-head > .chat-user-name,
html body #page .chat-message-head > strong {
    flex:0 0 auto !important;
    min-width:max-content !important;
    max-width:none !important;
    overflow:visible !important;
    text-overflow:clip !important;
    white-space:nowrap !important;
}
html body #page .chat-message-head > .chat-avatar {
    flex:0 0 auto !important;
}
html body #page .chat-message-head > .chat-message-time {
    flex:0 0 auto !important;
    white-space:nowrap !important;
}
html body #page .chat-role-list {
    display:inline-flex !important;
    flex:0 0 auto !important;
    flex-wrap:wrap !important;
    align-items:center !important;
    gap:4px !important;
    min-width:0 !important;
    max-width:none !important;
    overflow:visible !important;
    white-space:normal !important;
    text-overflow:clip !important;
    vertical-align:middle !important;
}
html body #page .chat-message-head > .chat-role-list,
html body #page .chat-online-user > .chat-role-list {
    display:block !important;
    flex:0 1 auto !important;
    min-width:0 !important;
    max-width:none !important;
    overflow:hidden !important;
    white-space:nowrap !important;
    text-overflow:ellipsis !important;
}
html body #page .chat-role-list .chat-role-badge {
    display:inline-flex !important;
    flex:0 0 auto !important;
    align-items:center !important;
    max-width:none !important;
    white-space:nowrap !important;
    vertical-align:middle !important;
}
html body #page .chat-role-list .chat-role-label {
    white-space:nowrap !important;
}
html body #page .chat-online-user {
    display:flex !important;
    flex-wrap:nowrap !important;
    align-items:center !important;
    min-width:0 !important;
    max-width:100% !important;
    overflow:visible !important;
    white-space:nowrap !important;
}
html body #page .chat-online-user > .chat-online-dot,
html body #page .chat-online-user > .chat-avatar {
    flex:0 0 auto !important;
}
html body #page .chat-online-user > .chat-online-name {
    flex:0 0 auto !important;
    min-width:max-content !important;
    max-width:none !important;
    overflow:visible !important;
    text-overflow:clip !important;
    white-space:nowrap !important;
}
html body #page .chat-profile-card .chat-profile-roles {
    display:flex !important;
    flex-wrap:wrap !important;
    align-items:center !important;
    width:100% !important;
    min-width:0 !important;
    overflow:visible !important;
    white-space:normal !important;
    text-overflow:clip !important;
}
html body #page .chat-profile-card .chat-profile-roles > .chat-role-list {
    display:inline-flex !important;
    flex:0 1 auto !important;
    flex-wrap:wrap !important;
    width:auto !important;
    min-width:0 !important;
    max-width:none !important;
    overflow:visible !important;
    white-space:normal !important;
    text-overflow:clip !important;
}

/* Clickable path crumbs in headers */
.path-current { color: inherit; }
.text-editor-path a, .chat-document-path a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.text-editor-path, .chat-document-path { overflow-wrap: anywhere; }

/* Custom top-bar hyperlinks */
.create-hyperlink { opacity: .8; font-style: italic; }
.account-hyperlink-form { display: grid; gap: 8px; max-width: 460px; }
.account-hyperlink-form label { display: grid; gap: 3px; }
.account-hyperlink-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; }

/* Chat markdown */
.chat-message-body strong { font-weight: 700; }
.chat-message-body del { text-decoration: line-through; opacity: .8; }
.chat-md-code-inline { padding: 0 4px; background: #1d1d1d; border: 1px solid #2c2c2c; border-radius: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92em; }
.chat-md-code-block { display: block; margin: 4px 0; padding: 7px 10px; background: #0c0c0c; border: 1px solid #2c2c2c; border-radius: 0; overflow-x: auto; white-space: pre; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92em; }
.chat-md-quote { margin: 3px 0; padding: 1px 0 1px 9px; border-left: 3px solid #666; color: #b9b3c0; }
.chat-md-h1 { font-size: 1.35em; font-weight: 700; margin: 4px 0 2px; }
.chat-md-h2 { font-size: 1.18em; font-weight: 700; margin: 3px 0 2px; }
.chat-md-h3 { font-size: 1.05em; font-weight: 700; margin: 2px 0; }
.chat-md-li { padding-left: 1.1em; text-indent: -.8em; }


/* Filed 1.2.72: same-session split browser and live hyperlink path suggestions. */
.account-hyperlink-form datalist { display: none; }
.filed-split-shell { width: 100%; }
.filed-split-panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; width: 100%; }
.filed-split-pane { display: flex; flex-direction: column; min-width: 0; border: 1px solid #333; }
.filed-split-pane iframe { display: block; width: 100%; height: calc(100vh - 110px); min-height: 320px; border: 0; background: #090909; }
@media screen and (max-width: 780px) {
  .filed-split-panes { grid-template-columns: minmax(0, 1fr); }
  .filed-split-pane iframe { height: 62vh; min-height: 300px; }
}

/* ==========================================================================
   Consistency pass: one flat, square, link-style look everywhere.
   - No rounded corners anywhere (every border-radius is 0).
   - Every action control is a plain underlined link, exactly like "Upload files" and "Log out".
     The doubled #page id outranks every earlier per-page override.
   ========================================================================== */
*, *::before, *::after { border-radius: 0 !important; }

html body #page#page .button,
html body #page#page input.button,
html body #page#page button.button,
html body #page#page a.button,
html body #page#page .button-link,
html body #page#page .more-button,
html body #page#page #chat-send,
html body #page#page input[type=submit],
html body #page#page input[type=button],
html body #page#page input[type=reset],
html body #page#page .upload-submit,
html body #page#page .admin-shell button,
html body #page#page .admin-shell .button,
html body #page#page .account-shell button,
html body #page#page .soundboard-shell button,
html body #page#page .role-files-shell button,
html body #page#page .context-menu .menu-action-button {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: var(--theme-link, var(--links-link, #9bbcff)) !important;
    padding: 2px 0 !important;
    margin: 0 10px 0 0;
    min-width: 0;
    min-height: 0;
    font-family: inherit;
    font-size: inherit;
    font-weight: normal;
    line-height: inherit;
    text-decoration: underline;
    text-align: left;
    cursor: pointer;
}
html body #page#page .button:hover,
html body #page#page input.button:hover,
html body #page#page button.button:hover,
html body #page#page a.button:hover,
html body #page#page .button-link:hover,
html body #page#page .more-button:hover,
html body #page#page #chat-send:hover,
html body #page#page input[type=submit]:hover,
html body #page#page input[type=button]:hover,
html body #page#page input[type=reset]:hover,
html body #page#page .upload-submit:hover,
html body #page#page .admin-shell button:hover,
html body #page#page .admin-shell .button:hover,
html body #page#page .account-shell button:hover,
html body #page#page .soundboard-shell button:hover,
html body #page#page .role-files-shell button:hover,
html body #page#page .context-menu .menu-action-button:hover {
    background: transparent !important;
    color: var(--theme-link-hover, var(--links-link-hover, #ffffff)) !important;
    text-decoration: underline;
}
html body #page#page .button:disabled,
html body #page#page button:disabled,
html body #page#page input[type=submit]:disabled,
html body #page#page .is-disabled {
    color: #666666 !important;
    text-decoration: none;
    cursor: default;
    opacity: 1;
}
html body #page#page .danger-action,
html body #page#page .context-menu .menu-action-button.danger-action { color: var(--theme-error, #e07a7a) !important; }
html body #page#page button.more-button,
html body #page#page .admin-shell button.more-button,
html body #page#page button.more-button:hover { font-weight: bold; text-decoration: none; margin: 0; padding: 2px 8px !important; }
/* The native "Choose file" button inside file inputs reads as a link too. */
html body #page#page input[type=file]::file-selector-button {
    background: transparent; border: 0; border-radius: 0; padding: 2px 8px 2px 0; margin: 0;
    color: var(--theme-link, var(--links-link, #9bbcff)); font: inherit; text-decoration: underline; cursor: pointer;
}

/* PDF attachments in chat: the box grows with the viewer instead of overflowing onto later messages. */
.chat-attachment.chat-attachment-pdf { max-height: none; overflow: hidden; }
.chat-page .chat-attachment.chat-attachment-pdf,
.chat-document-panel .chat-attachment.chat-attachment-pdf { max-width: min(640px, 100%); max-height: none; }
.chat-attachment .chat-pdf-embed { display: block; width: 100%; height: 420px; max-height: 70vh; border: 1px solid #555555; background: #202020; }

/* A link-style action that follows a field or label in the same row gets a gap on its left. */
html body #page#page :is(label, input, select, textarea, span) + :is(button, input[type=submit], input[type=button], .button),
html body #page#page :is(label, input, select, textarea, span) + .more-button { margin-left: 12px; }
html body #page#page .item-menu-wrap > button.more-button { margin-left: 0; }

/* Log out sits right next to Split view: cancel most of the nav gap between them. */
html body #page .file-browser-nav .split-view-link + form { margin-left: -8px; }

/* Account: custom notification sounds */
.account-notification-sounds-form { display:flex; flex-direction:column; gap:12px; align-items:flex-start; max-width:560px; }
.account-notification-sounds-form input[type="search"] { width:100%; }
.notification-sound-slot { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px 8px; align-items:center; width:100%; }
.notification-sound-slot label { grid-column:1 / -1; }
.notification-sound-slot select { min-width:0; width:100%; }

/* Video player: overlay controls, hands-free behaviours */
.filed-vplayer { position: relative; }
.filed-vframe { position: relative; user-select: none; -webkit-user-select: none; outline: none; }
.filed-vframe.is-idle { cursor: none; }
.filed-vframe.is-idle .filed-vbar, .filed-vframe.is-idle .filed-vchip { opacity: 0; pointer-events: none; }
.filed-vplayer:fullscreen, .filed-vplayer:-webkit-full-screen { background: #000000; display: flex; flex-direction: column; justify-content: center; width: 100vw; height: 100vh; max-width: none; }
.filed-vplayer:fullscreen .filed-vframe, .filed-vplayer:-webkit-full-screen .filed-vframe { height: 100% !important; max-height: none !important; }
.filed-vbar { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 6px; background: linear-gradient(to top, rgba(0,0,0,0.88), rgba(0,0,0,0)); color: #ffffff; transition: opacity 0.25s ease; z-index: 3; }
.filed-vrow { display: flex; align-items: center; gap: 2px; min-width: 0; }
.filed-vspacer { flex: 1 1 auto; }
.filed-vplayer button.filed-vbtn { background: transparent !important; border: 0 !important; color: #ffffff !important; width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; opacity: 0.92; }
.filed-vplayer button.filed-vbtn:hover, .filed-vplayer button.filed-vbtn:focus-visible { background: rgba(255,255,255,0.16) !important; opacity: 1; }
.filed-vplayer button.filed-vtext { width: auto; min-width: 40px; padding: 0 8px; font: 600 13px system-ui, sans-serif; }
.filed-vbtn svg { width: 22px; height: 22px; fill: currentColor; }
.filed-vtime { font: 12px/1 ui-monospace, monospace; color: #e8e8e8; white-space: nowrap; margin: 0 8px; }
.filed-vcache { font: 11px/1 system-ui, sans-serif; color: #9fd3ff; white-space: nowrap; margin: 0 6px; opacity: 0.9; cursor: default; }
.filed-vvolume { width: 70px; margin: 0 4px; accent-color: var(--theme-accent, #8db8ff); }
.filed-vtl { position: relative; height: 18px; cursor: pointer; touch-action: none; margin: 0 2px 4px; }
.filed-vtl::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 4px; background: rgba(255,255,255,0.28); transition: height 0.12s ease, top 0.12s ease; }
.filed-vtl:hover::before, .filed-vframe.is-scrubbing .filed-vtl::before { top: 5px; height: 8px; }
.filed-vtl-buffer, .filed-vtl-played { position: absolute; left: 0; top: 7px; height: 4px; width: 0; transition: height 0.12s ease, top 0.12s ease; }
.filed-vtl:hover .filed-vtl-buffer, .filed-vtl:hover .filed-vtl-played, .filed-vframe.is-scrubbing .filed-vtl-buffer, .filed-vframe.is-scrubbing .filed-vtl-played { top: 5px; height: 8px; }
.filed-vtl-buffer { background: rgba(255,255,255,0.4); }
.filed-vtl-played { background: var(--theme-accent, #8db8ff); }
.filed-vtl-thumb { position: absolute; top: 3px; width: 12px; height: 12px; margin-left: -6px; background: var(--theme-accent, #8db8ff); transform: scale(0); transition: transform 0.12s ease; pointer-events: none; }
.filed-vtl:hover .filed-vtl-thumb, .filed-vtl:focus-visible .filed-vtl-thumb, .filed-vframe.is-scrubbing .filed-vtl-thumb { transform: scale(1); }
.filed-vtl-tip { position: absolute; bottom: 22px; transform: translateX(-50%); background: rgba(0,0,0,0.85); color: #ffffff; font: 12px ui-monospace, monospace; padding: 2px 6px; pointer-events: none; white-space: nowrap; }
.filed-vbig { position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; background: rgba(0,0,0,0.55) !important; border: 0 !important; color: #ffffff !important; display: none; align-items: center; justify-content: center; cursor: pointer; z-index: 2; padding: 0; }
.filed-vbig svg { width: 36px; height: 36px; fill: currentColor; }
.filed-vframe.is-paused .filed-vbig { display: flex; }
.filed-vframe.is-loading .filed-vbig { display: none; }
.filed-vspinner { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; display: none; z-index: 2; pointer-events: none; }
.filed-vspinner img { display: block; width: 100%; height: 100%; object-fit: contain; animation: filed-vspin 1.1s linear infinite; filter: drop-shadow(0 0 5px rgba(0,0,0,0.75)); }
.filed-vframe.is-loading .filed-vspinner { display: block; }
@keyframes filed-vspin { to { transform: rotate(360deg); } }
.filed-vchip { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,0.7); color: #ffffff; font: 12px system-ui, sans-serif; padding: 4px 8px; z-index: 3; transition: opacity 0.25s ease; pointer-events: none; }
.filed-vtoast { position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,0.82); color: #ffffff; font: 13px system-ui, sans-serif; padding: 7px 12px; z-index: 4; max-width: 90%; }
.filed-vtoast-action { background: transparent !important; border: 1px solid rgba(255,255,255,0.5) !important; color: #ffffff !important; padding: 2px 9px; cursor: pointer; font: 600 12px system-ui, sans-serif; }
.filed-vupnext { position: absolute; right: 12px; bottom: 78px; width: 250px; max-width: calc(100% - 24px); background: rgba(0,0,0,0.88); color: #ffffff; padding: 12px; z-index: 5; border: 1px solid rgba(255,255,255,0.25); }
.filed-vupnext-label { font: 12px system-ui, sans-serif; color: #cccccc; margin-bottom: 4px; }
.filed-vupnext-title { font: 600 14px system-ui, sans-serif; margin-bottom: 10px; overflow-wrap: anywhere; }
.filed-vupnext-buttons { display: flex; gap: 8px; }
.filed-vupnext-button { background: transparent !important; border: 1px solid rgba(255,255,255,0.5) !important; color: #ffffff !important; padding: 5px 12px; cursor: pointer; font: 600 12px system-ui, sans-serif; }
.filed-vupnext-button:first-child { background: var(--theme-accent, #8db8ff) !important; border-color: var(--theme-accent, #8db8ff) !important; color: #000000 !important; }
.filed-vmenu { position: absolute; right: 10px; bottom: 74px; width: 290px; max-width: calc(100% - 20px); background: rgba(16,16,16,0.96); color: #ffffff; padding: 8px 12px; z-index: 5; border: 1px solid rgba(255,255,255,0.2); font: 13px system-ui, sans-serif; }
.filed-vmenu-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; cursor: pointer; }
.filed-vmenu-row select { max-width: 130px; }
.filed-vmenu-help { margin: 8px 0 2px; font-size: 11px; line-height: 1.5; color: #aaaaaa; }
@media (max-width: 600px) { .filed-vcache { display: none !important; } .filed-vvolume { display: none; } .filed-vtime { margin: 0 4px; } .filed-vplayer button.filed-vbtn { width: 32px; } }
.filed-vframe video.preview { max-height: none; max-width: none; }


/* Filed 1.2.86: cached shared-storage usage in the topbar. */
.filed-storage-usage { display:inline-block; color:#999; font-size:11px; white-space:nowrap; margin-left:4px; }

/* Filed 1.2.89: shared storage analysis page and compact ranked usage bars. */
.storage-page { width:100%; max-width:1120px; margin:0 auto; }
.filed-storage-panel { margin-top:24px; padding-top:14px; border-top:1px solid #333; width:100%; max-width:none; }
.filed-storage-panel h2 { font-size:16px; margin:18px 0 12px; }
.filed-storage-summary { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; margin:14px 0 20px; }
.filed-storage-stat { border:1px solid var(--filed-ui-border,#383838); padding:10px 12px; background:var(--filed-ui-surface,#111); min-width:0; }
.filed-storage-stat .label { display:block; color:var(--filed-ui-muted,#888); font-size:11px; text-transform:uppercase; letter-spacing:.04em; }
.filed-storage-stat strong { display:block; margin-top:5px; font-size:20px; font-weight:600; color:var(--filed-ui-text,#ddd); overflow-wrap:anywhere; }
.filed-storage-bar { display:block; width:100%; height:5px; margin-top:5px; background:#242424; overflow:hidden; }
.filed-storage-bar > span { display:block; height:100%; background:var(--theme-accent,#8db8ff); }
.filed-storage-table .storage-size { white-space:nowrap; color:var(--filed-ui-muted,#999); }
.filed-storage-table .storage-path { overflow-wrap:anywhere; }
.filed-storage-usage-link { text-decoration:underline; text-underline-offset:2px; }
@media (max-width:640px) { .filed-storage-summary { grid-template-columns:repeat(2,minmax(0,1fr)); } .filed-storage-stat strong { font-size:17px; } }

/* ==========================================================================
   Filed 1.2.90: one core design everywhere.
   The homepage look is the reference: charcoal page, Arial, hairline rules
   instead of cards, underlined links instead of filled buttons, square
   corners, no drop shadows. This block brings the late additions (video
   player, storage page, chat video placeholder, small chat buttons) in line.
   ========================================================================== */

/* No drop shadows on floating surfaces; a hairline border separates them.
   (Alice's profile shimmer is a deliberate exception and keeps its glow.) */
*:not(.chat-profile-owner), *:not(.chat-profile-owner)::before, *:not(.chat-profile-owner)::after { box-shadow: none !important; }

/* Chat video: nothing loads until it is clicked, so the placeholder is a plain link on black. */
html body #page#page .chat-video-load {
    position: absolute; inset: 0; box-sizing: border-box; width: 100%; height: 100%; margin: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 10px; background: #000000 !important; border: 1px solid var(--theme-subtle-border, #333333) !important;
    color: var(--theme-link, #9bbcff) !important; font: inherit; text-align: center; text-decoration: none; cursor: pointer;
}
html body #page#page .chat-video-load:hover, html body #page#page .chat-video-load:focus-visible {
    background: #000000 !important; border-color: var(--theme-border, #555555) !important; color: var(--theme-link-hover, #ffffff) !important;
}
.chat-video-load-icon { font-size: 18px; letter-spacing: 1px; }
.chat-video-load-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline; }
.chat-video-load-hint { color: var(--theme-muted, #888888); font-size: 12px; }

/* Video player: same type and the same link-style actions as the rest of the site. */
.filed-vbar { background: rgba(0,0,0,0.78); padding: 20px 10px 6px; }
.filed-vtime, .filed-vtl-tip { font-family: inherit; }
.filed-vchip, .filed-vtoast, .filed-vupnext-label, .filed-vupnext-title, .filed-vmenu, .filed-vupnext-button, .filed-vtoast-action,
.filed-vplayer button.filed-vtext { font-family: inherit; font-weight: normal; }
.filed-vtoast-action, .filed-vupnext-button, .filed-vupnext-button:first-child {
    background: transparent !important; border: 0 !important; padding: 2px 0 !important;
    color: var(--theme-link, #9bbcff) !important; text-decoration: underline; font-size: 13px;
}
.filed-vtoast-action:hover, .filed-vupnext-button:hover { color: var(--theme-link-hover, #ffffff) !important; }
.filed-vupnext, .filed-vmenu { border-color: #333333; background: rgba(0,0,0,0.92); }
.filed-vbig { background: rgba(0,0,0,0.6) !important; border: 1px solid rgba(255,255,255,0.35) !important; }

/* Small chat buttons are links, not boxes. */
html body #page#page .chat-reply-cancel, html body #page#page .chat-pending-file-remove,
html body #page#page .chat-document-panel .chat-message-actions-inline button {
    background: transparent !important; border: 0 !important; padding: 2px 0 !important; min-width: 0;
    color: var(--theme-link, #9bbcff) !important; text-decoration: underline; font: inherit; cursor: pointer;
}
html body #page#page .chat-reply-cancel:hover, html body #page#page .chat-pending-file-remove:hover,
html body #page#page .chat-document-panel .chat-message-actions-inline button:hover { color: var(--theme-link-hover, #ffffff) !important; }

/* Storage page: ranked rows under hairlines, not boxed stat cards. */
.filed-storage-summary { gap: 0 24px; }
.filed-storage-stat { border: 0; border-top: 1px solid var(--theme-subtle-border, #333333); background: transparent; padding: 9px 0; }
.filed-storage-stat .label { text-transform: none; letter-spacing: 0; font-size: 12px; }
.filed-storage-stat strong { font-size: 14px; font-weight: normal; margin-top: 3px; }
.filed-storage-panel h2 { font-size: 14px; font-weight: normal; color: var(--theme-muted, #888888); }
.filed-storage-bar { height: 3px; background: #242424; }

/* Filed 1.2.92: diagnostics page. Same flat look: hairline rules, one accent colour, no cards. */
.filed-storage-panel h1 { font-size: 18px; font-weight: normal; margin: 0 0 6px; }
.filed-storage-panel h2 { margin: 26px 0 10px; }
.diag-bars { display: flex; align-items: flex-end; gap: 2px; height: 110px; border-bottom: 1px solid var(--theme-subtle-border, #333333); }
.diag-bars-days { height: 60px; gap: 1px; }
.diag-bar { flex: 1 1 0; min-width: 0; background: var(--theme-accent, #8db8ff); opacity: 0.55; }
.diag-bar-peak { opacity: 1; }
.diag-axis { display: flex; gap: 2px; margin-top: 4px; color: var(--theme-muted, #888888); font-size: 11px; }
.diag-axis span { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: visible; }
.diag-heat { border-collapse: separate; border-spacing: 2px; width: 100%; table-layout: fixed; }
.diag-heat th { color: var(--theme-muted, #888888); font-size: 11px; font-weight: normal; text-align: left; padding: 0; white-space: nowrap; overflow: visible; }
.diag-heat th.diag-heat-day { width: 34px; }
.diag-heat-cell { height: 18px; padding: 0; background: var(--theme-accent, #8db8ff); }
.diag-fun .filed-storage-stat strong { overflow-wrap: anywhere; }
.diag-fun .filed-storage-stat .label + strong + .label { margin-top: 2px; }
@media (max-width: 640px) { .diag-heat-cell { height: 14px; } .diag-heat th.diag-heat-day { width: 28px; } }

/* Filed 1.2.92: diagnostics is a full-screen dashboard: a stats strip on top, then three columns of cards. */
html body.diag-wide { margin: 0; padding: 12px 20px 32px; box-sizing: border-box; min-height: 100vh; }
html body.diag-wide #page#page { width: 100%; max-width: none; margin: 0; }
html body.diag-wide .storage-page.diag-page { max-width: none; width: 100%; margin: 0; }
.diag-page .filed-storage-panel { margin-top: 0; padding-top: 0; border-top: 0; }
.diag-page .filed-storage-panel h1 { margin: 4px 0 14px; font-size: 22px; }
.diag-kpis.filed-storage-summary { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 0 0 16px; }
.diag-kpis .filed-storage-stat { padding: 12px 14px; background: var(--theme-panel-bg, #171717); border: 1px solid var(--theme-subtle-border, #2c2c2c); }
.diag-kpis .filed-storage-stat strong { font-size: 22px; margin-top: 4px; }
.diag-columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.diag-col { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.diag-card { min-width: 0; padding: 14px 16px 12px; background: var(--theme-panel-bg, #171717); border: 1px solid var(--theme-subtle-border, #2c2c2c); }
.filed-storage-panel .diag-card h3 { margin: 0 0 10px; font-size: 14px; font-weight: normal; color: var(--theme-text, #dddddd); }
.diag-card th, .diag-card td { padding: 6px 8px 6px 0; }
.diag-card th:last-child, .diag-card td:last-child { padding-right: 0; }
.diag-page .diag-bars { height: 200px; }
.diag-page .diag-bars-days { height: 140px; }
.diag-page .diag-heat-cell { height: 30px; }
.diag-fun-group + .diag-fun-group { margin-top: 18px; }
.diag-fun-group h3 { margin: 0 0 6px; font-size: 12px; font-weight: normal; color: var(--theme-muted, #888888); text-transform: uppercase; letter-spacing: .05em; }
.diag-fun-grid.filed-storage-summary { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 20px; margin: 0; }
@media (min-width: 900px) {
  .diag-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diag-col-fun { grid-column: 1 / -1; }
  .diag-col-fun .diag-fun-grid.filed-storage-summary { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
@media (min-width: 1400px) {
  .diag-columns { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.9fr); }
  .diag-col-fun { grid-column: auto; }
  .diag-col-fun .diag-fun-grid.filed-storage-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  html body.diag-wide { padding: 8px 10px 24px; }
  .diag-kpis.filed-storage-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diag-page .diag-bars { height: 140px; }
  .diag-page .diag-heat-cell { height: 18px; }
}

/* Persisted voice call logs inside the Diagnostics page. */
.diag-voice-log { margin-top: 16px; }
.diag-voice-log-head { display:flex; align-items:baseline; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.diag-page .diag-voice-log-head h3 { margin:0 0 10px; font-size:14px; font-weight:normal; color:var(--theme-text,#ddd); }
.diag-voice-summary { display:flex; flex-wrap:wrap; gap:8px 22px; margin:2px 0 12px; color:var(--theme-muted,#888); font-size:11px; }
.diag-voice-summary strong { color:var(--theme-text,#ddd); font-weight:600; font-variant-numeric:tabular-nums; }
.diag-voice-scroll { max-width:100%; overflow-x:auto; border-top:1px solid var(--theme-subtle-border,#333); }
.diag-voice-table { width:100%; min-width:760px; border-collapse:collapse; table-layout:auto; }
.diag-voice-table th { color:var(--theme-muted,#888); font-size:11px; font-weight:normal; text-align:left; white-space:nowrap; }
.diag-voice-table td { border-top:1px solid var(--theme-subtle-border,#292929); color:var(--theme-text,#ddd); font-size:11px; vertical-align:top; }
.diag-voice-time { white-space:nowrap; color:var(--theme-muted,#999) !important; font-variant-numeric:tabular-nums; }
.diag-voice-room,.diag-voice-kind { white-space:nowrap; }
.diag-voice-detail { min-width:150px; max-width:460px; overflow-wrap:anywhere; }
.diag-voice-quality { min-width:210px; color:var(--theme-muted,#aaa) !important; }
.diag-voice-note { margin:10px 0 0; color:var(--theme-muted,#888); font-size:10px; }
@media (max-width:640px) { .diag-voice-log { padding:10px; } .diag-voice-summary { gap:6px 14px; } }

/* Filed 1.2.88: admin-chosen Filed icon in the top bar and the Site icons admin panel. */
.filed-site-icon-link { display:inline-block; vertical-align:middle; margin:0 8px 0 0; line-height:0; text-decoration:none; }
.filed-site-icon { width:20px; height:20px; object-fit:contain; vertical-align:middle; border:0; }
.site-icon-row { display:flex; align-items:center; flex-wrap:wrap; gap:12px; padding:10px 0; border-bottom:1px solid var(--border,#444); }
.site-icon-preview-wrap { width:40px; height:40px; display:flex; align-items:center; justify-content:center; }
.admin-site-icon-preview { max-width:40px; max-height:40px; object-fit:contain; }
.admin-site-icon-placeholder { color:#888888; font-size:12px; }
.site-icon-name { min-width:180px; flex:1 1 220px; }
.site-icon-form { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:0; }


/* Filed 1.2.97: borderless text-file media and an updating split editor preview. */
.text-document-image,
.text-document-image:focus,
.text-editor-live-document .text-document-image {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}
.text-editor-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    min-width: 0;
    align-items: stretch;
}
.text-editor-source-pane,
.text-editor-preview-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 55vh;
    height: calc(100dvh - 190px);
    border: 1px solid #333;
    background: #080808;
    overflow: hidden;
}
.text-editor-source-pane .text-file-editor-area {
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
    max-height: none;
    resize: none;
    border: 0;
}
.text-editor-preview-heading {
    flex: 0 0 auto;
    padding: 8px 10px;
    color: #999;
    background: #141414;
    border-bottom: 1px solid #333;
    font-size: 11px;
}
.text-editor-preview-pane .text-editor-live-document {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    max-height: none;
    margin: 0;
    border: 0;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.text-editor-preview-status {
    flex: 0 0 auto;
    min-height: 0;
    padding: 0 9px;
    color: #888;
    background: #141414;
    font-size: 10px;
}
.text-editor-preview-status:not(:empty) { padding-top: 4px; padding-bottom: 4px; }
.text-editor-live-document .text-document-image { max-width: 100%; }
.text-editor-live-document .text-document-video { max-width: 100%; }
@media screen and (max-width: 760px) {
    .text-editor-workspace { grid-template-columns: minmax(0, 1fr); }
    .text-editor-source-pane,
    .text-editor-preview-pane {
        height: 48vh;
        min-height: 280px;
    }
}


/* Filed 1.2.100: HaxCat has a dedicated dark-to-light purple username shimmer.
   Identity is selected by the account username in chat.js, not display name or role. */
.chat-document-panel .chat-haxcat-name {
    color:#b68cff !important;
    font-weight:800 !important;
}
@supports ((-webkit-background-clip:text) or (background-clip:text)) and (-webkit-text-fill-color:transparent) {
    .chat-document-panel .chat-message-head .chat-haxcat-name,
    .chat-document-panel .chat-online-user .chat-haxcat-name,
    html body #page .chat-document-panel button.chat-profile-name.chat-haxcat-name:not(.chat-root-name),
    html body #page .chat-profile-card .chat-profile-title.chat-haxcat-name {
        background-image:linear-gradient(100deg,#4c1d95 0%,#7137b8 30%,#c9a6ff 66%,#6d28a8 100%) !important;
        background-size:220% 100% !important;
        background-position:0 50% !important;
        -webkit-background-clip:text !important;
        background-clip:text !important;
        -webkit-text-fill-color:transparent !important;
        color:transparent !important;
        text-shadow:0 0 5px rgba(126,58,196,.58),0 0 12px rgba(192,132,252,.38) !important;
        animation:filed-root-name-shimmer 4.8s ease-in-out infinite alternate;
    }
}
@media (prefers-reduced-motion:reduce) {
    .chat-document-panel .chat-haxcat-name,
    html body #page .chat-profile-card .chat-profile-title.chat-haxcat-name { animation:none !important; }
}

html body .file-toolbar .ops-group.file-paste-form { padding:0 0 0 16px; border-left:1px solid #333; }

/* Operations bar alignment pass: equal-width upload columns, identical sizing on user and admin pages. */
html body .file-toolbar .ops-upload { display:grid; grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); gap:8px 28px; align-items:center; }
html body .file-toolbar .ops-upload > form { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; min-width:0; width:auto; margin:0; padding:0; }
html body .file-toolbar .ops-upload .upload-file-name { flex:1 1 0; min-width:0; max-width:none; }
html body .file-toolbar .ops-upload .file-upload-url input[type="url"] { flex:1 1 0; width:auto; min-width:0; }
html body .file-toolbar .ops-upload .upload-submit { margin-left:auto; min-width:0; padding:4px 0; }
html body .file-toolbar .ops-upload .upload-progress { flex-basis:100%; }
html body .file-toolbar .ops-upload label.upload-picker-link, html body .file-toolbar .ops-upload .file-upload-url-label { font-size:13px; white-space:nowrap; }
html body .file-toolbar .ops-upload .file-upload-url-label { color:#aaa; }
html body .file-toolbar .ops-group button, html body .file-toolbar .ops-group .quiet-button { font-size:13px; }
html body .file-tools, html body .file-tools .small, html body .file-tools .quiet-button, html body .file-tools a { font-size:12px; }
html body .file-tools { display:flex; align-items:center; flex-wrap:wrap; gap:4px 14px; padding:6px 0; }
@media screen and (max-width: 640px) {
    html body .file-toolbar .ops-group:not(.ops-upload) { width:auto; padding:0 14px; border-top:0; border-left:1px solid #333; }
    html body .file-toolbar .ops-group:first-child { padding-left:0; border-left:0; }
    html body .file-toolbar .ops-upload { grid-template-columns:1fr; width:100%; padding-top:10px; border-top:1px solid #292929; }
}
html body .file-toolbar .ops-upload { grid-template-columns:minmax(0,1fr) minmax(0,1.5fr) minmax(0,1fr); }
html body .file-tools .quiet-button, html body .file-tools a { margin:0; padding:0; }
@media screen and (max-width: 900px) { html body .file-toolbar .ops-upload { grid-template-columns:1fr; } }
html body .file-tools > * { margin-left:0 !important; margin-right:0 !important; }

/* Now listening: the song playing in the playlist, shown next to a name in chat. */
.chat-listening { display:inline-block; max-width:260px; margin-left:8px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; vertical-align:bottom; color:#888; font-size:12px; font-weight:normal; }
.chat-listening[hidden] { display:none; }
.chat-online-listening { max-width:200px; margin-left:8px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#888; font-size:11px; font-weight:normal; }


/* Video media folders: show summaries, season navigation and per-episode progress. */
.menu-mark-group { margin: 5px 0 2px; padding: 5px 0 0; border-top: 1px solid #383838; }
.menu-mark-group > .menu-mark-toggle { margin: 0; }
.context-menu .menu-mark-options[hidden] { display: none !important; }
.context-menu .menu-mark-options:not([hidden]) { display: block !important; padding-top: 3px; }
.menu-mark-options .menu-form { margin: 2px 0 0 !important; padding: 3px 0 2px 9px !important; border-top: 0 !important; }
.menu-mark-group .video-season-mark-form input[type=number] { width: 62px; min-width: 62px; max-width: 62px; }
.video-media-dashboard { margin: 14px 0 18px; padding: 12px 0 14px; border-top: 1px solid var(--filed-ui-border, #3b3b3b); border-bottom: 1px solid var(--filed-ui-border, #3b3b3b); }
.video-media-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.video-media-heading h2 { margin: 0; font-size: 19px; font-weight: 650; }
.video-media-count { color: var(--filed-ui-muted, #aaa); font-size: 12px; white-space: nowrap; }
.video-media-overall-track, .video-season-track, .video-episode-progress-track { height: 4px; background: #333; overflow: hidden; }
.video-media-overall-track { margin-top: 10px; }
.video-media-overall-track span, .video-season-track i, .video-episode-progress-track span { display: block; height: 100%; background: #9bbcff; }
.video-season-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 7px; margin-top: 12px; }
.video-season-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 9px; border: 1px solid var(--filed-ui-border, #3b3b3b); color: var(--filed-ui-text, #ddd) !important; text-decoration: none !important; }
.video-season-card:hover { background: var(--filed-ui-control-hover, #222); }
.video-season-card strong { font-size: 13px; }
.video-season-card > span:not(.video-season-track) { color: var(--filed-ui-muted, #999); font-size: 11px; }
.video-season-track { width: 100%; margin-top: 2px; }
.video-media-back { margin: 9px 0 0; font-size: 12px; }
.video-continue-watching { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 12px; font-size: 12px; }
.video-continue-watching > strong { color: var(--filed-ui-muted, #999); font-size: 11px; text-transform: uppercase; }
.video-continue-watching a { display: inline-flex; flex-direction: column; gap: 2px; color: var(--filed-ui-link, #9bbcff); }
.video-continue-watching a span { color: var(--filed-ui-muted, #999); font-size: 10px; }
.video-media-badge { border-color: #56677e !important; color: #b8c9e2 !important; }
.video-episode-progress { display: flex; align-items: center; gap: 7px; max-width: 230px; margin-top: 4px; color: var(--filed-ui-muted, #999); font-size: 10px; }
.video-episode-progress-track { flex: 0 0 66px; }
.video-episode-progress.watched .video-episode-progress-track span { background: #7caa8a; }
@media (max-width: 620px) {
  .video-media-heading { align-items: start; flex-direction: column; gap: 4px; }
  .video-season-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-continue-watching { align-items: start; flex-direction: column; }
}

/* The existing navigation indicator is one solid blue line. Keep the color
   on the loader itself so no animated child or theme color can flash yellow. */
#filed-navigation-loader {
  position: fixed;
  z-index: 100000;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
  background: #9bbcff !important;
  background-color: #9bbcff !important;
  background-image: none !important;
  opacity: 0;
  transition: opacity .12s ease;
}
#filed-navigation-loader.is-loading { opacity: 1; }
#filed-navigation-loader span { display: none !important; }

/* Native PDF and EPUB reader surfaces, styled like the rest of Filed. */
.book-library-dashboard {
  margin: 14px 0 20px;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--filed-ui-divider, #292929);
}
.book-library-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--filed-ui-muted, #999);
  font-size: 12px;
}
.book-library-heading h2 {
  margin: 0;
  color: var(--filed-ui-text, #ddd);
  font-size: 18px;
  font-weight: 600;
}
.book-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}
.book-library-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  padding: 10px 11px;
  border: 1px solid var(--filed-ui-border-soft, #333);
  color: var(--filed-ui-text, #ddd);
  text-decoration: none;
}
.book-library-card:hover { border-color: var(--theme-link, #9bbcff); }
.book-library-card strong { overflow-wrap: anywhere; font-size: 13px; }
.book-library-format {
  color: var(--theme-link, #9bbcff);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}
.book-library-location { color: var(--filed-ui-muted, #999); font-size: 11px; }
.filed-book-reader {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 20px;
}
.filed-book-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--filed-ui-divider, #292929);
  border-bottom: 1px solid var(--filed-ui-divider, #292929);
  font-size: 12px;
}
.filed-book-toolbar > a { white-space: nowrap; }
.filed-book-title { display: flex; min-width: 100px; flex: 1 1 160px; flex-direction: column; gap: 2px; }
.filed-book-title strong { overflow-wrap: anywhere; }
.filed-book-title span { color: var(--filed-ui-muted, #999); }
.filed-book-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.filed-book-controls input { width: 66px; min-width: 0; }
.filed-book-controls select { max-width: min(280px, 48vw); min-width: 110px; }
.filed-book-frame {
  display: block;
  width: 100%;
  height: min(78vh, 1050px);
  min-height: 480px;
  border: 1px solid var(--filed-ui-border, #555);
  background: #111;
}
.filed-book-frame.epub { background: #111; }
@media (max-width: 640px) {
  .filed-book-frame { height: 74vh; min-height: 360px; }
  .filed-book-toolbar { align-items: flex-start; }
  .filed-book-controls { width: 100%; }
}


/* Book reader controls: keep the reader compact and consistent with Filed. */
.filed-book-reader { min-height: 0; }
.filed-book-toolbar { align-items: center; }
.filed-book-title { min-width: 180px; }
.filed-book-title strong { font-size: 14px; }
.filed-book-controls, .filed-book-actions, .filed-book-appearance, .filed-book-search {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.filed-book-controls input { width: 64px; }
.filed-book-controls select, .filed-book-appearance select {
  width: auto; min-width: 76px; max-width: min(170px, 36vw);
}
.filed-book-actions { margin-left: auto; }
.filed-book-reading-tools { justify-content: space-between; gap: 10px 16px; }
.filed-book-search input { width: min(210px, 42vw); min-width: 100px; }
.filed-book-search-status { color: var(--filed-ui-muted, #999); font-size: 11px; }
.filed-book-appearance { font-size: 11px; }
.filed-book-appearance > span { min-width: 34px; text-align: center; color: var(--filed-ui-muted, #999); }
.filed-book-progress { display: flex; align-items: center; gap: 10px; padding: 1px 0 7px; }
.filed-book-progress input { flex: 1; min-width: 0; accent-color: var(--theme-link, #9bbcff); }
.filed-book-progress span { min-width: 38px; color: var(--filed-ui-muted, #999); font-size: 11px; text-align: right; }
.filed-pdf-reader { min-height: 0; }
.filed-pdf-frame { height: min(82vh, 1200px); min-height: 540px; background: #202020; }
.filed-epub-reader:fullscreen, .filed-pdf-reader:fullscreen {
  box-sizing: border-box; width: 100%; height: 100%; min-height: 0; overflow: auto;
  padding: 10px 14px; background: var(--filed-ui-bg, #111);
}
.filed-book-reader:fullscreen .filed-book-frame { flex: 1 1 auto; height: calc(100vh - 150px); max-height: none; min-height: 260px; }
.filed-book-reader button, .filed-book-reader select, .filed-book-reader input { font-size: 12px; }
@media (max-width: 760px) {
  .filed-book-toolbar { align-items: flex-start; }
  .filed-book-title { flex: 1 1 100%; }
  .filed-book-actions { margin-left: 0; }
  .filed-book-reading-tools { align-items: flex-start; }
  .filed-book-appearance { width: 100%; }
  .filed-pdf-frame { height: 76vh; min-height: 420px; }
}


/* 1.2.120: unify file operations and sorting into one compact toolbar. */
html body #page .file-toolbar {
    display:flex !important;
    align-items:center !important;
    flex-wrap:wrap !important;
    gap:4px 0 !important;
    box-sizing:border-box !important;
    padding:6px 8px !important;
    margin:0 0 7px 0 !important;
    border:1px solid #292929 !important;
    border-bottom:1px solid #333 !important;
}
html body #page .file-toolbar .ops-group:not(.ops-upload) {
    display:flex !important;
    align-items:center !important;
    flex:0 0 auto !important;
    flex-wrap:wrap !important;
    gap:4px 8px !important;
    min-height:25px !important;
    width:auto !important;
    box-sizing:border-box !important;
    padding:0 10px !important;
    border:0 !important;
    border-left:1px solid #303030 !important;
}
html body #page .file-toolbar .ops-group:first-child,
html body #page .file-toolbar .ops-group.ops-create {
    padding-left:0 !important;
    border-left:0 !important;
}
html body #page .file-toolbar .ops-group button,
html body #page .file-toolbar .ops-group .quiet-button,
html body #page .file-toolbar .ops-group a {
    font-size:12px !important;
    line-height:1.35 !important;
}
html body #page .file-toolbar .ops-group .button,
html body #page .file-toolbar .ops-group button.button {
    padding:3px 7px !important;
}
html body #page .file-toolbar .ops-sort {
    white-space:nowrap;
}
html body #page .file-toolbar .ops-sort .small {
    color:#888 !important;
    font-size:11px !important;
}
html body #page .file-toolbar .ops-sort a.is-active {
    color:#ddd !important;
    text-decoration:underline !important;
}
html body #page .file-toolbar .ops-upload {
    display:grid !important;
    flex:1 1 100% !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    align-items:center !important;
    gap:6px 14px !important;
    width:100% !important;
    box-sizing:border-box !important;
    margin:4px 0 0 0 !important;
    padding:7px 0 0 0 !important;
    border:0 !important;
    border-top:1px solid #292929 !important;
}
html body #page .file-toolbar .ops-upload > form {
    display:flex !important;
    align-items:center !important;
    flex-wrap:wrap !important;
    gap:4px 7px !important;
    min-width:0 !important;
    width:auto !important;
    margin:0 !important;
    padding:0 !important;
}
html body #page .file-toolbar .ops-upload .file-upload-url-label,
html body #page .file-toolbar .ops-upload label.upload-picker-link {
    font-size:12px !important;
}
html body #page .file-toolbar .ops-upload .upload-file-name {
    flex:1 1 55px !important;
    min-width:0 !important;
    max-width:110px !important;
    font-size:11px !important;
}
html body #page .file-toolbar .ops-upload .file-upload-url input[type="url"] {
    flex:1 1 80px !important;
    width:auto !important;
    min-width:0 !important;
    max-width:none !important;
    padding:4px 6px !important;
    font-size:11px !important;
}
html body #page .file-toolbar .ops-upload .upload-submit {
    flex:0 0 auto !important;
    margin:0 !important;
    padding:3px 7px !important;
}
html body #page .file-toolbar .ops-upload .upload-progress {
    flex:1 0 100% !important;
    min-width:0 !important;
    margin:1px 0 0 0 !important;
}
@media screen and (max-width:900px) {
    html body #page .file-toolbar .ops-upload { grid-template-columns:1fr !important; }
    html body #page .file-toolbar .ops-upload .upload-file-name { max-width:180px !important; }
}
@media screen and (max-width:640px) {
    html body #page .file-toolbar { gap:4px 0 !important; }
    html body #page .file-toolbar .ops-group:not(.ops-upload) { width:auto !important; padding:0 8px !important; }
    html body #page .file-toolbar .ops-group:first-child { padding-left:0 !important; }
    html body #page .file-toolbar .ops-sort { flex-basis:100% !important; padding:4px 0 0 0 !important; border-left:0 !important; }
    html body #page .file-toolbar .ops-upload { padding-top:6px !important; }
}

/* Select-mode Delete button */
.file-selection-bar .danger-button { background:#5a2326; border-color:#7d3034; color:#ffd9d9; }
.file-selection-bar .danger-button:hover:not(:disabled) { background:#74292d; }

/* 1.2.121: user-defined file and folder tags */
.file-table .file-name-cell .file-tag { margin-left: 6px; border-radius: 0; }
html body #page .file-table .file-name-cell .file-tag { color: var(--theme-link, #9bbcff) !important; opacity: .85; }
.tags-form .menu-form-row input[type="text"] { min-width: 0; flex: 1 1 auto; }

/* 1.2.122: song tags, covers and the Library */
.fp-cover { width:48px; height:48px; object-fit:cover; margin-right:10px; vertical-align:middle; border-radius:0; }
.library-artist { margin:22px 0 6px; font-weight:normal; }
.library-albums { list-style:none; margin:0; padding:0; }
.library-albums li { display:flex; align-items:center; gap:12px; padding:6px 0; }
.library-albums li > span { display:flex; flex-direction:column; min-width:0; }
.library-cover { width:48px; height:48px; flex:0 0 48px; object-fit:cover; border-radius:0; }
.library-cover-empty { display:inline-block; border:1px solid var(--border,#30343b); }
.library-cover-large { width:160px; height:160px; flex-basis:160px; }
.library-album-head { display:flex; gap:18px; align-items:flex-end; margin:12px 0 18px; }
.library-album-head h2, .library-album-head p { margin:0 0 6px; }
.library-meta { margin-top:2px; }


/* Per-account wallpaper settings. Keep the preview modest and the form inline. */
.account-wallpaper-preview { display:flex; align-items:center; min-height:72px; margin:8px 0 10px; color:var(--links-muted); font-size:12px; }
.account-wallpaper-preview img { display:block; width:auto; max-width:min(420px,100%); max-height:180px; object-fit:cover; border:1px solid var(--links-rule); }
.account-wallpaper-form { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; }
.account-wallpaper-form label { color:var(--links-text); font-size:12px; }
.account-wallpaper-form input[type=file] { max-width:100%; }
.account-wallpaper-form .small { flex-basis:100%; }
.account-wallpaper-clear-form { margin-top:8px; }


/* Filed 1.2.140: shared meme image library and built-in meme creator and refined emoji picker. */
.meme-maker-shell { max-width: 1120px; }
.meme-maker { border:1px solid #333; background:#151515; padding:14px; }
.meme-maker-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; border-bottom:1px solid #333; padding-bottom:12px; margin-bottom:12px; }
.meme-maker-head h2 { margin:0 0 3px; font-size:19px; }
.meme-maker-head p { margin:0; color:#999; font-size:12px; }
#meme-image { display:none; }
.meme-source-button { display:inline-block; padding:7px 11px; border:1px solid #555; background:#252525; color:#ddd; cursor:pointer; font-size:12px; }
.meme-maker-layout { display:grid; grid-template-columns:minmax(245px,320px) minmax(0,1fr); gap:14px; align-items:start; }
.meme-maker-head-actions { display:flex; flex-wrap:wrap; gap:7px; align-items:center; }
.meme-maker-head-actions a { display:inline-block; padding:7px 10px; border:1px solid #444; color:#aaa; font-size:12px; text-decoration:none; }
.meme-image-library-panel { border:1px solid #303030; background:#101010; padding:10px; margin:0 0 14px; }
.meme-image-library-head { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; color:#bbb; font-size:12px; margin-bottom:9px; }
.meme-image-library-head > div { display:flex; gap:6px; align-items:center; }
#meme-library-search { width:min(240px,48vw); min-width:0; background:#090909; color:#ddd; border:1px solid #444; padding:6px 8px; }
.meme-image-library { display:grid; grid-template-columns:repeat(auto-fill,minmax(105px,1fr)); gap:7px; max-height:260px; overflow:auto; }
.meme-image-card { display:flex; flex-direction:column; gap:5px; min-width:0; padding:5px; background:#171717; border:1px solid #333; color:#bbb; cursor:pointer; text-align:left; }
.meme-image-card:hover, .meme-image-card.is-selected { border-color:#7999c5; background:#202630; }
.meme-image-card img { display:block; width:100%; height:82px; object-fit:contain; background:#090909; }
.meme-image-card span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }
.meme-library-empty, .meme-library-note { color:#777; font-size:11px; }
.meme-library-note { margin:9px 0 0; }

.meme-maker-controls { display:flex; flex-direction:column; gap:10px; min-width:0; }
.meme-maker-controls > label:not(.meme-dropzone):not(.meme-toggle) { display:flex; flex-direction:column; gap:4px; color:#aaa; font-size:12px; }
.meme-maker-controls input[type=text], .meme-maker-controls select { box-sizing:border-box; width:100%; min-width:0; background:#090909; color:#ddd; border:1px solid #484848; padding:7px; }
.meme-dropzone { display:flex; flex-direction:column; justify-content:center; align-items:center; min-height:94px; border:1px dashed #555; background:#101010; color:#bbb; cursor:pointer; text-align:center; gap:4px; }
.meme-dropzone.is-dragging { border-color:#9bbcff; background:#19202b; }
.meme-dropzone-mark { font-size:22px; line-height:1; color:#9bbcff; }
.meme-dropzone small { color:#777; font-size:11px; }
.meme-control-row { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.meme-control-row-single { grid-template-columns:minmax(0,1fr); }
.meme-control-row label { display:flex; flex-direction:column; gap:5px; color:#aaa; font-size:12px; min-width:0; }
.meme-control-row input[type=color] { width:100%; height:31px; box-sizing:border-box; padding:2px; background:#090909; border:1px solid #484848; }
.meme-control-row input[type=range] { width:100%; accent-color:#9bbcff; }
.meme-toggle { display:flex; align-items:center; gap:7px; font-size:12px; color:#bbb; }
.meme-export-actions { display:flex; flex-wrap:wrap; gap:7px; align-items:center; }
.meme-export-actions button { margin:0; }
.meme-maker-status { min-height:18px; margin:0; color:#888; font-size:12px; }
.meme-maker-status.is-error { color:#e38b8b; }
.meme-preview-panel { min-width:0; border:1px solid #303030; background:#0b0b0b; padding:8px; }
.meme-preview-label, .meme-preview-foot { display:flex; justify-content:space-between; gap:8px; color:#777; font-size:11px; }
.meme-preview-label { padding:1px 1px 8px; }
.meme-preview-foot { padding:8px 1px 1px; }
.meme-canvas-wrap { position:relative; display:flex; min-height:280px; max-height:68vh; justify-content:center; align-items:center; overflow:auto; background:repeating-conic-gradient(#161616 0% 25%, #101010 0% 50%) 50% / 18px 18px; }
#meme-canvas { display:block; width:auto; height:auto; max-width:100%; max-height:68vh; object-fit:contain; }
.meme-empty-state { position:absolute; color:#666; font-size:13px; pointer-events:none; }
.chat-emoji-picker-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
#chat-emoji-picker { border:1px solid #3c3c3c; background:#131313; padding:9px; max-height:420px; }
#chat-emoji-search { min-height:34px; border-color:#454545; }
.chat-emoji-categories { flex-wrap:nowrap; overflow-x:auto; padding:3px 0 7px; scrollbar-width:thin; }
.chat-emoji-categories button { flex:0 0 auto; background:#202020; border:1px solid #383838; color:#aaa; padding:5px 8px; }
.chat-emoji-categories button.active { background:#293343; border-color:#7897c5; color:#e5edfa; }
.chat-emoji-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(36px,1fr)); gap:3px; max-height:230px; overflow:auto; padding:2px; }
.chat-emoji-choice { width:100%; min-width:0; min-height:37px; background:#1b1b1b; border:1px solid transparent; color:#ddd; font-family:inherit; font-size:22px; cursor:pointer; }
.chat-emoji-choice:hover, .chat-emoji-choice:focus-visible { background:#2b2b2b; border-color:#777; outline:none; }
.chat-emoji-choice .chat-custom-emoji { width:25px; height:25px; }
@media screen and (max-width:720px) {
  .meme-maker-layout { grid-template-columns:minmax(0,1fr); }
  .meme-maker-controls { display:grid; grid-template-columns:1fr 1fr; }
  .meme-maker-controls .meme-dropzone, .meme-maker-controls .meme-export-actions, .meme-maker-controls .meme-maker-status { grid-column:1 / -1; }
  .meme-maker-controls > label:nth-of-type(1), .meme-maker-controls > label:nth-of-type(2), .meme-maker-controls > .meme-control-row { grid-column:1 / -1; }
  .meme-canvas-wrap { min-height:190px; }
}


/* Filed 1.2.142: Meme creator is available only from the chat utility toolbar. */
.chat-document-panel .chat-meme-picker { min-width:0; }
.chat-document-panel .chat-meme-picker .meme-maker {
    padding:0; border:0; background:transparent; color:var(--links-text, #ddd);
}
.chat-document-panel .chat-meme-picker .meme-maker-head { padding:0 0 8px; margin:0 0 8px; border:0; }
.chat-document-panel .chat-meme-picker .meme-maker-head > div:first-child { display:none; }
.chat-document-panel .chat-meme-picker .meme-image-library-panel { margin-bottom:9px; }
.chat-document-panel .chat-meme-picker .meme-maker-layout { grid-template-columns:minmax(190px, 34%) minmax(0,1fr); gap:9px; }
.chat-document-panel .chat-meme-picker .meme-canvas-wrap { min-height:150px; max-height:40vh; }
.chat-document-panel .chat-meme-picker #meme-canvas { max-height:40vh; }
.chat-document-panel .chat-meme-picker .meme-maker-controls { gap:7px; }
.chat-document-panel .chat-meme-picker .meme-maker-controls > label:not(.meme-dropzone):not(.meme-toggle) { min-width:0; }
@media(max-width:640px) {
    .chat-document-panel .chat-meme-picker .meme-maker-layout { grid-template-columns:minmax(0,1fr); }
    .chat-document-panel .chat-meme-picker .meme-canvas-wrap { min-height:130px; }
}


/* Filed 1.2.145: chat Meme creator opens as a fullscreen composer. */
body.filed-meme-fullscreen-open { overflow: hidden !important; }
#chat-meme-picker.chat-meme-fullscreen {
    display: block !important; position: fixed !important; inset: 0 !important;
    top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important;
    width: 100vw !important; height: 100vh !important; height: 100dvh !important;
    max-width: none !important; max-height: none !important; overflow: auto !important;
    box-sizing: border-box !important; margin: 0 !important;
    padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
             max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)) !important;
    border: 0 !important; border-radius: 0 !important; background: #101010 !important;
    color: #ddd !important; box-shadow: none !important; z-index: 100000 !important;
}
#chat-meme-picker.chat-meme-fullscreen .chat-meme-fullscreen-head {
    position: sticky; top: calc(-1 * max(14px, env(safe-area-inset-top)));
    z-index: 20; display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 12px 0; margin: 0 auto 14px; max-width: 1480px;
    background: #101010; border-bottom: 1px solid #333;
}
.chat-meme-head-actions { display: flex; align-items: center; gap: 8px; }
.chat-meme-head-actions button { margin: 0; }
#chat-meme-picker.chat-meme-fullscreen > .meme-maker {
    max-width: 1480px; margin: 0 auto; padding: 0 0 16px !important;
    border: 0 !important; background: transparent !important;
}
#chat-meme-picker.chat-meme-fullscreen .meme-maker-head > div:first-child { display: none; }
#chat-meme-picker.chat-meme-fullscreen .meme-maker-layout {
    grid-template-columns: minmax(270px, 350px) minmax(0, 1fr); gap: 18px;
}
#chat-meme-picker.chat-meme-fullscreen .meme-image-library { max-height: 210px; }
#chat-meme-picker.chat-meme-fullscreen .meme-canvas-wrap {
    min-height: min(52vh, 620px); max-height: 70vh;
}
#chat-meme-picker.chat-meme-fullscreen #meme-canvas { max-height: 68vh; }
@media (max-width: 760px) {
    #chat-meme-picker.chat-meme-fullscreen .meme-maker-layout { grid-template-columns: minmax(0, 1fr); }
    #chat-meme-picker.chat-meme-fullscreen .meme-maker-controls { display: grid; grid-template-columns: 1fr 1fr; }
    #chat-meme-picker.chat-meme-fullscreen .meme-maker-controls .meme-dropzone,
    #chat-meme-picker.chat-meme-fullscreen .meme-maker-controls .meme-export-actions,
    #chat-meme-picker.chat-meme-fullscreen .meme-maker-controls .meme-maker-status { grid-column: 1 / -1; }
    #chat-meme-picker.chat-meme-fullscreen .meme-canvas-wrap { min-height: 34vh; max-height: 48vh; }
    #chat-meme-picker.chat-meme-fullscreen #meme-canvas { max-height: 46vh; }
}


/* Filed 1.2.146: consistent meme controls and working additional text layers. */
.meme-maker {
    color: var(--links-text, #ddd);
    background: var(--links-bg, #101010);
    border: 1px solid var(--links-rule, #333);
    padding: 14px;
    border-radius: 0;
    box-shadow: none;
}
.meme-maker-head { border-color: var(--links-rule, #333); }
.meme-maker-head h2 { color: var(--links-text, #eee); font-size: 18px; font-weight: 600; }
.meme-maker-head p, .meme-library-note, .meme-library-empty { color: var(--links-muted, #888); }
.meme-maker-controls { gap: 9px; }
.meme-maker-controls label { color: var(--links-muted, #aaa); }
.meme-maker-controls input[type=text],
.meme-maker-controls input[type=search],
.meme-maker-controls select,
#meme-library-search {
    min-height: 34px;
    padding: 6px 8px;
    color: var(--links-text, #ddd);
    background: var(--links-field, #090909);
    border: 1px solid var(--links-rule, #444);
    border-radius: 0;
    box-shadow: none;
}
.meme-maker-controls input:focus,
.meme-maker-controls select:focus,
#meme-library-search:focus {
    outline: 1px solid var(--links-accent, #7899c5);
    outline-offset: 0;
}
.meme-source-button, .meme-maker button, .meme-maker-head-actions a {
    border-radius: 0 !important;
    box-shadow: none !important;
    font-family: inherit;
}
.meme-source-button { color: var(--links-text, #ddd); background: var(--links-field, #202020); border-color: var(--links-rule, #444); }
.meme-image-library-panel, .meme-preview-panel { border-color: var(--links-rule, #333); border-radius: 0; box-shadow: none; }
.meme-image-card { border-radius: 0; background: var(--links-field, #171717); border-color: var(--links-rule, #333); }
.meme-image-card:hover, .meme-image-card.is-selected { border-color: var(--links-accent, #7899c5); background: var(--links-hover, #202630); }
.meme-text-layers { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.meme-text-layers-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--links-muted, #aaa); font-size: 12px; }
.meme-text-layers-head button { margin: 0; padding: 5px 8px; }
.meme-extra-text-list { display: flex; flex-direction: column; gap: 6px; }
.meme-caption-size-control {
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(80px,1.5fr) 22px;
    align-items:center;
    gap:7px;
    min-width:0;
    color:var(--links-muted,#888);
    font-size:11px;
}
.meme-caption-size-control label { margin:0; }
.meme-caption-size-control input[type="range"],
.meme-extra-text-size-control input[type="range"] { width:100%; min-width:0; margin:0; accent-color:var(--theme-accent,var(--links-link,#9bbcff)); }
.meme-caption-size-control output,
.meme-extra-text-size-control output { color:var(--links-muted,#888); font-size:10px; text-align:right; font-variant-numeric:tabular-nums; }

.meme-extra-text-row { display: grid; grid-template-columns: minmax(0, 1fr) 94px auto; gap: 6px; align-items: center; min-width: 0; }
.meme-extra-text-row input, .meme-extra-text-row select { box-sizing: border-box; min-width: 0; width: 100%; }
.meme-extra-text-row .meme-extra-text-remove { padding: 5px 7px; min-height: 34px; }
.meme-extra-text-row button:hover { border-color: var(--links-accent, #7899c5); }
.meme-dropzone { border-radius: 0; }
.meme-canvas-wrap { border: 1px solid var(--links-rule, #333); border-radius: 0; }
.meme-export-actions button { min-height: 34px; }
@media (max-width: 560px) {
    .meme-maker { padding: 10px; }
    .meme-extra-text-row { grid-template-columns: minmax(0, 1fr) 84px; }
    .meme-extra-text-row .meme-extra-text-remove { grid-column: 1 / -1; justify-self: end; }
}

/* ==========================================================================
   Filed 1.2.148 — unified Links UI pass
   Flat surfaces, consistent type scale, compact controls and quiet separators.
   Keep the file browser as the visual reference for every secondary tool.
   ========================================================================== */
:root {
    --links-bg: #111111;
    --links-surface: #141414;
    --links-surface-alt: #181818;
    --links-surface-hover: #202020;
    --links-text: #dddddd;
    --links-muted: #888888;
    --links-subtle: #6f6f6f;
    --links-link: #9bbcff;
    --links-link-hover: #c5d8ff;
    --links-visited: #b9a2d6;
    --links-rule: #333333;
    --links-row-rule: #292929;
    --links-field: #181818;
    --links-button: #252525;
    --links-border: #555555;
    --links-control-height: 32px;
    --links-focus: #9bbcff;
    --links-font: Arial, Helvetica, sans-serif;
    --links-mono: "DejaVu Sans Mono", Menlo, Consolas, monospace;
}

html { background: var(--links-bg); }
body {
    background: var(--links-bg);
    color: var(--links-text);
    font-family: var(--links-font);
    font-size: 14px;
    line-height: 1.45;
}
#page { min-width: 0; }

/* Reuse the file browser's frame and title scale for all app surfaces. */
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .admin-shell,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .account-shell,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .soundboard-shell,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .role-files-shell,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .text-editor-shell,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .vc-shell,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-maker-shell {
    max-width: none;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .admin-shell h1,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .account-shell h1,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .soundboard-shell h1,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .role-files-shell h1,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .text-editor-shell h1,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .vc-shell h1,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .admin-shell h2,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .account-shell h2,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .soundboard-shell h2,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .role-files-shell h2,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .text-editor-shell h2,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .vc-shell h2 {
    color: var(--links-text);
    font-family: var(--links-font);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .admin-shell h3,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .account-shell h3,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .soundboard-shell h3,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .role-files-shell h3,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .text-editor-shell h3,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .vc-shell h3 {
    color: var(--links-text);
    font-family: var(--links-font);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .admin-shell p,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .account-shell p,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .soundboard-shell p,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .role-files-shell p,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .text-editor-shell p,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .vc-shell p { line-height: 1.5; }

/* One control language: square corners, no glow, no heavy shadows. */
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) input[type="text"],
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) input[type="search"],
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) input[type="password"],
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) input[type="email"],
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) input[type="url"],
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) input:not([type]),
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) textarea,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) select {
    min-height: var(--links-control-height);
    box-sizing: border-box;
    border: 1px solid var(--links-border);
    border-radius: 0;
    background: var(--links-field);
    color: var(--links-text);
    box-shadow: none;
    font: 13px/1.35 var(--links-font);
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) input[type="text"]:focus,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) input[type="search"]:focus,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) input[type="password"]:focus,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) input[type="email"]:focus,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) input[type="url"]:focus,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) input:not([type]):focus,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) textarea:focus,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) select:focus {
    outline: 1px dotted var(--links-focus);
    outline-offset: 1px;
    border-color: var(--links-focus);
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) button,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) input.button,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) button.button,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) a.button,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .button-link {
    border-radius: 0;
    box-shadow: none;
    font-family: var(--links-font);
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) button:focus-visible,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) a:focus-visible,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) input:focus-visible,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) select:focus-visible,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) textarea:focus-visible,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) summary:focus-visible {
    outline: 1px dotted var(--links-focus);
    outline-offset: 2px;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) button:disabled,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) input:disabled,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) select:disabled { opacity: .48; cursor: not-allowed; }

/* Common separators and utility panels stay flat and aligned. */
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .admin-toolbar,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .admin-settings,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .account-card,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .account-role-form,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .role-image-settings,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .role-file-create,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .role-file-directory,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .soundboard-item,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .text-editor-header,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .text-editor-toolbar,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .text-editor-footer {
    border-radius: 0;
    box-shadow: none;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .context-menu,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .chat-tool-tray,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .chat-tray,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) #chat-emoji-picker,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .chat-sound-picker,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .chat-server-picker {
    border: 1px solid var(--links-rule);
    border-radius: 0;
    background: var(--links-surface);
    box-shadow: none;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .file-browser-top,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .chat-document-toolbar,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .text-document-toolbar,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .text-editor-toolbar {
    box-shadow: none;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) table.file-table th,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) table.file-table td { border-radius: 0; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) table.file-table tbody tr:hover td { background: #161616; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .small,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .help-text,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .muted,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .field-note { color: var(--links-muted); }

/* Chat and account utility controls follow the same compact rhythm. */
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .chat-action-toolbar,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .text-document-actions,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .chat-toolbar,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .vc-toolbar { gap: 8px; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .chat-action-toolbar button,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .text-document-actions button,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .chat-toolbar button,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .vc-toolbar button {
    min-height: 27px;
    font-size: 12px;
    line-height: 1.25;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .chat-action-toolbar button:hover,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .text-document-actions button:hover,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .chat-toolbar button:hover,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .vc-toolbar button:hover { text-decoration: underline; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .chat-message,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .chat-online-user,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .chat-notification-item { border-radius: 0; box-shadow: none; }

/* Meme creator — same Links visual language, with a clear editing hierarchy. */
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-maker {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--links-text);
    box-shadow: none;
    font-family: var(--links-font);
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-maker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 0 10px;
    margin: 0 0 12px;
    border: 0;
    border-bottom: 1px solid var(--links-rule);
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-maker-title { min-width: 0; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-maker-head h2 {
    margin: 0;
    color: var(--links-text);
    font-size: 14px;
    font-weight: 700;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-maker-head p {
    margin: 3px 0 0;
    color: var(--links-muted);
    font-size: 12px;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-maker-head-actions,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-library-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-source-button {
    display: inline-block;
    padding: 2px 0;
    border: 0;
    background: transparent;
    color: var(--links-link);
    font: 12px/1.4 var(--links-font);
    text-decoration: underline;
    cursor: pointer;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-source-button:hover { color: var(--links-link-hover); }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-image-library-panel {
    margin: 0 0 14px;
    padding: 0 0 10px;
    border: 0;
    border-bottom: 1px solid var(--links-rule);
    background: transparent;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-image-library-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 8px;
    color: var(--links-text);
    font-size: 12px;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-library-title { display: flex; align-items: baseline; gap: 9px; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-library-title strong { color: var(--links-text); font-size: 12px; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-library-title span { color: var(--links-muted); font: 11px var(--links-mono); }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) #meme-library-search {
    width: min(220px, 42vw);
    min-height: 29px;
    padding: 4px 7px;
    font-size: 12px;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-image-library {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 108px));
    gap: 6px;
    max-height: 118px;
    overflow: auto;
    padding: 1px 1px 4px;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-image-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--links-rule);
    border-radius: 0;
    background: transparent;
    color: var(--links-muted);
    text-align: left;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-image-card img {
    display: block;
    width: 100%;
    height: 58px;
    object-fit: contain;
    background: #090909;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-image-card span {
    overflow: hidden;
    font-size: 10px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-image-card:hover,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-image-card.is-selected {
    border-color: var(--links-link);
    background: var(--links-surface-hover);
    color: var(--links-text);
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-library-empty { color: var(--links-muted); font-size: 12px; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-maker-layout {
    display: grid;
    grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-maker-controls {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--links-rule);
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-control-group {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0 12px;
    border-bottom: 1px solid var(--links-rule);
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-control-group-head {
    color: var(--links-text);
    font-size: 12px;
    font-weight: 700;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-maker-controls label {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
    color: var(--links-muted);
    font-size: 11px;
    line-height: 1.3;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-maker-controls input[type="text"],
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-maker-controls select {
    width: 100%;
    min-height: 30px;
    padding: 5px 7px;
    font-size: 12px;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-control-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 9px;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-control-row-single {
    grid-template-columns: minmax(0, 1fr);
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-control-row input[type="range"] {
    width: 100%;
    min-height: 30px;
    margin: 0;
    accent-color: var(--links-link);
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-control-row input[type="color"] {
    width: 100%;
    height: 30px;
    padding: 2px;
    border: 1px solid var(--links-border);
    border-radius: 0;
    background: var(--links-field);
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-text-layers { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-text-layers-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--links-muted);
    font-size: 11px;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-text-layers-head button { margin: 0; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-extra-text-list { display: flex; flex-direction: column; gap: 5px; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-extra-text-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 82px auto;
    align-items: center;
    gap: 5px;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-extra-text-row input,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-extra-text-row select {
    width: 100%;
    min-width: 0;
    min-height: 29px;
    padding: 4px 6px;
    font-size: 11px;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-extra-text-row .meme-extra-text-remove { margin: 0; font-size: 11px; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-caption-size-control {
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(80px,1.5fr) 22px;
    align-items:center;
    gap:7px;
    min-width:0;
    color:var(--links-muted);
    font-size:11px;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-caption-size-control label {
    display:block;
    margin:0;
    color:var(--links-muted);
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-caption-size-control input[type="range"],
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-extra-text-size-control input[type="range"] {
    width:100%;
    min-width:0;
    min-height:20px;
    margin:0;
    padding:0;
    accent-color:var(--theme-accent,var(--links-link));
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-caption-size-control output,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-extra-text-size-control output {
    color:var(--links-muted);
    font-size:10px;
    text-align:right;
    font-variant-numeric:tabular-nums;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-extra-text-size-control {
    display:grid;
    grid-column:1 / -1;
    grid-template-columns:42px minmax(0,1fr) 22px;
    align-items:center;
    gap:7px;
    min-width:0;
    color:var(--links-muted);
    font-size:10px;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-extra-text-size-control input[type="range"] {
    min-height:20px;
}

:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-toggle { display: flex; flex-direction: row !important; align-items: center; gap: 7px; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-toggle input { width: auto; margin: 0; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-export-group { gap: 7px; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-export-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-export-actions button {
    min-height: 27px;
    margin: 0;
    font-size: 12px;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-maker-status { min-height: 16px; margin: 0; color: var(--links-muted); font-size: 11px; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-maker-status.is-error { color: #e38b8b; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-preview-panel {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border: 1px solid var(--links-rule);
    border-radius: 0;
    background: #0d0d0d;
    box-shadow: none;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-preview-label,
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-preview-foot {
    display: flex;
    min-height: 32px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 9px;
    color: var(--links-muted);
    font-size: 11px;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-preview-label { border-bottom: 1px solid var(--links-rule); }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-preview-label strong { color: var(--links-text); font-size: 12px; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-canvas-wrap {
    display: flex;
    min-width: 0;
    min-height: min(54vh, 620px);
    max-height: 72vh;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 10px;
    border: 0;
    background: #080808;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) #meme-canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: 70vh; object-fit: contain; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-empty-state { color: #777; font-size: 12px; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-preview-foot { border-top: 1px solid var(--links-rule); }

/* The chat fullscreen editor inherits the exact same editor layout. */
#chat-meme-picker.chat-meme-fullscreen {
    background: var(--links-bg) !important;
    color: var(--links-text) !important;
}
#chat-meme-picker.chat-meme-fullscreen .chat-meme-fullscreen-head {
    max-width: 1480px;
    padding: 8px 0 10px;
    border-bottom: 1px solid var(--links-rule);
    background: var(--links-bg);
    color: var(--links-text);
}
#chat-meme-picker.chat-meme-fullscreen .chat-meme-fullscreen-head > strong { font-size: 14px; }
#chat-meme-picker.chat-meme-fullscreen .chat-meme-head-actions { gap: 12px; }
#chat-meme-picker.chat-meme-fullscreen > .meme-maker { padding: 0 0 18px !important; }
#chat-meme-picker.chat-meme-fullscreen .meme-maker-head { display: none; }
#chat-meme-picker.chat-meme-fullscreen .meme-image-library { max-height: 112px; }
#chat-meme-picker.chat-meme-fullscreen .meme-canvas-wrap { min-height: min(56vh, 680px); max-height: 72vh; }
#chat-meme-picker.chat-meme-fullscreen #meme-canvas { max-height: 70vh; }

@media (max-width: 820px) {
    :is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-maker-layout { grid-template-columns: minmax(0, 1fr); }
    :is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-maker-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; }
    :is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-control-group { min-width: 0; }
    :is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-export-group { grid-column: 1 / -1; }
    :is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-preview-panel { grid-row: 1; }
    :is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-canvas-wrap { min-height: 38vh; max-height: 52vh; }
}
@media (max-width: 560px) {
    :is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-maker-head { align-items: flex-start; flex-direction: column; }
    :is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-image-library-head { align-items: flex-start; flex-direction: column; }
    :is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-library-tools { width: 100%; }
    :is(html body #page, #chat-meme-picker.chat-meme-fullscreen) #meme-library-search { flex: 1 1 auto; width: auto; }
    :is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-maker-controls { display: flex; }
    :is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-canvas-wrap { min-height: 30vh; max-height: 44vh; }
    :is(html body #page, #chat-meme-picker.chat-meme-fullscreen) #meme-canvas { max-height: 42vh; }
    :is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-extra-text-row { grid-template-columns: minmax(0, 1fr) 78px; }
    :is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-extra-text-row .meme-extra-text-remove { grid-column: 1 / -1; justify-self: end; }
    :is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-extra-text-size-control { grid-column: 1 / -1; }
    #chat-meme-picker.chat-meme-fullscreen { padding-left: 10px !important; padding-right: 10px !important; }
}

/* ==========================================================================
   Filed 1.2.148 — one rule for buttons vs links.
   A real form submit (Save, Log in, Search, Send) is the charcoal box.
   Every other action — toolbar actions, toggles, Done/Close/Download/Copy,
   Refresh, Remove, Insert — is a plain underlined link. Nothing is half of
   each: no box around link text, no box without a submit behind it.
   ========================================================================== */
html body :is(#page, #chat-meme-picker) .quiet-button,
html body #page button.button[type="button"],
html body #page a.button,
html body #page .button-link,
html body #page summary.button,
html body :is(#page, #chat-meme-picker) .meme-source-button,
html body :is(#page, #chat-meme-picker) .meme-maker-head-actions a,
html body :is(#page, #chat-meme-picker) .meme-maker button:not(.meme-image-card),
html body #chat-meme-picker .chat-meme-head-actions button,
html body #page .chat-message-edit-controls button,
html body #page .chat-sound-result-actions button,
html body #page .chat-profile-head .quiet-button,
html body #page .zip-extract-actions button,
html body #page .chat-server-file-row button,
html body #page .chat-pending-file-remove,
html body #page .chat-reply-cancel,
html body #page .chat-emoji-edit,
html body #page .chat-sound-play {
    display: inline-block;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0;
    padding: 2px 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--links-link) !important;
    font: 12px/1.4 var(--links-font, Arial, Helvetica, sans-serif) !important;
    letter-spacing: 0;
    text-decoration: underline !important;
    text-align: left;
    cursor: pointer;
}
html body :is(#page, #chat-meme-picker) .quiet-button:hover,
html body #page button.button[type="button"]:hover,
html body #page a.button:hover,
html body #page summary.button:hover,
html body :is(#page, #chat-meme-picker) .meme-source-button:hover,
html body :is(#page, #chat-meme-picker) .meme-maker-head-actions a:hover,
html body :is(#page, #chat-meme-picker) .meme-maker button:not(.meme-image-card):hover,
html body #chat-meme-picker .chat-meme-head-actions button:hover,
html body #page .chat-message-edit-controls button:hover,
html body #page .chat-sound-result-actions button:hover,
html body #page .chat-profile-head .quiet-button:hover,
html body #page .zip-extract-actions button:hover,
html body #page .chat-server-file-row button:hover,
html body #page .chat-pending-file-remove:hover,
html body #page .chat-reply-cancel:hover,
html body #page .chat-emoji-edit:hover,
html body #page .chat-sound-play:hover {
    background: transparent !important;
    border: 0 !important;
    color: var(--links-link-hover, #c5d8ff) !important;
    text-decoration: underline !important;
}
html body :is(#page, #chat-meme-picker) .quiet-button:disabled,
html body #page button.button[type="button"]:disabled,
html body #page .chat-message-edit-controls button:disabled {
    color: var(--links-subtle, #6f6f6f) !important;
    text-decoration: none !important;
    cursor: default;
    opacity: 1;
}
/* Links that sit inline with surrounding text keep their own size. */
html body #page .file-browser-nav .quiet-button,
html body #page .file-tools .quiet-button { font-size: 12px !important; }
html body #page .danger-action.quiet-button { color: #ff9999 !important; }

/* Meme creator: every action in one row, same size, same gap. */
html body :is(#page, #chat-meme-picker) .meme-maker-head-actions,
html body :is(#page, #chat-meme-picker) .meme-export-actions,
html body #chat-meme-picker .chat-meme-head-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; }
html body :is(#page, #chat-meme-picker) .meme-text-layers-head .quiet-button,
html body :is(#page, #chat-meme-picker) .meme-extra-text-remove { padding: 2px 0 !important; }
html body #page .meme-image-card { font: inherit; }

/* Meme creator links stay lit even before an image is chosen (they just do nothing until then). */
html body #page#page .meme-maker button:disabled:not(.meme-image-card),
html body #chat-meme-picker#chat-meme-picker .meme-maker button:disabled:not(.meme-image-card),
html body #chat-meme-picker#chat-meme-picker .chat-meme-head-actions button:disabled {
    color: var(--links-link) !important;
    text-decoration: underline !important;
    cursor: pointer;
    opacity: 1 !important;
}

/* Filed 1.2.148: the shared image library uses real thumbnails, not a tiny strip. */
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-image-library {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    max-height: 340px;
    padding: 2px 2px 6px;
}
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-image-card { gap: 6px; padding: 5px; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-image-card img { height: 130px; }
:is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-image-card span { font-size: 12px; line-height: 1.35; }
#chat-meme-picker.chat-meme-fullscreen#chat-meme-picker .meme-image-library { max-height: 340px; }
@media (max-width: 560px) {
    :is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-image-library { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); max-height: 300px; }
    :is(html body #page, #chat-meme-picker.chat-meme-fullscreen) .meme-image-card img { height: 100px; }
}

/* Filed 1.2.148: every row of meme-creator links uses the same gap and no stray margins. */
html body #page#page :is(.meme-maker-head-actions, .meme-export-actions, .meme-library-tools, .meme-text-layers-head),
html body #chat-meme-picker#chat-meme-picker :is(.meme-maker-head-actions, .meme-export-actions, .meme-library-tools, .meme-text-layers-head, .chat-meme-head-actions) {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 16px;
}
html body #page#page :is(.meme-maker, .chat-meme-head-actions) :is(button, a, label).meme-source-button,
html body #page#page .meme-maker :is(button:not(.meme-image-card), .meme-maker-head-actions a),
html body #chat-meme-picker#chat-meme-picker .meme-maker :is(button:not(.meme-image-card), .meme-maker-head-actions a),
html body #chat-meme-picker#chat-meme-picker .chat-meme-head-actions button {
    margin: 0 !important;
    line-height: 1.4 !important;
}
html body #page#page .meme-maker-head-actions .meme-source-button { margin: 0 !important; }





/* Filed 1.2.157 — restore the pre-1.2.148 ChatFile control cascade.
   The broad Links UI pass intentionally styles controls across the app. These
   exceptions return the embedded chat controls and identity buttons to the
   exact sizing and typography they had in the 1.2.146 stylesheet. */
html body #page .chat-file-open-panel > .chat-document-panel {
    line-height: normal !important;
}
html body #page .chat-file-open-panel > .chat-document-panel .chat-profile-name {
    font-family: inherit !important;
}
html body #page .chat-file-open-panel > .chat-document-panel .text-document-actions {
    gap: 5px !important;
}
html body #page .chat-file-open-panel > .chat-document-panel .text-document-actions .chat-fullscreen-toggle {
    min-height: auto !important;
    line-height: normal !important;
    text-align: center !important;
}
html body #page .chat-file-open-panel > .chat-document-panel .chat-action-toolbar button:not(#chat-send) {
    min-height: 27px !important;
    line-height: 1.2 !important;
    text-align: center !important;
}
html body #page .chat-file-open-panel > .chat-document-panel .chat-action-toolbar #chat-send {
    min-height: 0 !important;
    line-height: normal !important;
    text-align: center !important;
}
html body #page .chat-file-open-panel > .chat-document-panel .chat-message-actions-inline button {
    font-family: inherit !important;
    line-height: inherit !important;
    text-align: center !important;
}
html body #page .chat-file-open-panel > .chat-document-panel .chat-emoji-picker-head {
    line-height: normal !important;
}
html body #page .chat-file-open-panel > .chat-document-panel input[type="text"],
html body #page .chat-file-open-panel > .chat-document-panel input[type="search"],
html body #page .chat-file-open-panel > .chat-document-panel input[type="password"],
html body #page .chat-file-open-panel > .chat-document-panel input[type="email"],
html body #page .chat-file-open-panel > .chat-document-panel input[type="url"],
html body #page .chat-file-open-panel > .chat-document-panel input:not([type]) {
    min-height: 0 !important;
    font: inherit !important;
    line-height: normal !important;
}
html body #page .chat-file-open-panel > .chat-document-panel .chat-action-toolbar #chat-send {
    text-align: left !important;
}
html body #page .chat-file-open-panel > .chat-document-panel .chat-emoji-picker-head > * {
    line-height: normal !important;
}
html body #page .chat-file-open-panel > .chat-document-panel #chat-emoji-search,
html body #page .chat-file-open-panel > .chat-document-panel #chat-server-search,
html body #page .chat-file-open-panel > .chat-document-panel #chat-emoji-shortcode {
    min-height: 34px !important;
    font: inherit !important;
    line-height: normal !important;
}
html body #page .chat-file-open-panel > .chat-document-panel #chat-compose {
    min-height: 42px !important;
    font: 12px/1.45 ui-monospace,SFMono-Regular,Consolas,monospace !important;
}
html body #page .chat-file-open-panel {
    line-height: normal !important;
}


/* Filed creator-made account themes. Keep these treatments scoped to the
   selected preset so custom palettes retain the normal Filed layout. */
.account-theme-section-title { margin-top:14px !important; }
.account-theme-intro { margin:4px 0 10px; }
.account-theme-preset-grid {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(205px,1fr));
    gap:10px;
    margin:10px 0 16px;
}
.account-theme-preset {
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:9px;
    min-width:0;
    padding:11px;
    border:1px solid var(--filed-ui-border-soft);
    background:var(--filed-ui-surface);
}
.account-theme-preset.is-selected { border-color:var(--theme-accent,#8db8ff); }
.account-theme-preset-swatches { display:flex; width:100%; height:27px; overflow:hidden; border:1px solid var(--filed-ui-border); }
.account-theme-preset-swatches span { flex:1 1 0; min-width:0; }
.account-theme-preset-copy { display:grid; gap:3px; }
.account-theme-preset-copy strong { color:var(--filed-ui-text); font-size:13px; }
.account-theme-preset-copy span { color:var(--filed-ui-muted); font-size:11px; line-height:1.45; }
.account-theme-preset .account-theme-use { margin:0; }
.account-theme-current { color:var(--theme-success,var(--filed-ui-muted)); font-size:11px; }
.account-theme-custom-title { padding-top:8px; border-top:1px solid var(--filed-ui-border-soft); }
@media (max-width:560px) { .account-theme-preset-grid { grid-template-columns:minmax(0,1fr); } }

/* Windows 95: classic teal desktop, gray window chrome and raised controls. */
html[data-filed-theme="win95"] body,
html[data-filed-theme="win95"] #page {
    font-family:Tahoma, "MS Sans Serif", Arial, sans-serif !important;
}
html[data-filed-theme="win95"] .file-browser-top,
html[data-filed-theme="win95"] .chat-header {
    color:#ffffff !important;
    background:#000080 !important;
    border:2px outset #dfdfdf !important;
    padding:7px 9px !important;
}
html[data-filed-theme="win95"] .file-browser-top a,
html[data-filed-theme="win95"] .chat-header a { color:#ffffff !important; }
html[data-filed-theme="win95"] .account-card,
html[data-filed-theme="win95"] .tools,
html[data-filed-theme="win95"] .file-toolbar,
html[data-filed-theme="win95"] .chat-main,
html[data-filed-theme="win95"] .chat-files,
html[data-filed-theme="win95"] .vc-main,
html[data-filed-theme="win95"] .account-theme-preview {
    color:#000000 !important;
    background:#c0c0c0 !important;
    border:2px outset #dfdfdf !important;
    border-radius:0 !important;
    box-shadow:none !important;
}
html[data-filed-theme="win95"] .account-card h2,
html[data-filed-theme="win95"] .account-card h3,
html[data-filed-theme="win95"] .account-card h4,
html[data-filed-theme="win95"] .account-identity strong,
html[data-filed-theme="win95"] .account-theme-color,
html[data-filed-theme="win95"] .account-theme-preview strong,
html[data-filed-theme="win95"] .account-theme-preview span { color:#000000 !important; }
html[data-filed-theme="win95"] button:not(.chat-profile-name),
html[data-filed-theme="win95"] .button,
html[data-filed-theme="win95"] input.button {
    color:#000000 !important;
    background:#c0c0c0 !important;
    border:2px outset #ffffff !important;
    border-radius:0 !important;
    box-shadow:none !important;
}
html[data-filed-theme="win95"] button:not(.chat-profile-name):active,
html[data-filed-theme="win95"] .button:active { border-style:inset !important; }
html[data-filed-theme="win95"] input:not([type="color"]),
html[data-filed-theme="win95"] select,
html[data-filed-theme="win95"] textarea {
    color:#000000 !important;
    background:#ffffff !important;
    border:2px inset #808080 !important;
    border-radius:0 !important;
}
html[data-filed-theme="win95"] .account-theme-preset { background:#c0c0c0 !important; border:2px outset #dfdfdf !important; }
html[data-filed-theme="win95"] .account-theme-preset-copy strong,
html[data-filed-theme="win95"] .account-theme-preset-copy span,
html[data-filed-theme="win95"] .account-theme-current { color:#000000 !important; }
html[data-filed-theme="win95"] .account-theme-preset.is-selected { border:2px inset #808080 !important; }

/* Light mode stays deliberately flat and uses clear, high-contrast borders. */
html[data-filed-theme="light"] body { color:#202938 !important; }
html[data-filed-theme="light"] .account-card,
html[data-filed-theme="light"] .tools,
html[data-filed-theme="light"] .file-toolbar,
html[data-filed-theme="light"] .chat-main,
html[data-filed-theme="light"] .chat-files,
html[data-filed-theme="light"] .vc-main {
    color:#202938 !important;
    background:#ffffff !important;
    border-color:#dce2ea !important;
}
html[data-filed-theme="light"] .account-card h2,
html[data-filed-theme="light"] .account-card h3,
html[data-filed-theme="light"] .account-card h4,
html[data-filed-theme="light"] .account-identity strong,
html[data-filed-theme="light"] .account-theme-color { color:#202938 !important; }
html[data-filed-theme="light"] .account-theme-preset { background:#ffffff !important; border-color:#dce2ea !important; }

/* Modern: a graphite palette, system typography and restrained corner radius. */
html[data-filed-theme="modern"] body,
html[data-filed-theme="modern"] #page {
    font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
html[data-filed-theme="modern"] .account-card,
html[data-filed-theme="modern"] .tools,
html[data-filed-theme="modern"] .file-toolbar,
html[data-filed-theme="modern"] .chat-header,
html[data-filed-theme="modern"] .chat-main,
html[data-filed-theme="modern"] .chat-files,
html[data-filed-theme="modern"] .vc-main,
html[data-filed-theme="modern"] .account-theme-preset,
html[data-filed-theme="modern"] .account-theme-preview {
    border-radius:4px !important;
}
html[data-filed-theme="modern"] .account-theme-preset { background:#182331 !important; border-color:#2e4053 !important; }
html[data-filed-theme="modern"] .account-theme-preset.is-selected { border-color:#62a8f4 !important; }
html[data-filed-theme="modern"] button:not(.chat-profile-name),
html[data-filed-theme="modern"] .button,
html[data-filed-theme="modern"] input.button,
html[data-filed-theme="modern"] input:not([type="color"]),
html[data-filed-theme="modern"] select,
html[data-filed-theme="modern"] textarea { border-radius:3px !important; }


/* Theme all opened workspaces, not just the surrounding file-browser shell.
   This layer deliberately affects Filed chrome and message surfaces, while
   leaving the contents of user documents and media untouched. */
html:not([data-filed-theme="filed"]) .chat-page #page,
html:not([data-filed-theme="filed"]) .chat-page .chat-document-panel,
html:not([data-filed-theme="filed"]) .chat-file-open-panel > .chat-document-panel,
html:not([data-filed-theme="filed"]) .chat-document-panel,
html:not([data-filed-theme="filed"]) .chat-filesystem-list,
html:not([data-filed-theme="filed"]) .chat-file-open-panel,
html:not([data-filed-theme="filed"]) .text-editor-shell,
html:not([data-filed-theme="filed"]) .text-editor-header,
html:not([data-filed-theme="filed"]) .text-editor-toolbar,
html:not([data-filed-theme="filed"]) .text-editor-footer,
html:not([data-filed-theme="filed"]) .text-editor-source-pane,
html:not([data-filed-theme="filed"]) .text-editor-preview-pane,
html:not([data-filed-theme="filed"]) .text-editor-preview-heading,
html:not([data-filed-theme="filed"]) .text-editor-preview-status,
html:not([data-filed-theme="filed"]) .filed-split-pane,
html:not([data-filed-theme="filed"]) .filed-split-toolbar,
html:not([data-filed-theme="filed"]) .book-library-dashboard,
html:not([data-filed-theme="filed"]) .book-reader-toolbar,
html:not([data-filed-theme="filed"]) .book-reader-controls {
    color:var(--theme-text,#dddddd) !important;
    background-color:var(--theme-panel-bg,#181818) !important;
    border-color:var(--theme-border,#555555) !important;
}
html:not([data-filed-theme="filed"]) .chat-page .chat-document-toolbar,
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-document-toolbar,
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-document-toolbar,
html:not([data-filed-theme="filed"]) .chat-page .chat-compose,
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-compose,
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-compose,
html:not([data-filed-theme="filed"]) .text-editor-header,
html:not([data-filed-theme="filed"]) .text-editor-toolbar,
html:not([data-filed-theme="filed"]) .text-editor-footer,
html:not([data-filed-theme="filed"]) .text-editor-preview-heading,
html:not([data-filed-theme="filed"]) .filed-split-toolbar,
html:not([data-filed-theme="filed"]) .book-reader-toolbar,
html:not([data-filed-theme="filed"]) .book-reader-controls {
    color:var(--theme-text,#dddddd) !important;
    background-color:var(--theme-raised-bg,#1b1b1b) !important;
    border-color:var(--theme-border,#555555) !important;
}
html:not([data-filed-theme="filed"]) .chat-page .chat-transcript-wrap,
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-transcript-wrap,
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-transcript-wrap,
html:not([data-filed-theme="filed"]) .chat-page #chat-messages.chat-transcript,
html:not([data-filed-theme="filed"]) .chat-document-panel #chat-messages.chat-transcript,
html:not([data-filed-theme="filed"]) .chat-file-open-panel #chat-messages.chat-transcript,
html:not([data-filed-theme="filed"]) .text-editor-source-pane .text-file-editor-area,
html:not([data-filed-theme="filed"]) .text-editor-preview-pane .text-editor-live-document {
    color:var(--theme-text,#dddddd) !important;
    background-color:var(--theme-raised-bg,#1b1b1b) !important;
    border-color:var(--theme-border,#555555) !important;
}
html:not([data-filed-theme="filed"]) .chat-page .chat-message,
html:not([data-filed-theme="filed"]) .chat-page .chat-message-body,
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-message,
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-message-body,
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-message,
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-message-body,
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-message-head strong:not(.chat-root-name):not(.chat-haxcat-name),
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-message-head strong:not(.chat-root-name):not(.chat-haxcat-name),
html:not([data-filed-theme="filed"]) .text-editor-shell,
html:not([data-filed-theme="filed"]) .text-editor-header *,
html:not([data-filed-theme="filed"]) .text-editor-toolbar *,
html:not([data-filed-theme="filed"]) .text-editor-footer *,
html:not([data-filed-theme="filed"]) .filed-split-toolbar *,
html:not([data-filed-theme="filed"]) .book-reader-toolbar *,
html:not([data-filed-theme="filed"]) .book-reader-controls * {
    color:var(--theme-text,#dddddd);
}
html:not([data-filed-theme="filed"]) .chat-page .chat-message-head,
html:not([data-filed-theme="filed"]) .chat-page .chat-message-id,
html:not([data-filed-theme="filed"]) .chat-page .chat-document-path,
html:not([data-filed-theme="filed"]) .chat-page .chat-document-user,
html:not([data-filed-theme="filed"]) .chat-page .chat-status,
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-message-head,
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-message-id,
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-document-path,
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-document-user,
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-status,
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-message-head,
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-message-id,
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-document-path,
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-document-user,
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-status,
html:not([data-filed-theme="filed"]) .text-editor-preview-status,
html:not([data-filed-theme="filed"]) .text-editor-preview-heading {
    color:var(--theme-muted,#888888) !important;
}
html:not([data-filed-theme="filed"]) .chat-page .chat-message-group,
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-message-group,
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-message-group,
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-action-toolbar,
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-action-toolbar,
html:not([data-filed-theme="filed"]) .chat-page .chat-compose,
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-compose,
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-compose {
    border-color:var(--theme-divider,#292929) !important;
}
html:not([data-filed-theme="filed"]) .chat-page .chat-reply-quote,
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-reply-quote,
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-reply-quote,
html:not([data-filed-theme="filed"]) .chat-page .chat-pending-file,
html:not([data-filed-theme="filed"]) .chat-page #chat-reply-banner,
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-pending-file,
html:not([data-filed-theme="filed"]) .chat-document-panel #chat-reply-banner,
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-pending-file,
html:not([data-filed-theme="filed"]) .chat-file-open-panel #chat-reply-banner {
    color:var(--theme-text,#dddddd) !important;
    background-color:var(--theme-raised-bg,#1b1b1b) !important;
    border-color:var(--theme-border,#555555) !important;
}
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-action-toolbar button,
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-action-toolbar button,
html:not([data-filed-theme="filed"]) .chat-page .chat-action-toolbar button,
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-message-actions-inline button,
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-message-actions-inline button {
    color:var(--theme-text,#dddddd) !important;
    background-color:var(--theme-button-bg,#252525) !important;
    border-color:var(--theme-border,#555555) !important;
}
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-action-toolbar button:hover,
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-action-toolbar button:hover,
html:not([data-filed-theme="filed"]) .chat-page .chat-action-toolbar button:hover,
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-message-actions-inline button:hover,
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-message-actions-inline button:hover {
    background-color:var(--theme-button-hover,#303030) !important;
}
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-online-user,
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-online-user { color:var(--theme-text,#dddddd) !important; }
html:not([data-filed-theme="filed"]) .chat-document-panel .chat-notification-item,
html:not([data-filed-theme="filed"]) .chat-file-open-panel .chat-notification-item { color:var(--theme-text,#dddddd) !important; border-color:var(--theme-divider,#292929) !important; }
html:not([data-filed-theme="filed"]) .chat-page .chat-document-panel,
html:not([data-filed-theme="filed"]) .chat-file-open-panel > .chat-document-panel { border-color:var(--theme-border,#555555) !important; }
html:not([data-filed-theme="filed"]) .text-editor-shell,
html:not([data-filed-theme="filed"]) .text-editor-header,
html:not([data-filed-theme="filed"]) .text-editor-toolbar,
html:not([data-filed-theme="filed"]) .text-editor-footer,
html:not([data-filed-theme="filed"]) .text-editor-source-pane,
html:not([data-filed-theme="filed"]) .text-editor-preview-pane,
html:not([data-filed-theme="filed"]) .filed-split-pane,
html:not([data-filed-theme="filed"]) .book-library-dashboard { border-color:var(--theme-border,#555555) !important; }

/* Creator theme treatments for opened ChatFiles and editor chrome. */
html[data-filed-theme="win95"] .chat-page .chat-document-panel,
html[data-filed-theme="win95"] .chat-document-panel,
html[data-filed-theme="win95"] .chat-file-open-panel > .chat-document-panel,
html[data-filed-theme="win95"] .chat-filesystem-list,
html[data-filed-theme="win95"] .text-editor-shell,
html[data-filed-theme="win95"] .text-editor-source-pane,
html[data-filed-theme="win95"] .text-editor-preview-pane {
    color:#000000 !important;
    background:#c0c0c0 !important;
    border:2px outset #dfdfdf !important;
    border-radius:0 !important;
    box-shadow:none !important;
}
html[data-filed-theme="win95"] .chat-page .chat-document-toolbar,
html[data-filed-theme="win95"] .chat-document-toolbar,
html[data-filed-theme="win95"] .chat-file-open-panel .chat-document-toolbar,
html[data-filed-theme="win95"] .text-editor-header,
html[data-filed-theme="win95"] .text-editor-toolbar,
html[data-filed-theme="win95"] .text-editor-footer {
    color:#ffffff !important;
    background:#000080 !important;
    border-color:#dfdfdf !important;
}
html[data-filed-theme="win95"] .chat-page .chat-transcript-wrap,
html[data-filed-theme="win95"] .chat-document-panel .chat-transcript-wrap,
html[data-filed-theme="win95"] .chat-file-open-panel .chat-transcript-wrap,
html[data-filed-theme="win95"] .chat-page #chat-messages.chat-transcript,
html[data-filed-theme="win95"] .chat-document-panel #chat-messages.chat-transcript,
html[data-filed-theme="win95"] .chat-file-open-panel #chat-messages.chat-transcript,
html[data-filed-theme="win95"] .text-editor-source-pane .text-file-editor-area {
    color:#000000 !important;
    background:#ffffff !important;
    border-color:#808080 !important;
}
html[data-filed-theme="win95"] .chat-page .chat-message,
html[data-filed-theme="win95"] .chat-page .chat-message-body,
html[data-filed-theme="win95"] .chat-document-panel .chat-message,
html[data-filed-theme="win95"] .chat-document-panel .chat-message-body,
html[data-filed-theme="win95"] .chat-file-open-panel .chat-message,
html[data-filed-theme="win95"] .chat-file-open-panel .chat-message-body,
html[data-filed-theme="win95"] .chat-document-panel .chat-message-head strong:not(.chat-root-name):not(.chat-haxcat-name),
html[data-filed-theme="win95"] .chat-file-open-panel .chat-message-head strong:not(.chat-root-name):not(.chat-haxcat-name) {
    color:#000000 !important;
}
html[data-filed-theme="win95"] .chat-page .chat-message-head,
html[data-filed-theme="win95"] .chat-document-panel .chat-message-head,
html[data-filed-theme="win95"] .chat-file-open-panel .chat-message-head,
html[data-filed-theme="win95"] .chat-page .chat-message-id,
html[data-filed-theme="win95"] .chat-document-panel .chat-message-id,
html[data-filed-theme="win95"] .chat-file-open-panel .chat-message-id { color:#404040 !important; }
html[data-filed-theme="win95"] .chat-page .chat-compose,
html[data-filed-theme="win95"] .chat-document-panel .chat-compose,
html[data-filed-theme="win95"] .chat-file-open-panel .chat-compose { background:#c0c0c0 !important; }
html[data-filed-theme="win95"] .chat-page #chat-compose,
html[data-filed-theme="win95"] .chat-document-panel #chat-compose,
html[data-filed-theme="win95"] .chat-file-open-panel #chat-compose { color:#000000 !important; background:#ffffff !important; border:2px inset #808080 !important; border-radius:0 !important; }
html[data-filed-theme="win95"] .chat-document-panel .chat-action-toolbar button,
html[data-filed-theme="win95"] .chat-file-open-panel .chat-action-toolbar button,
html[data-filed-theme="win95"] .chat-page .chat-action-toolbar button {
    color:#000000 !important; background:#c0c0c0 !important; border:2px outset #ffffff !important; border-radius:0 !important;
}
html[data-filed-theme="win95"] .chat-document-panel .chat-action-toolbar button:active,
html[data-filed-theme="win95"] .chat-file-open-panel .chat-action-toolbar button:active { border-style:inset !important; }
html[data-filed-theme="light"] .chat-page #page,
html[data-filed-theme="light"] .chat-page .chat-document-panel,
html[data-filed-theme="light"] .chat-document-panel,
html[data-filed-theme="light"] .chat-file-open-panel > .chat-document-panel,
html[data-filed-theme="light"] .chat-filesystem-list,
html[data-filed-theme="light"] .text-editor-shell,
html[data-filed-theme="light"] .text-editor-source-pane,
html[data-filed-theme="light"] .text-editor-preview-pane {
    color:#202938 !important; background:#ffffff !important; border-color:#dce2ea !important;
}
html[data-filed-theme="light"] .chat-page .chat-document-toolbar,
html[data-filed-theme="light"] .chat-document-toolbar,
html[data-filed-theme="light"] .chat-file-open-panel .chat-document-toolbar,
html[data-filed-theme="light"] .chat-page .chat-compose,
html[data-filed-theme="light"] .chat-document-panel .chat-compose,
html[data-filed-theme="light"] .chat-file-open-panel .chat-compose,
html[data-filed-theme="light"] .text-editor-header,
html[data-filed-theme="light"] .text-editor-toolbar,
html[data-filed-theme="light"] .text-editor-footer {
    color:#202938 !important; background:#f8fafc !important; border-color:#dce2ea !important;
}
html[data-filed-theme="light"] .chat-page .chat-transcript-wrap,
html[data-filed-theme="light"] .chat-document-panel .chat-transcript-wrap,
html[data-filed-theme="light"] .chat-file-open-panel .chat-transcript-wrap,
html[data-filed-theme="light"] .chat-page #chat-messages.chat-transcript,
html[data-filed-theme="light"] .chat-document-panel #chat-messages.chat-transcript,
html[data-filed-theme="light"] .chat-file-open-panel #chat-messages.chat-transcript {
    color:#202938 !important; background:#f8fafc !important; border-color:#dce2ea !important;
}
html[data-filed-theme="light"] .chat-page .chat-message,
html[data-filed-theme="light"] .chat-page .chat-message-body,
html[data-filed-theme="light"] .chat-document-panel .chat-message,
html[data-filed-theme="light"] .chat-document-panel .chat-message-body,
html[data-filed-theme="light"] .chat-file-open-panel .chat-message,
html[data-filed-theme="light"] .chat-file-open-panel .chat-message-body,
html[data-filed-theme="light"] .chat-document-panel .chat-message-head strong:not(.chat-root-name):not(.chat-haxcat-name),
html[data-filed-theme="light"] .chat-file-open-panel .chat-message-head strong:not(.chat-root-name):not(.chat-haxcat-name) {
    color:#202938 !important;
}
html[data-filed-theme="light"] .chat-page #chat-compose,
html[data-filed-theme="light"] .chat-document-panel #chat-compose,
html[data-filed-theme="light"] .chat-file-open-panel #chat-compose { color:#202938 !important; background:#ffffff !important; border-color:#c6cfdb !important; }
html[data-filed-theme="light"] .chat-document-panel .chat-message-head,
html[data-filed-theme="light"] .chat-file-open-panel .chat-message-head,
html[data-filed-theme="light"] .chat-page .chat-message-head,
html[data-filed-theme="light"] .chat-document-panel .chat-message-id,
html[data-filed-theme="light"] .chat-file-open-panel .chat-message-id,
html[data-filed-theme="light"] .chat-page .chat-message-id { color:#667085 !important; }
html[data-filed-theme="light"] .chat-document-panel .chat-action-toolbar button,
html[data-filed-theme="light"] .chat-file-open-panel .chat-action-toolbar button,
html[data-filed-theme="light"] .chat-page .chat-action-toolbar button { color:#202938 !important; background:#e8edf4 !important; border-color:#c6cfdb !important; }
html[data-filed-theme="modern"] .chat-page .chat-document-panel,
html[data-filed-theme="modern"] .chat-document-panel,
html[data-filed-theme="modern"] .chat-file-open-panel > .chat-document-panel,
html[data-filed-theme="modern"] .chat-filesystem-list,
html[data-filed-theme="modern"] .text-editor-shell,
html[data-filed-theme="modern"] .text-editor-source-pane,
html[data-filed-theme="modern"] .text-editor-preview-pane,
html[data-filed-theme="modern"] .chat-document-toolbar,
html[data-filed-theme="modern"] .text-editor-header,
html[data-filed-theme="modern"] .text-editor-toolbar,
html[data-filed-theme="modern"] .text-editor-footer { border-radius:4px !important; }
html[data-filed-theme="modern"] .chat-document-panel .chat-action-toolbar button,
html[data-filed-theme="modern"] .chat-file-open-panel .chat-action-toolbar button,
html[data-filed-theme="modern"] .chat-page .chat-action-toolbar button,
html[data-filed-theme="modern"] .chat-page #chat-compose,
html[data-filed-theme="modern"] .chat-document-panel #chat-compose,
html[data-filed-theme="modern"] .chat-file-open-panel #chat-compose { border-radius:3px !important; }


/* Aero Glass: luminous blue glass, reflections and translucent window chrome. */
html[data-filed-theme="aero"] body {
    color:#f1f8ff !important;
    background:
        radial-gradient(ellipse at 18% 0%, rgba(104,193,255,.35), transparent 44%),
        radial-gradient(ellipse at 88% 24%, rgba(55,142,207,.28), transparent 42%),
        linear-gradient(145deg, #071a2d 0%, #0b3153 48%, #06172a 100%) fixed !important;
    background-attachment:fixed !important;
}
html[data-filed-theme="aero"] #page { background:transparent !important; }
html[data-filed-theme="aero"] .account-card,
html[data-filed-theme="aero"] .tools,
html[data-filed-theme="aero"] .file-toolbar,
html[data-filed-theme="aero"] .chat-main,
html[data-filed-theme="aero"] .chat-files,
html[data-filed-theme="aero"] .vc-main,
html[data-filed-theme="aero"] #filed-vc,
html[data-filed-theme="aero"] .chat-document-panel,
html[data-filed-theme="aero"] .chat-file-open-panel,
html[data-filed-theme="aero"] .chat-filesystem-list,
html[data-filed-theme="aero"] .text-editor-shell,
html[data-filed-theme="aero"] .text-editor-source-pane,
html[data-filed-theme="aero"] .text-editor-preview-pane,
html[data-filed-theme="aero"] .filed-split-pane,
html[data-filed-theme="aero"] .book-library-dashboard,
html[data-filed-theme="aero"] .account-theme-preview,
html[data-filed-theme="aero"] .admin-settings,
html[data-filed-theme="aero"] .share-link-form,
html[data-filed-theme="aero"] .context-menu,
html[data-filed-theme="aero"] .file-background-context-menu,
html[data-filed-theme="aero"] .filed-vmenu,
html[data-filed-theme="aero"] .create-folder-panel,
html[data-filed-theme="aero"] .create-menu-panel,
html[data-filed-theme="aero"] .create-text-panel,
html[data-filed-theme="aero"] .meme-image-library-panel,
html[data-filed-theme="aero"] .meme-preview-panel,
html[data-filed-theme="aero"] .filed-storage-panel,
html[data-filed-theme="aero"] .account-role-picker,
html[data-filed-theme="aero"] .chat-meme-picker {
    color:#f1f8ff !important;
    background:linear-gradient(145deg, rgba(91,164,211,.31), rgba(12,49,79,.66)) !important;
    border:1px solid rgba(174,224,255,.58) !important;
    border-radius:10px !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.36), 0 8px 24px rgba(0,12,28,.26) !important;
    -webkit-backdrop-filter:blur(14px) saturate(150%);
    backdrop-filter:blur(14px) saturate(150%);
}
html[data-filed-theme="aero"] .chat-header,
html[data-filed-theme="aero"] .chat-document-toolbar,
html[data-filed-theme="aero"] .text-editor-header,
html[data-filed-theme="aero"] .text-editor-toolbar,
html[data-filed-theme="aero"] .text-editor-footer,
html[data-filed-theme="aero"] .filed-split-toolbar,
html[data-filed-theme="aero"] .book-reader-toolbar,
html[data-filed-theme="aero"] .book-reader-controls,
html[data-filed-theme="aero"] .chat-compose {
    color:#f5fbff !important;
    background:linear-gradient(180deg, rgba(198,235,255,.48) 0%, rgba(71,143,190,.38) 23%, rgba(20,75,116,.64) 58%, rgba(7,39,67,.72) 100%) !important;
    border-color:rgba(190,232,255,.72) !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.5), 0 3px 12px rgba(0,12,28,.22) !important;
    -webkit-backdrop-filter:blur(16px) saturate(165%);
    backdrop-filter:blur(16px) saturate(165%);
}
html[data-filed-theme="aero"] .file-table,
html[data-filed-theme="aero"] .filed-storage-table,
html[data-filed-theme="aero"] .folder-owners-table {
    color:#eef8ff !important;
    background:rgba(7,34,57,.38) !important;
    border:1px solid rgba(159,217,250,.48) !important;
    border-radius:8px !important;
    border-collapse:separate !important;
    border-spacing:0 !important;
    overflow:hidden;
    -webkit-backdrop-filter:blur(12px) saturate(145%);
    backdrop-filter:blur(12px) saturate(145%);
}
html[data-filed-theme="aero"] .file-table th,
html[data-filed-theme="aero"] .filed-storage-table th,
html[data-filed-theme="aero"] .folder-owners-table th {
    color:#f2f9ff !important;
    background:linear-gradient(180deg,rgba(190,230,255,.34),rgba(54,122,166,.34)) !important;
    border-color:rgba(170,222,252,.38) !important;
}
html[data-filed-theme="aero"] .file-table td,
html[data-filed-theme="aero"] .filed-storage-table td,
html[data-filed-theme="aero"] .folder-owners-table td {
    color:#eaf6ff !important;
    background:rgba(6,29,50,.2) !important;
    border-color:rgba(150,203,237,.22) !important;
}
html[data-filed-theme="aero"] .chat-toolbar,
html[data-filed-theme="aero"] .chat-action-toolbar,
html[data-filed-theme="aero"] .vc-toolbar,
html[data-filed-theme="aero"] .admin-toolbar,
html[data-filed-theme="aero"] .file-sort-toolbar,
html[data-filed-theme="aero"] .filed-book-toolbar {
    color:#f1f8ff !important;
    background:rgba(22,75,113,.34) !important;
    border-color:rgba(168,220,250,.44) !important;
    border-radius:8px !important;
    -webkit-backdrop-filter:blur(10px);
    backdrop-filter:blur(10px);
}
html[data-filed-theme="aero"] .chat-page #page,
html[data-filed-theme="aero"] .chat-page .chat-shell { background:transparent !important; }
html[data-filed-theme="aero"] .chat-transcript-wrap,
html[data-filed-theme="aero"] #chat-messages.chat-transcript,
html[data-filed-theme="aero"] .text-editor-preview-status,
html[data-filed-theme="aero"] .text-editor-live-document {
    color:#eaf6ff !important;
    background:rgba(3,24,43,.48) !important;
    border-color:rgba(143,205,242,.4) !important;
}
html[data-filed-theme="aero"] .chat-message,
html[data-filed-theme="aero"] .chat-message-body,
html[data-filed-theme="aero"] .chat-document-panel .chat-message,
html[data-filed-theme="aero"] .chat-document-panel .chat-message-body,
html[data-filed-theme="aero"] .chat-file-open-panel .chat-message,
html[data-filed-theme="aero"] .chat-file-open-panel .chat-message-body {
    color:#eaf6ff !important;
    border-color:rgba(156,210,242,.23) !important;
}
html[data-filed-theme="aero"] .chat-message-head,
html[data-filed-theme="aero"] .chat-message-id,
html[data-filed-theme="aero"] .chat-status,
html[data-filed-theme="aero"] .chat-document-path,
html[data-filed-theme="aero"] .chat-document-user,
html[data-filed-theme="aero"] .small { color:#c1def2 !important; }
html[data-filed-theme="aero"] .chat-reply-quote,
html[data-filed-theme="aero"] .chat-pending-file,
html[data-filed-theme="aero"] #chat-reply-banner,
html[data-filed-theme="aero"] .chat-notification-panel,
html[data-filed-theme="aero"] .chat-server-picker,
html[data-filed-theme="aero"] #chat-emoji-picker,
html[data-filed-theme="aero"] .chat-sound-picker,
html[data-filed-theme="aero"] .chat-message-actions {
    color:#eef8ff !important;
    background:rgba(12,48,76,.78) !important;
    border-color:rgba(164,220,255,.58) !important;
    box-shadow:0 7px 20px rgba(0,10,24,.3) !important;
    -webkit-backdrop-filter:blur(14px) saturate(150%);
    backdrop-filter:blur(14px) saturate(150%);
}
html[data-filed-theme="aero"] button:not(.chat-profile-name),
html[data-filed-theme="aero"] .button,
html[data-filed-theme="aero"] input.button {
    color:#f7fbff !important;
    background:linear-gradient(180deg, rgba(210,240,255,.42), rgba(55,132,181,.44) 48%, rgba(17,71,113,.7)) !important;
    border:1px solid rgba(193,230,255,.76) !important;
    border-radius:6px !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.5), 0 2px 6px rgba(0,14,30,.25) !important;
    text-shadow:0 1px 2px rgba(0,20,40,.48) !important;
}
html[data-filed-theme="aero"] button:not(.chat-profile-name):hover,
html[data-filed-theme="aero"] .button:hover {
    background:linear-gradient(180deg, rgba(230,248,255,.58), rgba(82,165,216,.55) 48%, rgba(24,94,143,.76)) !important;
    border-color:rgba(225,246,255,.92) !important;
}
html[data-filed-theme="aero"] input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
html[data-filed-theme="aero"] select,
html[data-filed-theme="aero"] textarea,
html[data-filed-theme="aero"] #chat-compose {
    color:#f1f8ff !important;
    background:rgba(4,27,47,.68) !important;
    border:1px solid rgba(147,207,244,.7) !important;
    border-radius:6px !important;
    box-shadow:inset 0 1px 5px rgba(0,10,24,.32), 0 1px 0 rgba(255,255,255,.12) !important;
}
html[data-filed-theme="aero"] input::placeholder,
html[data-filed-theme="aero"] textarea::placeholder { color:#b7d4e8 !important; }
html[data-filed-theme="aero"] .file-row:hover td,
html[data-filed-theme="aero"] .chat-online-user:hover,
html[data-filed-theme="aero"] .chat-action-toolbar button:hover {
    background-color:rgba(105,185,235,.22) !important;
}
html[data-filed-theme="aero"] a { color:#c4ebff !important; }
html[data-filed-theme="aero"] a:hover { color:#ffffff !important; }
html[data-filed-theme="aero"] ::selection { color:#ffffff; background:rgba(47,139,202,.72); }
html[data-filed-theme="aero"] .account-theme-preset { background:rgba(12,49,79,.62) !important; border-color:rgba(174,224,255,.58) !important; }
html[data-filed-theme="aero"] .account-theme-preset.is-selected { border-color:#d7f3ff !important; box-shadow:0 0 0 1px rgba(185,231,255,.72), inset 0 1px 0 rgba(255,255,255,.36) !important; }
html[data-filed-theme="aero"] .account-theme-preset-copy strong,
html[data-filed-theme="aero"] .account-theme-preset-copy span,
html[data-filed-theme="aero"] .account-theme-color,
html[data-filed-theme="aero"] .account-theme-current { color:#eef8ff !important; }


/* 1.2.161: small inline .txt previews inherit the active account theme.
   Filed Default intentionally keeps its original preview colors. */
html[data-filed-theme="custom"] .inline-text-preview {
    color:var(--theme-text,#dddddd) !important;
    background:var(--theme-raised-bg,#1b1b1b) !important;
    border:1px solid var(--theme-border,#555555) !important;
    border-left:3px solid var(--theme-accent,#8db8ff) !important;
    outline:none !important;
    box-shadow:none !important;
    border-radius:4px;
}
html[data-filed-theme="custom"] .inline-text-preview a,
html[data-filed-theme="custom"] .inline-text-preview .text-document-path-link {
    color:var(--theme-link,#9bbcff) !important;
}
html[data-filed-theme="custom"] .inline-text-preview a:hover,
html[data-filed-theme="custom"] .inline-text-preview .text-document-path-link:hover {
    color:var(--theme-link-hover,#c5d8ff) !important;
}
html[data-filed-theme="win95"] .inline-text-preview {
    color:#000000 !important;
    background:#dfdfdf !important;
    border:2px inset #808080 !important;
    border-left:4px solid #000080 !important;
    border-radius:0 !important;
    font-family:Consolas,"Lucida Console",monospace !important;
    box-shadow:none !important;
}
html[data-filed-theme="win95"] .inline-text-preview a,
html[data-filed-theme="win95"] .inline-text-preview .text-document-path-link {
    color:#0000ee !important;
}
html[data-filed-theme="light"] .inline-text-preview {
    color:#202938 !important;
    background:#ffffff !important;
    border:1px solid #c6cfdb !important;
    border-left:3px solid #3478d4 !important;
    border-radius:5px !important;
    box-shadow:0 1px 3px rgba(32,41,56,.07) !important;
}
html[data-filed-theme="light"] .inline-text-preview a,
html[data-filed-theme="light"] .inline-text-preview .text-document-path-link {
    color:#1e5fbf !important;
}
html[data-filed-theme="modern"] .inline-text-preview {
    color:#e5edf8 !important;
    background:#202a38 !important;
    border:1px solid #46566d !important;
    border-left:3px solid #79a9ed !important;
    border-radius:6px !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.035) !important;
}
html[data-filed-theme="modern"] .inline-text-preview a,
html[data-filed-theme="modern"] .inline-text-preview .text-document-path-link {
    color:#9fc5ff !important;
}
html[data-filed-theme="aero"] .inline-text-preview {
    color:#eff8ff !important;
    background:linear-gradient(145deg,rgba(145,207,245,.24),rgba(7,34,58,.62)) !important;
    border:1px solid rgba(184,229,255,.62) !important;
    border-left:3px solid rgba(211,242,255,.92) !important;
    border-radius:7px !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.34),0 2px 8px rgba(0,12,28,.2) !important;
    -webkit-backdrop-filter:blur(12px) saturate(155%);
    backdrop-filter:blur(12px) saturate(155%);
}
html[data-filed-theme="aero"] .inline-text-preview a,
html[data-filed-theme="aero"] .inline-text-preview .text-document-path-link {
    color:#c4ebff !important;
}
html[data-filed-theme="aero"] .inline-text-preview a:hover,
html[data-filed-theme="aero"] .inline-text-preview .text-document-path-link:hover {
    color:#ffffff !important;
}

/* Aero's main breadcrumb bar stays a clear strip. Glass belongs on each
   navigation action, not on one oversized background behind the whole row. */
html[data-filed-theme="aero"] .file-browser-top {
    box-sizing:border-box !important;
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    flex-wrap:wrap !important;
    gap:9px 14px !important;
    min-width:0 !important;
    max-width:100% !important;
    padding:0 0 10px !important;
    margin:0 0 10px !important;
    color:#f1f8ff !important;
    background:transparent !important;
    border:0 !important;
    border-bottom:1px solid rgba(174,224,255,.34) !important;
    border-radius:0 !important;
    box-shadow:none !important;
    -webkit-backdrop-filter:none !important;
    backdrop-filter:none !important;
    overflow:visible !important;
}
html[data-filed-theme="aero"] .file-browser-top > .path {
    flex:1 1 180px !important;
    min-width:0 !important;
    padding:0 !important;
    color:#d8efff !important;
    background:transparent !important;
    border:0 !important;
    box-shadow:none !important;
    overflow-wrap:anywhere !important;
}
html[data-filed-theme="aero"] body #page .file-browser-top .file-browser-nav {
    display:flex !important;
    flex:0 1 auto !important;
    align-items:center !important;
    justify-content:flex-end !important;
    flex-wrap:wrap !important;
    gap:6px 7px !important;
    min-width:0 !important;
    max-width:100% !important;
    margin:0 !important;
    padding:0 !important;
    background:transparent !important;
    border:0 !important;
    box-shadow:none !important;
    overflow:visible !important;
}
html[data-filed-theme="aero"] body #page .file-browser-top .file-browser-nav a,
html[data-filed-theme="aero"] body #page .file-browser-top .file-browser-nav button,
html[data-filed-theme="aero"] body #page .file-browser-top .file-browser-nav .button {
    display:inline-flex !important;
    flex:0 1 auto !important;
    align-items:center !important;
    justify-content:center !important;
    box-sizing:border-box !important;
    min-width:0 !important;
    min-height:28px !important;
    height:auto !important;
    max-width:100% !important;
    margin:0 !important;
    padding:5px 9px !important;
    color:#f4fbff !important;
    font-size:12px !important;
    line-height:1.2 !important;
    font-weight:500 !important;
    text-align:center !important;
    text-decoration:none !important;
    white-space:normal !important;
    overflow-wrap:anywhere !important;
    vertical-align:middle !important;
    background:linear-gradient(180deg,rgba(213,242,255,.38),rgba(54,126,170,.38) 48%,rgba(12,57,91,.64)) !important;
    border:1px solid rgba(193,230,255,.68) !important;
    border-radius:6px !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.42),0 1px 4px rgba(0,12,28,.2) !important;
    text-shadow:0 1px 2px rgba(0,20,40,.42) !important;
}
html[data-filed-theme="aero"] body #page .file-browser-top .file-browser-nav a:hover,
html[data-filed-theme="aero"] body #page .file-browser-top .file-browser-nav button:hover,
html[data-filed-theme="aero"] body #page .file-browser-top .file-browser-nav .button:hover {
    color:#ffffff !important;
    background:linear-gradient(180deg,rgba(235,250,255,.56),rgba(88,167,213,.52) 48%,rgba(20,91,139,.74)) !important;
    border-color:rgba(229,247,255,.92) !important;
    text-decoration:none !important;
}
html[data-filed-theme="aero"] body #page .file-browser-top .file-browser-nav form {
    display:inline-flex !important;
    align-items:center !important;
    min-width:0 !important;
    margin:0 !important;
    padding:0 !important;
}
@media (max-width:640px) {
    html[data-filed-theme="aero"] .file-browser-top { align-items:flex-start !important; }
    html[data-filed-theme="aero"] body #page .file-browser-top .file-browser-nav {
        flex:1 1 100% !important;
        justify-content:flex-start !important;
    }
}


/* Aero context menus live on the page layer instead of inside blurred tables.
   Give the whole glass window a continuous outline on every edge. */
html[data-filed-theme="aero"] #page > .context-menu {
    z-index:10050 !important;
    box-sizing:border-box !important;
    border:1px solid rgba(196,234,255,.82) !important;
    outline:1px solid rgba(225,245,255,.32) !important;
    outline-offset:0 !important;
    border-radius:10px !important;
    background-clip:padding-box !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.48), 0 8px 24px rgba(0,12,28,.34), 0 0 0 1px rgba(91,171,218,.22) !important;
}

/* Filed 1.2.163: theme-aware contrast shadows for ordinary ChatFile usernames.
   The Filed Default appearance stays byte-for-byte visually untouched, and the
   animated Root/HaxCat identities retain their existing glow treatments. */
html[data-filed-theme="win95"] .chat-document-panel .chat-message-head > strong:not(.chat-root-name):not(.chat-haxcat-name),
html[data-filed-theme="win95"] .chat-document-panel .chat-message-head > .chat-profile-name:not(.chat-root-name):not(.chat-haxcat-name),
html[data-filed-theme="win95"] .chat-document-panel .chat-online-user > .chat-online-name:not(.chat-root-name):not(.chat-haxcat-name),
html[data-filed-theme="win95"] .chat-profile-card .chat-profile-title:not(.chat-root-name):not(.chat-haxcat-name) {
    text-shadow:0 1px 0 rgba(255,255,255,.9), 0 0 2px rgba(0,0,0,.28) !important;
}
html[data-filed-theme="light"] .chat-document-panel .chat-message-head > strong:not(.chat-root-name):not(.chat-haxcat-name),
html[data-filed-theme="light"] .chat-document-panel .chat-message-head > .chat-profile-name:not(.chat-root-name):not(.chat-haxcat-name),
html[data-filed-theme="light"] .chat-document-panel .chat-online-user > .chat-online-name:not(.chat-root-name):not(.chat-haxcat-name),
html[data-filed-theme="light"] .chat-profile-card .chat-profile-title:not(.chat-root-name):not(.chat-haxcat-name) {
    text-shadow:0 1px 1px rgba(255,255,255,.92), 0 0 2px rgba(32,41,56,.34) !important;
}
html[data-filed-theme="modern"] .chat-document-panel .chat-message-head > strong:not(.chat-root-name):not(.chat-haxcat-name),
html[data-filed-theme="modern"] .chat-document-panel .chat-message-head > .chat-profile-name:not(.chat-root-name):not(.chat-haxcat-name),
html[data-filed-theme="modern"] .chat-document-panel .chat-online-user > .chat-online-name:not(.chat-root-name):not(.chat-haxcat-name),
html[data-filed-theme="modern"] .chat-profile-card .chat-profile-title:not(.chat-root-name):not(.chat-haxcat-name) {
    text-shadow:0 1px 2px rgba(0,0,0,.82), 0 0 3px rgba(0,0,0,.4) !important;
}
html[data-filed-theme="aero"] .chat-document-panel .chat-message-head > strong:not(.chat-root-name):not(.chat-haxcat-name),
html[data-filed-theme="aero"] .chat-document-panel .chat-message-head > .chat-profile-name:not(.chat-root-name):not(.chat-haxcat-name),
html[data-filed-theme="aero"] .chat-document-panel .chat-online-user > .chat-online-name:not(.chat-root-name):not(.chat-haxcat-name),
html[data-filed-theme="aero"] .chat-profile-card .chat-profile-title:not(.chat-root-name):not(.chat-haxcat-name) {
    text-shadow:0 1px 2px rgba(0,10,24,.96), 0 0 4px rgba(0,10,24,.62) !important;
}
html[data-filed-theme="custom"] .chat-document-panel .chat-message-head > strong:not(.chat-root-name):not(.chat-haxcat-name),
html[data-filed-theme="custom"] .chat-document-panel .chat-message-head > .chat-profile-name:not(.chat-root-name):not(.chat-haxcat-name),
html[data-filed-theme="custom"] .chat-document-panel .chat-online-user > .chat-online-name:not(.chat-root-name):not(.chat-haxcat-name),
html[data-filed-theme="custom"] .chat-profile-card .chat-profile-title:not(.chat-root-name):not(.chat-haxcat-name) {
    text-shadow:0 1px 2px rgba(0,0,0,.68), 0 0 1px rgba(255,255,255,.72) !important;
}


/* Filed 1.2.164: complete creator-theme coverage for secondary controls and
   utility surfaces. The original Filed Default is deliberately excluded. */
html[data-filed-theme]:not([data-filed-theme="filed"]) {
    accent-color:var(--theme-accent,#8db8ff);
    scrollbar-color:var(--theme-border,#555555) var(--theme-panel-bg,#181818);
}
html[data-filed-theme="light"],
html[data-filed-theme="win95"] { color-scheme:light; }
html[data-filed-theme="modern"],
html[data-filed-theme="aero"],
html[data-filed-theme="custom"] { color-scheme:normal; }

/* The sound picker used to retain legacy charcoal fills inside every preset.
   Theme both the chooser window and each result/control, not just the shell. */
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page #chat-app .chat-sound-picker {
    color:var(--theme-text,#dddddd) !important;
    background:var(--theme-raised-bg,#1b1b1b) !important;
    border:1px solid var(--theme-border,#555555) !important;
    box-shadow:0 8px 22px rgba(0,0,0,.24) !important;
}
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page #chat-app .chat-sound-picker .chat-emoji-picker-head {
    color:var(--theme-text,#dddddd) !important;
    background:var(--theme-raised-bg,#1b1b1b) !important;
    border-bottom:1px solid var(--theme-divider,#292929) !important;
}
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page #chat-app #chat-sound-search {
    color:var(--theme-text,#dddddd) !important;
    background:var(--theme-input-bg,#080808) !important;
    border:1px solid var(--theme-border,#555555) !important;
    box-shadow:none !important;
}
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page #chat-app #chat-sound-search::placeholder {
    color:var(--theme-muted,#888888) !important;
}
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page #chat-app .chat-sound-results {
    color:var(--theme-text,#dddddd) !important;
    background:transparent !important;
}
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page #chat-app .chat-sound-result {
    color:var(--theme-text,#dddddd) !important;
    background:var(--theme-panel-bg,#181818) !important;
    border:1px solid var(--theme-divider,#292929) !important;
    box-shadow:none !important;
}
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page #chat-app .chat-sound-result-name {
    color:var(--theme-text,#dddddd) !important;
}
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page #chat-app .chat-sound-result-path,
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page #chat-app .chat-sound-picker-help {
    color:var(--theme-muted,#888888) !important;
}
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page #chat-app .chat-sound-result-actions button {
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    min-width:48px !important;
    min-height:28px !important;
    padding:4px 9px !important;
    color:var(--theme-text,#dddddd) !important;
    background:var(--theme-button-bg,#252525) !important;
    border:1px solid var(--theme-border,#555555) !important;
    border-radius:0 !important;
    box-shadow:none !important;
    text-decoration:none !important;
}
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page #chat-app .chat-sound-result-actions button:hover {
    color:var(--theme-text,#dddddd) !important;
    background:var(--theme-button-hover,#303030) !important;
    border-color:var(--theme-accent,#8db8ff) !important;
}

/* Utility popovers, dialogs and floating controls that previously kept
   hard-coded dark fills when opened from secondary pages. */
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page :is(
    .context-menu, .chat-notification-panel, .chat-server-picker, #chat-emoji-picker,
    .chat-sound-picker, .chat-message-actions, .chat-profile-card, .chat-tool-tray,
    .chat-tray, .chat-access-user, .chat-online, .filed-video-controls,
    .stream-controls, .vc-screen-card, .book-reader-menu, .book-reader-settings,
    .modal, .dialog, [role="dialog"]
) {
    color:var(--theme-text,#dddddd) !important;
    background-color:var(--theme-raised-bg,#1b1b1b) !important;
    border-color:var(--theme-border,#555555) !important;
}
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page :is(
    .chat-notification-item, .chat-server-file-row, .chat-emoji-choice,
    .chat-emoji-categories button, .chat-emoji-more, .chat-access-user,
    .chat-message-actions-inline, .chat-reply-quote, .chat-pending-file,
    .chat-sound-embed, .chat-profile-section, .chat-profile-aboutme,
    .role-file-create, .role-file-directory, .role-file-content,
    .notification-sound-slot, .soundboard-item, .soundboard-empty,
    .book-library-card, .book-reader-controls, .book-reader-toolbar,
    .text-editor-header, .text-editor-toolbar, .text-editor-footer,
    .text-editor-source-pane, .text-editor-preview-pane, .filed-split-pane,
    .filed-split-toolbar, .filed-storage-panel, .diag-card, .diag-kpis .filed-storage-stat,
    .arcade-stat, .arcade-leader-card, .arcade-duel-card, .arcade-duel-banner, .arcade-duel-waiting, .atlas-stat, .atlas-card
) {
    color:var(--theme-text,#dddddd) !important;
    background-color:var(--theme-panel-bg,#181818) !important;
    border-color:var(--theme-border,#555555) !important;
}
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page :is(
    .chat-message-head, .chat-message-id, .chat-document-path, .chat-document-user,
    .chat-status, .chat-profile-aboutme-label, .text-editor-preview-status,
    .text-editor-preview-heading, .book-reader-status, .book-reader-page-count,
    .notification-sound-slot label, .role-file-directory .small,
    .soundboard-item .small, .soundboard-help, .diag-axis, .diag-heat th
) { color:var(--theme-muted,#888888) !important; }

/* Secondary controls and native browser widgets use the account palette too. */
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page :is(
    input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]),
    select, textarea
) {
    color:var(--theme-text,#dddddd) !important;
    background-color:var(--theme-input-bg,#080808) !important;
    border-color:var(--theme-border,#555555) !important;
}
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page select option {
    color:var(--theme-text,#dddddd) !important;
    background:var(--theme-raised-bg,#1b1b1b) !important;
}
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page input::placeholder,
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page textarea::placeholder {
    color:var(--theme-muted,#888888) !important;
    opacity:1;
}
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page input[type="checkbox"],
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page input[type="radio"],
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page input[type="range"] {
    accent-color:var(--theme-accent,#8db8ff) !important;
}
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page button:not(.quiet-button):not(.chat-profile-name),
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page .button,
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page input.button {
    color:var(--theme-text,#dddddd) !important;
    background-color:var(--theme-button-bg,#252525) !important;
    border-color:var(--theme-border,#555555) !important;
}
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page button:not(.quiet-button):not(.chat-profile-name):hover,
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page .button:hover,
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page input.button:hover {
    background-color:var(--theme-button-hover,#303030) !important;
}
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page .quiet-button {
    color:var(--theme-link,#9bbcff) !important;
}
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page .quiet-button:hover {
    color:var(--theme-link-hover,#c5d8ff) !important;
}

/* File tables, badges, progress, readers and media chrome. Document/media
   payloads themselves are intentionally not recolored. */
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page .file-table th,
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page .filed-storage-table th,
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page .folder-owners-table th {
    color:var(--theme-table-heading,#888888) !important;
    background-color:var(--theme-raised-bg,#1b1b1b) !important;
    border-color:var(--theme-divider,#292929) !important;
}
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page .file-table td,
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page .filed-storage-table td,
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page .folder-owners-table td {
    color:var(--theme-text,#dddddd) !important;
    background-color:var(--theme-panel-bg,#181818) !important;
    border-color:var(--theme-divider,#292929) !important;
}
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page .file-table tbody tr:hover td,
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page .chat-online-user:hover,
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page .chat-notification-item:hover {
    background-color:var(--theme-row-hover,#171717) !important;
}
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page :is(
    .file-tag, .vc-folder-badge, .filed-playlist-badge, .account-role,
    .role-file-badge, .chat-mention, .chat-reply-quote, .chat-sound-embed,
    .filed-storage-stat, .upload-progress-track, .chat-progress-track
) { border-color:var(--theme-border,#555555) !important; }
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page :is(
    .upload-progress-track, .chat-progress-track, .filed-storage-bar,
    .filed-video-progress, .book-reader-progress, .chat-file-progress
) { background-color:var(--theme-panel-bg,#181818) !important; }
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page :is(
    .upload-progress-bar, .chat-progress-bar, .filed-storage-bar > span,
    .filed-video-progress > span, .book-reader-progress > span,
    .chat-file-progress > span
) { background-color:var(--theme-accent,#8db8ff) !important; }
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page :is(
    .soundboard-item audio, audio, video, .filed-video-player,
    .filed-video-frame, .filed-video-frame video
) { color-scheme:inherit; }
html[data-filed-theme]:not([data-filed-theme="filed"]) body #page :is(
    .filed-video-player, .filed-video-frame, .chat-video-embed,
    .chat-video-preview, .chat-attachment .chat-video-embed
) { background-color:var(--theme-media-bg,#000000) !important; }

/* The Windows 95 controls keep their raised/inset chrome while taking colors
   from the same editable palette. */
html[data-filed-theme="win95"] body #page :is(
    .chat-sound-picker, .chat-server-picker, #chat-emoji-picker,
    .context-menu, .chat-profile-card, .chat-notification-panel
) {
    border:2px outset #dfdfdf !important;
    box-shadow:none !important;
}
html[data-filed-theme="win95"] body #page .chat-sound-result {
    border:1px solid #808080 !important;
}
html[data-filed-theme="win95"] body #page .chat-sound-result-actions button {
    border:2px outset #ffffff !important;
}
html[data-filed-theme="win95"] body #page .chat-sound-result-actions button:active {
    border-style:inset !important;
}

/* Aero extends its glass treatment to every newly covered utility surface,
   including individual sound rows and their preview/insert controls. */
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page #chat-app .chat-sound-picker {
    color:#eef8ff !important;
    background:linear-gradient(145deg,rgba(184,226,255,.18),rgba(20,75,112,.42) 42%,rgba(4,30,54,.78)) !important;
    border:1px solid rgba(178,225,255,.72) !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.3),0 8px 22px rgba(0,12,28,.38) !important;
    -webkit-backdrop-filter:blur(14px) saturate(155%);
    backdrop-filter:blur(14px) saturate(155%);
}
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page :is(
    .chat-sound-picker, .chat-notification-panel, .chat-server-picker,
    #chat-emoji-picker, .context-menu, .chat-profile-card, .chat-tool-tray,
    .chat-tray, .chat-message-actions, .book-reader-menu, .book-reader-settings,
    .modal, .dialog, [role="dialog"]
) {
    color:#eef8ff !important;
    background:linear-gradient(145deg,rgba(184,226,255,.15),rgba(20,75,112,.38) 42%,rgba(4,30,54,.78)) !important;
    border:1px solid rgba(178,225,255,.68) !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.28),0 8px 22px rgba(0,12,28,.34) !important;
    -webkit-backdrop-filter:blur(14px) saturate(155%);
    backdrop-filter:blur(14px) saturate(155%);
}
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page #chat-app .chat-sound-result {
    color:#f1f8ff !important;
    background:linear-gradient(125deg,rgba(184,226,255,.16),rgba(16,62,96,.54)) !important;
    border:1px solid rgba(161,216,250,.42) !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.18) !important;
}
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page #chat-app .chat-sound-picker .chat-emoji-picker-head {
    color:#f4faff !important;
    background:rgba(10,48,77,.62) !important;
    border-color:rgba(161,216,250,.4) !important;
}
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page #chat-app #chat-sound-search {
    color:#f1f8ff !important;
    background:rgba(3,28,49,.68) !important;
    border:1px solid rgba(160,215,249,.68) !important;
}
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page #chat-app .chat-sound-result-name,
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page #chat-app .chat-sound-result-actions button {
    color:#f5fbff !important;
}
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page #chat-app .chat-sound-result-path,
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page #chat-app .chat-sound-picker-help {
    color:#c1def2 !important;
}
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page #chat-app .chat-sound-result-actions button {
    background:linear-gradient(180deg,rgba(220,244,255,.38),rgba(52,129,178,.52) 48%,rgba(13,59,94,.82)) !important;
    border:1px solid rgba(196,231,255,.8) !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.42),0 2px 5px rgba(0,14,30,.2) !important;
}
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page #chat-app .chat-sound-result-actions button:hover {
    background:linear-gradient(180deg,rgba(239,250,255,.58),rgba(82,165,216,.62) 48%,rgba(24,94,143,.88)) !important;
}
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page :is(
    .account-card, .soundboard-item, .book-library-card, .role-file-create,
    .role-file-directory, .chat-profile-section, .chat-profile-aboutme,
    .text-editor-header, .text-editor-toolbar, .text-editor-footer,
    .text-editor-source-pane, .text-editor-preview-pane, .filed-split-pane,
    .filed-split-toolbar, .diag-card, .notification-sound-slot,
    .arcade-stat, .arcade-leader-card, .arcade-duel-card, .arcade-duel-banner, .arcade-duel-waiting, .atlas-stat, .atlas-card
) {
    color:#eef8ff !important;
    background:linear-gradient(145deg,rgba(181,224,255,.1),rgba(14,58,91,.38) 48%,rgba(4,29,51,.58)) !important;
    border-color:rgba(164,220,255,.45) !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.14) !important;
    -webkit-backdrop-filter:blur(10px) saturate(145%);
    backdrop-filter:blur(10px) saturate(145%);
}
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page :is(
    .chat-message-actions-inline button, .chat-emoji-categories button,
    .chat-emoji-choice, .chat-emoji-more, .chat-server-file-row button,
    .chat-sound-embed, .notification-sound-preview
) {
    color:#f2f9ff !important;
    background:linear-gradient(180deg,rgba(210,240,255,.35),rgba(42,112,157,.48)) !important;
    border-color:rgba(185,228,255,.62) !important;
}

/* Preserve Aero's translucency after the comprehensive variable fallbacks
   above; these selectors intentionally win over the generic theme layer. */
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page :is(
    .file-table th, .filed-storage-table th, .folder-owners-table th
) {
    color:#f2f9ff !important;
    background:linear-gradient(180deg,rgba(190,230,255,.34),rgba(54,122,166,.34)) !important;
    border-color:rgba(170,222,252,.38) !important;
}
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page :is(
    .file-table td, .filed-storage-table td, .folder-owners-table td
) {
    color:#eaf6ff !important;
    background:rgba(6,29,50,.2) !important;
    border-color:rgba(150,203,237,.22) !important;
}
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page button:not(.quiet-button):not(.chat-profile-name),
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page .button,
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page input.button {
    color:#f7fbff !important;
    background:linear-gradient(180deg,rgba(210,240,255,.42),rgba(55,132,181,.44) 48%,rgba(17,71,113,.7)) !important;
    border:1px solid rgba(193,230,255,.76) !important;
    border-radius:6px !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.5),0 2px 6px rgba(0,14,30,.25) !important;
    text-shadow:0 1px 2px rgba(0,20,40,.48) !important;
}
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page button:not(.quiet-button):not(.chat-profile-name):hover,
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page .button:hover,
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page input.button:hover {
    background:linear-gradient(180deg,rgba(230,248,255,.58),rgba(82,165,216,.55) 48%,rgba(24,94,143,.76)) !important;
    border-color:rgba(225,246,255,.92) !important;
}
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]),
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page select,
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page textarea {
    color:#f1f8ff !important;
    background:rgba(4,27,47,.68) !important;
    border:1px solid rgba(147,207,244,.7) !important;
    border-radius:6px !important;
    box-shadow:inset 0 1px 5px rgba(0,10,24,.32),0 1px 0 rgba(255,255,255,.12) !important;
}
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page input::placeholder,
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page textarea::placeholder {
    color:#b7d4e8 !important;
}
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page :is(
    .chat-notification-item, .chat-server-file-row, .chat-access-user,
    .chat-reply-quote, .chat-pending-file, .book-reader-controls,
    .role-file-badge, .account-role, .filed-storage-stat
) {
    color:#eef8ff !important;
    background:linear-gradient(145deg,rgba(184,226,255,.13),rgba(13,56,88,.4) 52%,rgba(4,29,51,.56)) !important;
    border-color:rgba(164,220,255,.4) !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.13) !important;
    -webkit-backdrop-filter:blur(9px) saturate(145%);
    backdrop-filter:blur(9px) saturate(145%);
}
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page .file-table tbody tr:hover td,
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page .chat-online-user:hover,
html[data-filed-theme="aero"]:not([data-filed-theme="filed"]) body #page .chat-notification-item:hover {
    background:rgba(105,185,235,.22) !important;
}

/* Emoji picker layout. Older .chat-page / .chat-document-panel rules forced the grid back to
   display:flex, which stretched built-in emoji into full-width bars (.chat-emoji-choice is
   width:100%) and let custom-emoji tiles size themselves to their "Edit image" label. One grid
   definition now wins everywhere, every tile is the same square cell, and the edit control is a
   small corner badge instead of a text link under the tile. */
html body #page .chat-emoji-grid {
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(40px,1fr));
    grid-auto-rows:min-content;
    align-items:start;
    justify-items:stretch;
    gap:4px;
    max-height:230px;
    overflow-x:hidden;
    overflow-y:auto;
    padding:2px;
}
html body #page .chat-emoji-grid .chat-emoji-choice {
    box-sizing:border-box;
    display:flex;
    align-items:center;
    justify-content:center;
    width:100%;
    min-width:0;
    height:40px;
    min-height:40px;
    padding:2px;
    line-height:1;
}
html body #page .chat-emoji-grid .chat-emoji-item {
    position:relative;
    display:block;
    min-width:0;
}
html body #page .chat-emoji-grid .chat-emoji-item .chat-custom-emoji { width:26px; height:26px; }
html body #page .chat-emoji-grid .chat-emoji-edit {
    position:absolute;
    top:1px;
    right:1px;
    box-sizing:border-box;
    width:16px;
    height:16px;
    min-height:0;
    margin:0;
    padding:0 !important;
    font-size:0 !important;
    line-height:16px;
    text-align:center;
    text-decoration:none;
    color:#dddddd;
    background:rgba(0,0,0,.7);
    border:1px solid #555555;
    border-radius:0;
    opacity:.75;
    cursor:pointer;
}
html body #page .chat-emoji-grid .chat-emoji-edit::before { content:"\270E"; font-size:11px; }
html body #page .chat-emoji-grid .chat-emoji-edit:hover,
html body #page .chat-emoji-grid .chat-emoji-edit:focus-visible { opacity:1; border-color:#9bbcff; color:#ffffff; outline:none; }
html body #page .chat-emoji-grid .chat-emoji-more,
html body #page .chat-emoji-grid .chat-emoji-empty { grid-column:1 / -1; }
html body #page .chat-emoji-grid .chat-emoji-empty { color:#aaaaaa; font-size:12px; padding:6px 2px; }

/* Filed 1.2.168: Aero Glass keeps its translucent chrome, but its colors now
   come from the same per-account palette as every other creator theme. */
html[data-filed-theme="aero"] body {
    color:var(--theme-text,#f1f8ff) !important;
    background:
        radial-gradient(ellipse at 18% 0%, color-mix(in srgb,var(--theme-accent,#77caff) 34%,transparent), transparent 44%),
        radial-gradient(ellipse at 88% 24%, color-mix(in srgb,var(--theme-link,#b9e7ff) 22%,transparent), transparent 42%),
        linear-gradient(145deg,
            color-mix(in srgb,var(--theme-page-bg,#09233d) 88%,#000 12%) 0%,
            var(--theme-page-bg,#09233d) 48%,
            color-mix(in srgb,var(--theme-page-bg,#09233d) 76%,#000 24%) 100%) fixed !important;
    background-attachment:fixed !important;
}
html[data-filed-theme="aero"] #page {
    color:var(--theme-text,#f1f8ff) !important;
    background:transparent !important;
}

/* Glass windows and cards use the selected panel colors as translucent tints. */
html[data-filed-theme="aero"] body #page :is(
    .account-card, .tools, .file-toolbar, .chat-main, .chat-files, .vc-main,
    #filed-vc, .chat-document-panel, .chat-file-open-panel, .chat-filesystem-list,
    .text-editor-shell, .text-editor-source-pane, .text-editor-preview-pane,
    .filed-split-pane, .book-library-dashboard, .account-theme-preview,
    .admin-settings, .share-link-form, .context-menu, .file-background-context-menu,
    .filed-vmenu, .create-folder-panel, .create-menu-panel, .create-text-panel,
    .meme-maker, .meme-image-library-panel, .meme-preview-panel,
    .filed-storage-panel, .account-role-picker, .chat-meme-picker
) {
    color:var(--theme-text,#f1f8ff) !important;
    background:linear-gradient(145deg,
        color-mix(in srgb,var(--theme-panel-bg,#17466c) 78%,transparent),
        color-mix(in srgb,var(--theme-raised-bg,#285c83) 58%,transparent)) !important;
    border-color:color-mix(in srgb,var(--theme-border,#8acdf0) 78%,transparent) !important;
    box-shadow:inset 0 1px 0 color-mix(in srgb,var(--theme-text,#f1f8ff) 22%,transparent),
        0 8px 24px rgba(0,12,28,.25) !important;
    -webkit-backdrop-filter:blur(14px) saturate(150%);
    backdrop-filter:blur(14px) saturate(150%);
}
html[data-filed-theme="aero"] body #page :is(
    .chat-header, .chat-document-toolbar, .text-editor-header, .text-editor-toolbar,
    .text-editor-footer, .filed-split-toolbar, .book-reader-toolbar,
    .book-reader-controls, .chat-compose, .meme-maker-head
) {
    color:var(--theme-text,#f1f8ff) !important;
    background:linear-gradient(180deg,
        color-mix(in srgb,var(--theme-button-hover,#4286b4) 62%,transparent) 0%,
        color-mix(in srgb,var(--theme-button-bg,#2a6998) 72%,transparent) 52%,
        color-mix(in srgb,var(--theme-panel-bg,#17466c) 82%,transparent) 100%) !important;
    border-color:color-mix(in srgb,var(--theme-border,#8acdf0) 82%,transparent) !important;
    box-shadow:inset 0 1px 0 color-mix(in srgb,var(--theme-text,#f1f8ff) 28%,transparent),
        0 3px 12px rgba(0,12,28,.2) !important;
}

/* Every normal text surface follows the editable foreground and muted colors. */
html[data-filed-theme="aero"] body #page :is(
    .account-card, .tools, .file-toolbar, .chat-main, .chat-files, .vc-main,
    .chat-document-panel, .chat-file-open-panel, .chat-filesystem-list,
    .text-editor-shell, .text-editor-source-pane, .text-editor-preview-pane,
    .filed-split-pane, .book-library-dashboard, .account-theme-preview,
    .admin-settings, .share-link-form, .context-menu, .filed-vmenu,
    .create-folder-panel, .create-menu-panel, .create-text-panel,
    .meme-maker, .meme-image-library-panel, .meme-preview-panel,
    .filed-storage-panel, .account-role-picker
) :is(p, label, strong, b, h1, h2, h3, h4, th, td, summary, legend, dt, dd) {
    color:var(--theme-text,#f1f8ff);
}
html[data-filed-theme="aero"] body #page :is(
    .small, small, .muted, .chat-message-id, .chat-document-path,
    .chat-document-user, .chat-status, .meme-maker-head p,
    .meme-preview-label, .meme-preview-foot, .meme-maker-status,
    .meme-image-library-head, .meme-library-empty, .meme-library-note
) {
    color:var(--theme-muted,#bad3e8) !important;
}
html[data-filed-theme="aero"] body #page a:not(.quiet-button):not(.button) {
    color:var(--theme-link,#b9e7ff) !important;
}
html[data-filed-theme="aero"] body #page a:not(.quiet-button):not(.button):hover {
    color:var(--theme-link-hover,#ffffff) !important;
}
html[data-filed-theme="aero"] body #page .quiet-button {
    color:var(--theme-link,#b9e7ff) !important;
}
html[data-filed-theme="aero"] body #page .quiet-button:hover {
    color:var(--theme-link-hover,#ffffff) !important;
}
html[data-filed-theme="aero"] body #page .quiet-button {
    background:transparent !important;
    border-color:transparent !important;
    box-shadow:none !important;
    text-shadow:none !important;
}

/* Tables, rows, chips and overlays retain the glass treatment with palette tints. */
html[data-filed-theme="aero"] body #page :is(.file-table,.filed-storage-table,.folder-owners-table) {
    color:var(--theme-text,#f1f8ff) !important;
    background:color-mix(in srgb,var(--theme-panel-bg,#17466c) 48%,transparent) !important;
    border-color:var(--theme-border,#8acdf0) !important;
}
html[data-filed-theme="aero"] body #page :is(.file-table,.filed-storage-table,.folder-owners-table) th {
    color:var(--theme-table-heading,#c6dff0) !important;
    background:linear-gradient(180deg,
        color-mix(in srgb,var(--theme-button-hover,#4286b4) 55%,transparent),
        color-mix(in srgb,var(--theme-button-bg,#2a6998) 48%,transparent)) !important;
    border-color:color-mix(in srgb,var(--theme-border,#8acdf0) 55%,transparent) !important;
}
html[data-filed-theme="aero"] body #page :is(.file-table,.filed-storage-table,.folder-owners-table) td {
    color:var(--theme-text,#f1f8ff) !important;
    background:color-mix(in srgb,var(--theme-panel-bg,#17466c) 30%,transparent) !important;
    border-color:color-mix(in srgb,var(--theme-divider,#3b6e91) 55%,transparent) !important;
}
html[data-filed-theme="aero"] body #page :is(
    .file-table tbody tr:hover td, .chat-online-user:hover,
    .chat-notification-item:hover, .meme-image-card:hover,
    .meme-image-card.is-selected
) {
    background:color-mix(in srgb,var(--theme-row-hover,#2c638b) 58%,transparent) !important;
}
html[data-filed-theme="aero"] body #page :is(
    .chat-notification-item, .chat-server-file-row, .chat-access-user,
    .chat-reply-quote, .chat-pending-file, .book-reader-controls,
    .role-file-badge, .account-role, .filed-storage-stat,
    .soundboard-item, .book-library-card, .notification-sound-slot,
    .arcade-stat, .arcade-leader-card, .arcade-duel-card, .arcade-duel-banner, .arcade-duel-waiting, .atlas-stat, .atlas-card
) {
    color:var(--theme-text,#f1f8ff) !important;
    background:linear-gradient(145deg,
        color-mix(in srgb,var(--theme-panel-bg,#17466c) 62%,transparent),
        color-mix(in srgb,var(--theme-raised-bg,#285c83) 42%,transparent)) !important;
    border-color:color-mix(in srgb,var(--theme-border,#8acdf0) 62%,transparent) !important;
}
html[data-filed-theme="aero"] body #page :is(.chat-mention,.chat-reply-quote) {
    background:color-mix(in srgb,var(--theme-mention-bg,#194b70) 76%,transparent) !important;
    color:var(--theme-mention-text,#d5f0ff) !important;
}
html[data-filed-theme="aero"] body #page .chat-reply-quote {
    border-left-color:var(--theme-quote-accent,#8bd5ff) !important;
}

/* Controls take their colors from the palette without losing Aero's highlights. */
html[data-filed-theme="aero"] body #page :is(
    input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]),
    select, textarea
) {
    color:var(--theme-text,#f1f8ff) !important;
    background:color-mix(in srgb,var(--theme-input-bg,#0a2b47) 82%,transparent) !important;
    border-color:color-mix(in srgb,var(--theme-border,#8acdf0) 78%,transparent) !important;
    box-shadow:inset 0 1px 5px rgba(0,10,24,.24),0 1px 0 rgba(255,255,255,.1) !important;
}
html[data-filed-theme="aero"] body #page :is(input,textarea)::placeholder {
    color:var(--theme-muted,#bad3e8) !important;
}
html[data-filed-theme="aero"] body #page input[type="checkbox"],
html[data-filed-theme="aero"] body #page input[type="radio"],
html[data-filed-theme="aero"] body #page input[type="range"] {
    accent-color:var(--theme-accent,#77caff) !important;
}
html[data-filed-theme="aero"] body #page input[type="range"] {
    background:transparent !important;
    border:0 !important;
    box-shadow:none !important;
}
html[data-filed-theme="aero"] body #page button:not(.quiet-button):not(.chat-profile-name),
html[data-filed-theme="aero"] body #page .button,
html[data-filed-theme="aero"] body #page input.button {
    color:var(--theme-text,#f1f8ff) !important;
    background:linear-gradient(180deg,
        color-mix(in srgb,var(--theme-button-hover,#4286b4) 72%,transparent),
        color-mix(in srgb,var(--theme-button-bg,#2a6998) 78%,transparent) 52%,
        color-mix(in srgb,var(--theme-panel-bg,#17466c) 82%,transparent)) !important;
    border-color:color-mix(in srgb,var(--theme-border,#8acdf0) 82%,transparent) !important;
    box-shadow:inset 0 1px 0 color-mix(in srgb,var(--theme-text,#f1f8ff) 35%,transparent),
        0 2px 6px rgba(0,14,30,.2) !important;
    text-shadow:0 1px 2px rgba(0,20,40,.28) !important;
}
html[data-filed-theme="aero"] body #page button:not(.quiet-button):not(.chat-profile-name):hover,
html[data-filed-theme="aero"] body #page .button:hover,
html[data-filed-theme="aero"] body #page input.button:hover {
    background:linear-gradient(180deg,
        color-mix(in srgb,var(--theme-button-hover,#4286b4) 88%,transparent),
        color-mix(in srgb,var(--theme-accent,#77caff) 40%,var(--theme-button-bg,#2a6998)) 52%,
        color-mix(in srgb,var(--theme-button-bg,#2a6998) 84%,transparent)) !important;
    border-color:var(--theme-accent,#77caff) !important;
}
html[data-filed-theme="aero"] body #page select option {
    color:var(--theme-text,#f1f8ff) !important;
    background:var(--theme-raised-bg,#285c83) !important;
}
html[data-filed-theme="aero"] body #page ::selection {
    color:var(--theme-selection-text,#ffffff);
    background:var(--theme-selection-bg,#276da5);
}

/* Semantic states, focus, progress and badges also use the selected palette. */
html[data-filed-theme="aero"] body #page :is(.success,.text-success,.status-success) { color:var(--theme-success,#9be6ba) !important; }
html[data-filed-theme="aero"] body #page :is(.error,.text-error,.status-error,.is-error) { color:var(--theme-error,#ffaaaa) !important; }
html[data-filed-theme="aero"] body #page :is(.warning,.text-warning,.status-warning) { color:var(--theme-warning,#ffe09a) !important; }
html[data-filed-theme="aero"] body #page :is(.danger,.text-danger,.status-danger) { color:var(--theme-danger,#ffb0a6) !important; }
html[data-filed-theme="aero"] body #page :is(
    .upload-progress-track,.chat-progress-track,.filed-storage-bar,
    .filed-video-progress,.book-reader-progress,.chat-file-progress
) {
    background:color-mix(in srgb,var(--theme-panel-bg,#17466c) 64%,transparent) !important;
    border-color:var(--theme-border,#8acdf0) !important;
}
html[data-filed-theme="aero"] body #page :is(
    .upload-progress-bar,.chat-progress-bar,.filed-storage-bar > span,
    .filed-video-progress > span,.book-reader-progress > span,.chat-file-progress > span
) { background:var(--theme-accent,#77caff) !important; }
html[data-filed-theme="aero"] body #page :is(.chat-notification-badge,.notification-badge) {
    color:var(--theme-selection-text,#ffffff) !important;
    background:var(--theme-notification,#e86d86) !important;
}
html[data-filed-theme="aero"] body #page :is(.chat-quote,.quote-block) {
    border-left-color:var(--theme-quote-accent,#8bd5ff) !important;
}


/* The chat meme composer is portaled directly under body while fullscreen, so
   give that layer the same palette treatment as the standalone page. */
html[data-filed-theme="aero"] body #chat-meme-picker.chat-meme-fullscreen {
    color:var(--theme-text,#f1f8ff) !important;
    background:linear-gradient(145deg,
        color-mix(in srgb,var(--theme-page-bg,#09233d) 94%,#000 6%),
        var(--theme-page-bg,#09233d)) !important;
    border-color:var(--theme-border,#8acdf0) !important;
}
html[data-filed-theme="aero"] body #chat-meme-picker.chat-meme-fullscreen .chat-meme-fullscreen-head {
    color:var(--theme-text,#f1f8ff) !important;
    background:linear-gradient(180deg,
        color-mix(in srgb,var(--theme-button-hover,#4286b4) 62%,transparent),
        color-mix(in srgb,var(--theme-panel-bg,#17466c) 82%,transparent)) !important;
    border-bottom-color:var(--theme-border,#8acdf0) !important;
}
html[data-filed-theme="aero"] body #chat-meme-picker.chat-meme-fullscreen .meme-maker {
    color:var(--theme-text,#f1f8ff) !important;
    background:transparent !important;
}
html[data-filed-theme="aero"] body #chat-meme-picker.chat-meme-fullscreen :is(
    .meme-image-library-panel,.meme-preview-panel,.meme-control-group
) {
    color:var(--theme-text,#f1f8ff) !important;
    background:linear-gradient(145deg,
        color-mix(in srgb,var(--theme-panel-bg,#17466c) 78%,transparent),
        color-mix(in srgb,var(--theme-raised-bg,#285c83) 52%,transparent)) !important;
    border-color:color-mix(in srgb,var(--theme-border,#8acdf0) 72%,transparent) !important;
}
html[data-filed-theme="aero"] body #chat-meme-picker.chat-meme-fullscreen :is(
    .meme-maker-controls,.meme-control-group-head,.meme-maker-controls label,
    .meme-text-layers-head,.meme-preview-label,.meme-preview-foot,.meme-maker-status
) { color:var(--theme-text,#f1f8ff) !important; }
html[data-filed-theme="aero"] body #chat-meme-picker.chat-meme-fullscreen :is(
    .meme-maker-head p,.meme-library-empty,.meme-library-note,.meme-preview-foot
) { color:var(--theme-muted,#bad3e8) !important; }
html[data-filed-theme="aero"] body #chat-meme-picker.chat-meme-fullscreen .meme-extra-text-size-control input[type="range"],
html[data-filed-theme="aero"] body #chat-meme-picker.chat-meme-fullscreen .meme-caption-size-control input[type="range"] {
    accent-color:var(--theme-accent,#77caff) !important;
}
html[data-filed-theme="aero"] body #chat-meme-picker.chat-meme-fullscreen .meme-canvas-wrap {
    border-color:var(--theme-border,#8acdf0) !important;
    background-color:var(--theme-media-bg,#071b2d) !important;
}
html[data-filed-theme="aero"] body #chat-meme-picker.chat-meme-fullscreen .quiet-button {
    color:var(--theme-link,#b9e7ff) !important;
    background:transparent !important;
    border-color:transparent !important;
    box-shadow:none !important;
}
html[data-filed-theme="aero"] body #chat-meme-picker.chat-meme-fullscreen .quiet-button:hover {
    color:var(--theme-link-hover,#ffffff) !important;
}

/* Remaining palette slots that are used by less common page elements. */
html[data-filed-theme="aero"] body #page a:visited { color:var(--theme-visited,#d6b4ff) !important; }
html[data-filed-theme="aero"] body #page :is(pre,code,kbd,samp) { color:var(--theme-code-text,#e0f1ff) !important; }
html[data-filed-theme="aero"] body #page :is(.drop-target,.is-drop-target,[data-drop-target="true"]) {
    background:color-mix(in srgb,var(--theme-drop-bg,#174f50) 78%,transparent) !important;
    border-color:var(--theme-drop-border,#8be0cf) !important;
}
html[data-filed-theme="aero"] body #page :is(
    .filed-video-player,.filed-video-frame,.chat-video-embed,
    .chat-video-preview,.chat-attachment .chat-video-embed
) { background:var(--theme-media-bg,#071b2d) !important; }
html[data-filed-theme="aero"] body #page :is(
    .file-toolbar,.chat-header,.text-editor-toolbar,.text-editor-footer,
    .filed-split-toolbar,.filed-storage-panel
) { border-color:color-mix(in srgb,var(--theme-subtle-border,#477a9d) 78%,transparent) !important; }

/* Song details popup: use a float/inline-block layout first so older browsers
   remain readable; supported browsers enhance it with grid/flex below. */
.chat-song-card { width:520px !important; }
.chat-song-content { display:block; overflow:hidden; padding:15px; }
.chat-song-cover { float:left; margin:0 14px 10px 0; max-width:100%; }
.chat-song-details { display:block; overflow:hidden; }
.chat-song-detail { display:inline-block; vertical-align:top; width:47%; margin:0 1% 10px 0; }
.chat-song-location { clear:both; display:block; margin-top:10px; }
.chat-song-actions { display:block; }
.chat-song-actions a { margin:0 8px 6px 0; }
.chat-song-card .chat-song-detail > strong,
.chat-song-location code { word-wrap:break-word; }
.chat-song-card .chat-profile-head { align-items:center; }
.chat-song-byline { color:var(--filed-ui-muted,#999); font:11px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace; }
.chat-song-content { display:grid; grid-template-columns:minmax(0,1fr); gap:14px; padding:15px; min-height:0; }
.chat-song-card.has-cover .chat-song-content { grid-template-columns:92px minmax(0,1fr); }
.chat-song-cover { display:block; width:92px; height:92px; object-fit:cover; border:1px solid #444; background:#090909; }
.chat-song-details { display:grid; grid-template-columns:1fr 1fr; gap:10px 16px; min-width:0; align-content:start; }
.chat-song-detail { display:flex; flex-direction:column; gap:4px; min-width:0; }
.chat-song-detail > span, .chat-song-location > span { color:#888; font:9px/1.3 ui-monospace,SFMono-Regular,Consolas,monospace; letter-spacing:.1em; }
.chat-song-detail > strong { color:#ddd; font:12px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace; overflow-wrap:anywhere; }
.chat-song-location { grid-column:1 / -1; display:flex; flex-direction:column; gap:6px; min-width:0; padding-top:10px; border-top:1px solid #303030; }
.chat-song-location code { color:#bbb; background:#090909; border-left:2px solid #666; padding:8px 9px; font:11px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace; overflow-wrap:anywhere; white-space:pre-wrap; }
.chat-song-actions { grid-column:1 / -1; display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding-top:2px; }
.chat-song-actions a { display:inline-block; padding:6px 10px; color:#ddd; background:#242424; border:1px solid #555; text-decoration:none; font:11px/1.3 ui-monospace,SFMono-Regular,Consolas,monospace; }
.chat-song-actions a:hover { color:#fff; background:#303030; border-color:#888; }
.chat-song-actions .small { color:#888; font-size:10px; }
.chat-listening, .chat-online-listening { cursor:pointer; }
.chat-listening:hover, .chat-online-listening:hover { color:var(--links-link,#b9caff); text-decoration:underline; }
.chat-listening:focus-visible, .chat-online-listening:focus-visible { outline:1px solid var(--links-link,#b9caff); outline-offset:2px; }
@media (max-width:560px) {
    .chat-song-card.has-cover .chat-song-content { grid-template-columns:70px minmax(0,1fr); }
    .chat-song-content { gap:10px; padding:11px; }
    .chat-song-cover { width:70px; height:70px; }
    .chat-song-details { gap:8px 10px; }
    .chat-song-detail > strong { font-size:11px; }
}

/* Filed 1.2.182: About Me sona image (account picker + profile card). Square corners, link-style controls. */
.account-sona { margin-top:14px; padding-top:12px; border-top:1px solid var(--links-rule); }
.account-sona h4 { margin:0 0 8px; font-size:13px; }
.account-sona-current { display:flex; align-items:center; min-height:48px; margin:0 0 10px; color:var(--links-muted); font-size:12px; }
.account-sona-current img { display:block; width:140px; height:140px; object-fit:cover; border:1px solid var(--links-rule); }
.account-sona-form { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; }
.account-sona-form label { color:var(--links-text); font-size:12px; }
.account-sona-form input[type=file] { max-width:100%; }
.account-sona-form .small { flex-basis:100%; }
.account-sona-crop { flex-basis:100%; }
.account-sona-crop canvas { display:block; width:280px; max-width:100%; height:auto; touch-action:none; cursor:grab; border:1px solid var(--links-rule);
    background:#1a1a1a repeating-conic-gradient(#222 0% 25%, #181818 0% 50%) 50% / 16px 16px; }
.account-sona-crop canvas:active { cursor:grabbing; }
.account-sona-tools { display:grid; grid-template-columns:auto minmax(120px,280px); gap:6px 10px; align-items:center; margin-top:8px; max-width:420px; }
.account-sona-tools input[type=range] { width:100%; }
.account-sona-tools .account-sona-links, .account-sona-tools .account-sona-original, .account-sona-tools .small { grid-column:1 / -1; }
.account-sona-clear-form { margin-top:8px; }
.chat-profile-sona { margin:0 0 12px; }
.chat-profile-sona img { display:block; width:220px; height:220px; max-width:100%; object-fit:cover; border:1px solid #444; background:#0c0c0c; }
.account-sona-links a { margin-right:14px; }

/* Filed 1.2.185: the profile card body scrolls as one piece, so a sona image above a long About Me
   can never push the text out of reach. The About Me text no longer scrolls on its own. */
html body #page #chat-profile-overlay .chat-profile-card .chat-profile-section {
    display:block !important;
    flex:1 1 auto !important;
    min-height:0 !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    -webkit-overflow-scrolling:touch;
}
html body #page #chat-profile-overlay .chat-profile-card .chat-profile-aboutme {
    max-height:none !important;
    overflow:visible !important;
}
html body #page #chat-profile-overlay .chat-profile-sona img {
    width:220px !important;
    height:220px !important;
    max-width:100% !important;
    max-height:40vh;
    object-fit:cover;
}

/* Pinned messages bar (links, square corners) */
.chat-pin-bar { margin: 0 0 6px 0; padding: 4px 8px; background: #181818; border: 1px solid #333333; border-radius: 0; font-size: 13px; }
.chat-pin-bar button { background: none; border: 0; border-radius: 0; padding: 0; margin: 0; color: #9bbcff; font: inherit; cursor: pointer; text-decoration: underline; }
.chat-pin-bar button:hover { color: #c5d8ff; }
.chat-pin-list { margin-top: 4px; max-height: 160px; overflow-y: auto; }
.chat-pin-row { display: flex; gap: 10px; align-items: baseline; padding: 2px 0; border-top: 1px solid #292929; }
.chat-pin-jump { flex: 1 1 auto; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-pin-remove { flex: 0 0 auto; color: #888888; }

/* ---- In-page upload tray (no popup window) ---- */
.filed-upload-tray { position: fixed; right: 16px; bottom: 16px; z-index: 9000; width: min(360px, calc(100vw - 32px)); max-height: 60vh; display: flex; flex-direction: column; background: #161616; color: #e6e6e6; border: 1px solid #3a3a3a; border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,0.5); font: 13px/1.35 system-ui, -apple-system, "Segoe UI", sans-serif; overflow: hidden; }
.filed-upload-tray .fut-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 8px 12px; border-bottom: 1px solid #2b2b2b; }
.filed-upload-tray .fut-min { background: none; border: 0; color: #aaa; font-size: 16px; line-height: 1; cursor: pointer; padding: 2px 8px; border-radius: 6px; }
.filed-upload-tray .fut-min:hover { background: #2a2a2a; color: #fff; }
.filed-upload-tray.is-collapsed .fut-list { display: none; }
.filed-upload-tray .fut-list { overflow-y: auto; padding: 4px 0; }
.filed-upload-tray .fut-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 8px 12px; }
.filed-upload-tray .fut-row + .fut-row { border-top: 1px solid #242424; }
.filed-upload-tray .fut-title { grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.filed-upload-tray .fut-bar { grid-column: 1 / -1; height: 5px; background: #2a2a2a; border-radius: 3px; overflow: hidden; }
.filed-upload-tray .fut-bar span { display: block; height: 100%; width: 0; background: #7ca6e8; transition: width 0.25s ease-out; }
.filed-upload-tray .is-done .fut-bar span { background: #5cc48a; }
.filed-upload-tray .is-error .fut-bar span { background: #e06c6c; }
.filed-upload-tray .is-queued .fut-bar span { background: #555; }
.filed-upload-tray .fut-meta { grid-column: 1; color: #a8a8a8; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filed-upload-tray .is-error .fut-meta { color: #f0a0a0; white-space: normal; }
.filed-upload-tray .fut-actions { grid-column: 2; grid-row: 3; display: flex; gap: 6px; }
.filed-upload-tray .fut-button { background: #262626; color: #ddd; border: 1px solid #3d3d3d; border-radius: 6px; padding: 3px 9px; font: inherit; font-size: 12px; cursor: pointer; text-decoration: none; }
.filed-upload-tray .fut-button:hover { background: #333; color: #fff; }
.filed-upload-tray .fut-button.is-quiet { background: none; border-color: transparent; color: #999; }
body.vc-dock-open .filed-upload-tray { bottom: 76px; }
/* Pickers upload as soon as files are chosen, so the extra button and file label are redundant. */
.upload-form[data-auto-upload="yes"] .upload-submit,
.upload-form[data-auto-upload="yes"] .upload-file-name { display: none; }
@media (max-width: 600px) { .filed-upload-tray { right: 8px; left: 8px; bottom: 8px; width: auto; } }

/* ---- Fullscreen video: fills any screen shape ----
   The player takes the whole screen, the frame and <video> are pinned to it, and
   object-fit decides what happens when the screen and the video differ in shape:
   contain = black bars (default), cover = crop edges to fill, fill = stretch. */
.filed-vplayer:fullscreen, .filed-vplayer:-webkit-full-screen {
    position: fixed !important; inset: 0 !important; display: block !important;
    width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important;
    margin: 0 !important; padding: 0 !important; background: #000000 !important; overflow: hidden !important;
}
.filed-vplayer:fullscreen .filed-vframe, .filed-vplayer:-webkit-full-screen .filed-vframe {
    position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important;
    min-height: 0 !important; max-width: none !important; max-height: none !important; aspect-ratio: auto !important;
}
.filed-vplayer:fullscreen .filed-vframe video, .filed-vplayer:-webkit-full-screen .filed-vframe video {
    position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important;
    max-width: none !important; max-height: none !important; object-fit: contain; background: #000000 !important;
}
.filed-vplayer[data-fit="cover"]:fullscreen .filed-vframe video, .filed-vplayer[data-fit="cover"]:-webkit-full-screen .filed-vframe video { object-fit: cover; }
.filed-vplayer[data-fit="fill"]:fullscreen .filed-vframe video, .filed-vplayer[data-fit="fill"]:-webkit-full-screen .filed-vframe video { object-fit: fill; }
/* Keep the controls clear of notches and rounded corners. */
.filed-vplayer:fullscreen .filed-vbar, .filed-vplayer:-webkit-full-screen .filed-vbar {
    padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); padding-bottom: max(6px, env(safe-area-inset-bottom));
}

/* Arcade: square corners, and every colour comes from the account theme (the same --theme-* variables Diagnostics uses),
   so the arcade pages, the scoreboard and the duels follow Filed Default, Light, Windows 95, Modern, Aero and custom palettes. */
.arcade-grid { display: flex; flex-wrap: wrap; gap: 16px; margin: 16px 0; }
.arcade-card { display: block; width: 240px; color: var(--theme-link, #9bbcff); text-decoration: none; }
.arcade-card:hover .arcade-title { text-decoration: underline; }
.arcade-thumb { display: block; width: 240px; height: 180px; background: var(--theme-panel-bg, #181818); border: 1px solid var(--theme-subtle-border, #333333); border-radius: 0; overflow: hidden; }
.arcade-thumb img { display: block; width: 240px; height: 180px; object-fit: cover; }
.arcade-title { display: block; margin-top: 6px; font-weight: bold; text-decoration: underline; }
.arcade-desc { display: block; color: var(--theme-text, #dddddd); font-size: 13px; margin-top: 2px; }
.arcade-meta { display: block; color: var(--theme-muted, #888888); font-size: 12px; margin-top: 2px; }
.arcade-stage { margin: 12px 0; background: var(--theme-media-bg, #000000); border: 1px solid var(--theme-subtle-border, #333333); border-radius: 0; }
.arcade-stage { margin: 8px 0; }
.arcade-stage iframe { display: block; width: 100%; height: calc(100vh - 76px) !important; height: calc(100dvh - 76px) !important; min-height: 420px; border: 0; border-radius: 0; background: var(--theme-media-bg, #000000); }
.arcade-info ul { list-style: none; padding: 0; margin: 8px 0; }
.arcade-info li { margin: 2px 0; }
.arcade-reset, .arcade-link-form { display: inline; margin: 0; }
.arcade-reset .link-button, .arcade-link-form .link-button, .arcade-duel-form .link-button, .arcade-duel-action-form .link-button {
    background: none; border: 0; border-radius: 0; padding: 0; margin: 0; color: var(--theme-link, #9bbcff); font: inherit; cursor: pointer; text-decoration: underline;
}
.arcade-reset .link-button:hover, .arcade-link-form .link-button:hover { color: var(--theme-link-hover, #c5d8ff); }

/* arcade scoreboard, duels and leaderboards */
a.filed-storage-stat { display: block; color: inherit; text-decoration: none; }
a.filed-storage-stat strong { color: var(--theme-link, #9bbcff); text-decoration: underline; font-weight: normal; }
a.filed-storage-stat:hover strong { text-decoration: none; }
.arcade-nav { margin: 8px 0 12px; }
.arcade-nav a { margin-right: 16px; }
.arcade-nav a:last-child { margin-right: 0; }
.arcade-status { min-height: 1.3em; margin: 6px 0; color: var(--theme-text, #dddddd); }
.arcade-board { margin: 16px 0; max-width: none; }
.arcade-board h3 { margin: 0 0 8px; font-size: 14px; font-weight: normal; }
.arcade-boards { margin: 0 0 8px; }
.arcade-me { color: var(--theme-link, #9bbcff); font-weight: bold; }
.arcade-muted { color: var(--theme-muted, #888888) !important; font-size: 13px; }
.arcade-page { max-width: none; margin: 18px 0 48px; padding: 0 12px; color: var(--theme-text, #dddddd); }
.arcade-page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--theme-subtle-border, #333333); }
.arcade-page-heading h1 { margin: 0 0 4px; font-size: 26px; font-weight: 500; color: var(--theme-text, #eeeeee); }
.arcade-page-heading p { margin: 3px 0 0; color: var(--theme-muted, #999999); }
.arcade-page-heading .arcade-nav { flex: 0 0 auto; margin: 0; white-space: nowrap; }
.arcade-eyebrow { margin: 0 0 5px !important; color: var(--theme-accent, #8db8ff) !important; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.arcade-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.arcade-stat { min-width: 0; padding: 12px 14px; border: 1px solid var(--theme-subtle-border, #333333); background: var(--theme-panel-bg, #181818); color: var(--theme-text, #dddddd); }
.arcade-stat span, .arcade-stat strong { display: block; }
.arcade-stat span { color: var(--theme-muted, #888888); font-size: 12px; }
.arcade-stat strong { margin-top: 4px; color: var(--theme-text, #eeeeee); font-size: 23px; font-weight: 500; font-variant-numeric: tabular-nums; }
.arcade-insight { margin: 0 0 14px; color: var(--theme-muted, #888888); font-size: 13px; }
.arcade-insight strong { color: var(--theme-text, #dddddd); font-weight: 600; }
/* Overall champion: a themed panel with an accent stripe, the name large and the record on the right. */
.arcade-leader-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "eyebrow eyebrow" "name record"; align-items: baseline; gap: 2px 18px; margin: 12px 0 22px; padding: 14px 18px 14px 22px;
    position: relative; border: 1px solid var(--theme-subtle-border, #333333); background: var(--theme-panel-bg, #181818); color: var(--theme-text, #dddddd); }
.arcade-leader-card::before, .arcade-duel-banner::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--theme-accent, #8db8ff); }
.arcade-leader-card .arcade-eyebrow { grid-area: eyebrow; margin: 0 !important; }
.arcade-leader-card strong { grid-area: name; min-width: 0; overflow-wrap: anywhere; color: var(--theme-text, #ffffff); font-size: 22px; font-weight: 600; }
.arcade-leader-card > span:last-child { grid-area: record; color: var(--theme-muted, #aaaaaa); font-size: 13px; font-variant-numeric: tabular-nums; }
.arcade-leader-empty > span:last-child { grid-column: 1 / -1; grid-row: 3; }
.arcade-section { margin: 24px 0; }
.arcade-section h2 { margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--theme-subtle-border, #303030); color: var(--theme-text, #eeeeee); font-size: 17px; font-weight: 500; }
.arcade-section > p { margin: 8px 0 12px; color: var(--theme-muted, #999999); font-size: 13px; }
.arcade-scoreboard-page .file-table, .arcade-duels-page .file-table { width: 100%; max-width: none; }
.arcade-scoreboard-page .file-table td, .arcade-scoreboard-page .file-table th { padding: 8px 10px; }
.arcade-scoreboard-page .file-table td strong { color: var(--theme-text, #eeeeee); font-weight: 600; }
.arcade-duel-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 10px 0; }
.arcade-duel-form label { display: flex; flex-direction: column; gap: 4px; min-width: 180px; color: var(--theme-muted, #aaaaaa); font-size: 12px; }
.arcade-duel-form select { min-width: 180px; border-radius: 0; background: var(--theme-input-bg, #080808); color: var(--theme-text, #dddddd); border: 1px solid var(--theme-border, #555555); padding: 7px 9px; font: inherit; font-size: 13px; }
.arcade-duel-form .link-button, .arcade-duel-action-form .link-button, .arcade-duel-play {
    display: inline-block; padding: 7px 11px; border: 1px solid var(--theme-border, #555555); background: var(--theme-button-bg, #252525); color: var(--theme-text, #dddddd); text-decoration: none; cursor: pointer;
}
.arcade-duel-form .link-button:hover, .arcade-duel-action-form .link-button:hover, .arcade-duel-play:hover { background: var(--theme-button-hover, #303030); color: var(--theme-link-hover, #ffffff); }
.arcade-game-challenge { max-width: none; padding-top: 2px; }
.arcade-duel-banner { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 10px 0; padding: 10px 12px 10px 16px; border: 1px solid var(--theme-subtle-border, #333333); background: var(--theme-panel-bg, #181818); color: var(--theme-text, #dddddd); font-size: 13px; }
.arcade-duel-banner strong { color: var(--theme-text, #ffffff); font-weight: 600; }
.arcade-duel-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.arcade-duel-card { min-width: 0; padding: 13px 14px; border: 1px solid var(--theme-subtle-border, #333333); background: var(--theme-panel-bg, #181818); color: var(--theme-text, #dddddd); }
.arcade-duel-card h3 { margin: 9px 0 3px; color: var(--theme-text, #eeeeee); font-size: 17px; font-weight: 500; }
.arcade-duel-card p { margin: 4px 0; color: var(--theme-muted, #999999); font-size: 12px; }
.arcade-duel-card .arcade-duel-scores { color: var(--theme-text, #d4d4d4); font-variant-numeric: tabular-nums; }
.arcade-duel-card-top { display: flex; align-items: center; justify-content: space-between; color: var(--theme-muted, #888888); font-size: 11px; }
.arcade-duel-status { color: var(--theme-muted, #bbbbbb); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.arcade-duel-status[data-status="accepted"] { color: var(--theme-accent, #8db8ff); }
.arcade-duel-status[data-status="completed"] { color: var(--theme-success, #a8dfa8); }
.arcade-duel-status[data-status="declined"], .arcade-duel-status[data-status="cancelled"], .arcade-duel-status[data-status="expired"] { color: var(--theme-muted, #999999); }
.arcade-duel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 10px; }
.arcade-duel-action-form { display: inline; margin: 0; }
.arcade-duel-result { color: var(--theme-text, #eeeeee); font-size: 13px; }
.arcade-duel-waiting { min-height: 160px; display: flex; align-items: center; justify-content: center; padding: 24px; border: 1px solid var(--theme-subtle-border, #333333); background: var(--theme-panel-bg, #181818); color: var(--theme-text, #dddddd); text-align: center; }
@media (max-width: 700px) {
    .arcade-page-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
    .arcade-page-heading .arcade-nav { white-space: normal; }
    .arcade-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .arcade-duel-list { grid-template-columns: minmax(0, 1fr); }
    .arcade-leader-card { grid-template-columns: minmax(0, 1fr); grid-template-areas: "eyebrow" "name" "record"; }
}

/* Duel pings: a small toast stack in the corner plus a count on the Arcade / Duels links. Colours follow the account theme. */
#arcade-ping-host { position: fixed; right: 16px; bottom: 16px; z-index: 2147483000; display: flex; flex-direction: column; gap: 8px; max-width: min(340px, calc(100vw - 32px)); pointer-events: none; }
.arcade-ping-toast { pointer-events: auto; position: relative; display: block; padding: 10px 14px 10px 18px; border: 1px solid var(--theme-border, #555555); background: var(--theme-raised-bg, #1b1b1b); color: var(--theme-text, #dddddd) !important; text-decoration: none !important; box-shadow: 0 4px 16px rgba(0, 0, 0, .45); }
.arcade-ping-toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--theme-accent, #8db8ff); }
.arcade-ping-toast strong, .arcade-ping-toast span { display: block; }
.arcade-ping-toast strong { color: var(--theme-accent, #8db8ff); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.arcade-ping-toast span { margin-top: 3px; font-size: 13px; overflow-wrap: anywhere; }
.arcade-ping-toast:hover { background: var(--theme-button-hover, #303030); }
.arcade-ping-badge { display: inline-block; min-width: 16px; margin-left: 6px; padding: 0 5px; background: var(--theme-accent, #8db8ff); color: var(--theme-page-bg, #111111); font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; text-decoration: none; }

/* Map: a picture of the file tree. Every colour comes from the account theme; the canvas palette is derived from --theme-accent in atlas.js. */
.atlas-page { max-width: none; margin: 0; padding: 0 12px 40px; color: var(--theme-text, #dddddd); }
.atlas-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--theme-subtle-border, #333333); }
.atlas-head h1 { margin: 0; font-size: 26px; font-weight: 500; color: var(--theme-text, #eeeeee); }
.atlas-tabs, .atlas-toggle { display: inline-flex; border: 1px solid var(--theme-border, #555555); }
.atlas-tab { margin: 0; padding: 7px 14px; border: 0; border-right: 1px solid var(--theme-border, #555555); border-radius: 0; background: var(--theme-button-bg, #252525); color: var(--theme-text, #dddddd); font: inherit; font-size: 13px; cursor: pointer; }
.atlas-tab:last-child { border-right: 0; }
.atlas-tab:hover { background: var(--theme-button-hover, #303030); }
.atlas-tab[aria-selected="true"], .atlas-tab-on { background: var(--theme-accent, #8db8ff); color: var(--theme-page-bg, #111111); }
.atlas-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.atlas-stat { min-width: 0; padding: 11px 14px; border: 1px solid var(--theme-subtle-border, #333333); background: var(--theme-panel-bg, #181818); }
.atlas-stat span, .atlas-stat strong { display: block; }
.atlas-stat span { color: var(--theme-muted, #888888); font-size: 12px; }
.atlas-stat strong { margin-top: 3px; color: var(--theme-text, #eeeeee); font-size: 21px; font-weight: 500; font-variant-numeric: tabular-nums; }
.atlas-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; margin: 0 0 8px; }
.atlas-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-width: 0; font-size: 13px; }
.atlas-crumb { margin: 0; padding: 2px 5px; border: 0; border-radius: 0; background: none; color: var(--theme-link, #9bbcff); font: inherit; text-decoration: underline; cursor: pointer; }
.atlas-crumb-last, .atlas-crumb:disabled { color: var(--theme-text, #eeeeee); text-decoration: none; cursor: default; font-weight: 600; }
.atlas-crumb, .atlas-crumb:disabled { background: none !important; border: 0 !important; opacity: 1 !important; }
.atlas-crumb:not(:disabled) { color: var(--theme-link, #9bbcff) !important; }
.atlas-crumb-last:disabled { color: var(--theme-text, #eeeeee) !important; }
.atlas-sep { color: var(--theme-muted, #888888); }
.atlas-note { margin-left: 12px; color: var(--theme-muted, #888888); font-size: 12px; }
.atlas-color { display: inline-flex; align-items: center; gap: 8px; color: var(--theme-muted, #aaaaaa); font-size: 12px; }
.atlas-color select { border-radius: 0; background: var(--theme-input-bg, #080808); color: var(--theme-text, #dddddd); border: 1px solid var(--theme-border, #555555); padding: 5px 8px; font: inherit; font-size: 13px; }
.atlas-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.atlas-stage, .atlas-panel { grid-column: 1; }
.atlas-side { grid-column: 2; grid-row: 1 / span 3; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.atlas-stage { position: relative; height: calc(100vh - 330px); height: calc(100dvh - 330px); min-height: 440px; background: var(--theme-page-bg, #111111); border: 1px solid var(--theme-subtle-border, #333333); outline: none; }
.atlas-stage[hidden], .atlas-panel[hidden], .atlas-tip[hidden] { display: none !important; }
.atlas-stage canvas { display: block; }
.atlas-status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--theme-muted, #999999); text-align: center; padding: 24px; }
.atlas-status[hidden] { display: none; }
.atlas-tip { position: absolute; z-index: 5; max-width: 320px; padding: 8px 10px; border: 1px solid var(--theme-border, #555555); background: var(--theme-raised-bg, #1b1b1b); color: var(--theme-text, #dddddd); font-size: 12px; pointer-events: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
.atlas-tip strong, .atlas-tip span { display: block; overflow-wrap: anywhere; }
.atlas-tip strong { margin-bottom: 2px; font-size: 13px; color: var(--theme-text, #ffffff); }
.atlas-tip-path { color: var(--theme-muted, #999999); }
.atlas-card { min-width: 0; padding: 12px 14px; border: 1px solid var(--theme-subtle-border, #333333); background: var(--theme-panel-bg, #181818); color: var(--theme-text, #dddddd); }
.atlas-card h3 { margin: 0 0 8px; color: var(--theme-accent, #8db8ff); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.atlas-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.atlas-card-head h3 { margin: 0; }
.atlas-wide { margin-bottom: 12px; }
.atlas-selected { font-size: 13px; }
.atlas-sel-name { display: block; font-size: 16px; overflow-wrap: anywhere; color: var(--theme-text, #ffffff); }
.atlas-sel-path { margin: 2px 0 8px; color: var(--theme-muted, #999999); font-size: 12px; overflow-wrap: anywhere; }
.atlas-sel-list { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0 0 10px; }
.atlas-sel-list dt { color: var(--theme-muted, #888888); }
.atlas-sel-list dd { margin: 0; overflow-wrap: anywhere; }
.atlas-sel-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.atlas-btn { display: inline-block; margin: 0; padding: 6px 10px; border: 1px solid var(--theme-border, #555555); border-radius: 0; background: var(--theme-button-bg, #252525); color: var(--theme-text, #dddddd); font: inherit; font-size: 12px; text-decoration: none; cursor: pointer; }
.atlas-btn:hover { background: var(--theme-button-hover, #303030); color: var(--theme-link-hover, #ffffff); }
.atlas-legend-row { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 8px; margin: 4px 0; font-size: 13px; }
.atlas-swatch { display: block; width: 12px; height: 12px; }
.atlas-legend-size { color: var(--theme-muted, #999999); font-variant-numeric: tabular-nums; }
.atlas-age-bar { height: 12px; border: 1px solid var(--theme-subtle-border, #333333); }
.atlas-age-labels { display: flex; justify-content: space-between; margin-top: 4px; color: var(--theme-muted, #999999); font-size: 12px; }
.atlas-biggest { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.atlas-biggest li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--theme-subtle-border, #2a2a2a); }
.atlas-biggest li:last-child { border-bottom: 0; }
.atlas-biggest a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--theme-link, #9bbcff); }
.atlas-biggest span { flex: none; color: var(--theme-muted, #999999); font-variant-numeric: tabular-nums; }
.atlas-muted { color: var(--theme-muted, #999999); font-size: 12px; overflow-wrap: anywhere; }
.atlas-bar-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) minmax(150px, 240px); align-items: center; gap: 12px; margin: 7px 0; font-size: 13px; }
.atlas-bar-track { height: 14px; background: var(--theme-input-bg, #080808); border: 1px solid var(--theme-subtle-border, #333333); }
.atlas-bar-fill { height: 100%; }
.atlas-bar-num { color: var(--theme-muted, #999999); font-variant-numeric: tabular-nums; text-align: right; }
.atlas-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.atlas-side[hidden] { display: none !important; }
.atlas-wide-view .atlas-main { grid-template-columns: minmax(0, 1fr); }
.atlas-mini { border-radius: 0; background: var(--theme-input-bg, #080808); color: var(--theme-text, #dddddd); border: 1px solid var(--theme-border, #555555); padding: 3px 6px; font: inherit; font-size: 12px; }
.atlas-chart-area { display: flex; gap: 8px; }
.atlas-chart-inner { flex: 1 1 auto; min-width: 0; }
.atlas-yaxis { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; width: 72px; height: 220px; flex: none; color: var(--theme-muted, #999999); font-size: 11px; font-variant-numeric: tabular-nums; }
.atlas-timeline-chart { display: flex; align-items: flex-end; gap: 1px; height: 220px; border-bottom: 1px solid var(--theme-border, #555555); }
.atlas-tl-col { display: flex; align-items: flex-end; flex: 1 1 0; min-width: 2px; height: 100%; }
.atlas-tl-col:hover { background: var(--theme-button-hover, #303030); }
.atlas-tl-stack { display: flex; flex-direction: column-reverse; width: 100%; }
.atlas-tl-bar { width: 100%; background: var(--theme-accent, #8db8ff); }
.atlas-timeline-axis { display: flex; height: 18px; margin-bottom: 8px; }
.atlas-tl-tick { flex: 1 1 0; min-width: 2px; color: var(--theme-muted, #999999); font-size: 10px; white-space: nowrap; overflow: visible; }
.atlas-chart-key { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; color: var(--theme-muted, #999999); font-size: 12px; }
.atlas-key-item { display: inline-flex; align-items: center; gap: 6px; }
.atlas-chart-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.atlas-growth { display: block; width: 100%; height: 220px; border-bottom: 1px solid var(--theme-border, #555555); }
.atlas-growth-fill { fill: var(--theme-accent, #8db8ff); opacity: .22; }
.atlas-growth-line { fill: none; stroke: var(--theme-accent, #8db8ff); stroke-width: 2; }
.atlas-growth-axis { display: flex; justify-content: space-between; margin: 3px 0 6px; color: var(--theme-muted, #999999); font-size: 11px; }
.atlas-heat { display: grid; grid-template-columns: 36px repeat(24, minmax(0, 1fr)); gap: 2px; }
.atlas-heat-cell { display: block; height: 22px; }
.atlas-heat-label, .atlas-heat-hour { color: var(--theme-muted, #999999); font-size: 10px; line-height: 22px; white-space: nowrap; }
.atlas-heat-hour { line-height: 14px; }
.atlas-foot { margin: 0 0 12px; }
@media (max-width: 900px) {
    .atlas-main { grid-template-columns: minmax(0, 1fr); }
    .atlas-chart-pair { grid-template-columns: minmax(0, 1fr); }
    .atlas-yaxis { width: 52px; }
    .atlas-side { grid-column: 1; grid-row: auto; }
    .atlas-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .atlas-head, .atlas-toolbar { flex-direction: column; align-items: flex-start; }
    .atlas-stage { height: 60vh; min-height: 320px; }
    .atlas-bar-row { grid-template-columns: 90px minmax(0, 1fr); }
    .atlas-bar-num { grid-column: 1 / -1; text-align: left; }
}
