.cube-page { margin: 0; background: #000; color: #f3f5ef; overflow: hidden; overscroll-behavior: none; }
.cube-shell { height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.cube-toolbar { --bookmark-ink:#e5efce; --bookmark-line:#6e835f; --bookmark-hover:#263322; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .5rem .75rem; padding: .5rem 1rem; background: #182318; border-bottom: 1px solid #40523a; }
.cube-toolbar-main { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; min-width: 0; }
.cube-toolbar strong { font-size: 1rem; }
.cube-toolbar a { color: #e5efce; font-size: .875rem; }
.cube-directory { padding-right: .85rem; border-right: 1px solid #40523a; }
.cube-brand-name { white-space: nowrap; }
.cube-brand-red { color: #f75353; }
.cube-brand-white { color: #fff; }
.cube-brand-blue { color: #1ac2df; }
.cube-brand-mode { color: #dce4d4; font-size: .875rem; font-weight: 500; }
.cube-toolbar .bookmark-header-actions { grid-column: 2; grid-row: 1; }
.cube-toolbar .bookmark-scroll { grid-column: 1 / -1; }
.cube-message[hidden] { display: none; }
.cube-status, .cube-message { margin: 0; padding: .35rem 1rem; background: #101710; color: #dce4d4; font-size: .875rem; }
.cube-status:empty { display: none; }
.cube-message { color: #ffd3b5; }
.cube-shell canvas { display: block; flex: 1 1 0; min-height: 0; width: 100%; touch-action: none; user-select: none; -webkit-user-select: none; }
.cube-shell canvas:focus-visible { outline: 2px solid #a4bd7a; outline-offset: -3px; }
.cube-chat { flex: 0 0 auto; min-height: 0; border-top: 1px solid #40523a; background: #101710; }
.cube-chat[hidden] { display: none; }
.cube-chat summary { padding: .45rem 1rem; cursor: pointer; font-size: 1rem; }
.cube-chat summary span { margin-left: .75rem; font-size: .875rem; }
.cube-chat-body { height: clamp(9rem, 25dvh, 13rem); display: flex; flex-direction: column; gap: .5rem; padding: 0 1rem .65rem; box-sizing: border-box; }
.cube-chat-messages { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: .25rem 0; list-style: none; font-size: 1rem; line-height: 1.45; overflow-wrap: anywhere; }
.cube-chat-messages:empty::before { content: 'No messages yet.'; color: #b6c3ac; }
.cube-chat-messages li + li { margin-top: .25rem; }
.cube-chat-form { display: flex; align-items: center; gap: .5rem; margin: 0; }
.cube-chat-form label { color: #dce4d4; font-size: .875rem; }
.cube-chat-form input { flex: 1 1 0; width: 0; min-width: 0; min-height: 2.5rem; margin: 0; padding: .4rem .6rem; border: 1px solid #6e835f; border-radius: .35rem; background: #080d08; color: #f3f5ef; font: inherit; font-size: 1rem; }
.cube-chat-form button { min-height: 2.5rem; padding: .4rem .85rem; border: 1px solid #6e835f; border-radius: .35rem; background: #263322; color: #f3f5ef; font: inherit; cursor: pointer; }
.cube-chat-form button:hover { background: #3c5032; }
.cube-chat-form button:disabled, .cube-chat-form input:disabled { opacity: .55; cursor: default; }
.cube-chat-status { margin: 0; color: #ffd3b5; font-size: .875rem; }
.cube-chat-status:empty { display: none; }
.cube-chat [data-color="0"] { color: #c5cec0; }
.cube-chat [data-color="1"] { color: #ff8585; }
.cube-chat [data-color="2"] { color: #6adbf0; }
.cube-chat [data-color="3"] { color: #95e780; }
.cube-chat [data-color="4"] { color: #ff9bd5; }
.cube-chat [data-color="5"] { color: #ffb86c; }
.cube-chat [data-color="6"] { color: #f2e827; }
.cube-chat [data-color="7"] { color: #c891ff; }
.cube-chat [data-color="8"] { color: #d6a376; }
@media (max-width: 600px) {
  .cube-toolbar { padding: .35rem .6rem; gap: .4rem; }
  .cube-toolbar-main { gap: .4rem; }
  .cube-status { padding: .3rem .6rem; }
  .cube-chat summary { padding: .4rem .6rem; }
  .cube-chat-body { padding: 0 .6rem .5rem; }
}
