
body {
    overflow: hidden;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#main {
    height: 100%;
    padding-top: 0;
    padding-left: 0;
}

#asset_view_layout {
    width: 350px;
    min-width: 350px;
    margin: 6px;
    height: 98%;  /* WTF?!? */
    flex-shrink: 0;
}

:root {
    --resize-cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><path d='M2 12 L7 7 L7 10.5 L17 10.5 L17 7 L22 12 L17 17 L17 13.5 L7 13.5 L7 17 Z' fill='white' stroke='black' stroke-width='1.2' stroke-linejoin='round'/></svg>") 12 12, ew-resize;
}

.panel-splitter {
    width: 2px;
    padding: 0 3px;
    margin: 6px 0;
    background: #2a2a2a;
    background-clip: content-box;
    flex-shrink: 0;
    cursor: var(--resize-cursor);
}

.col-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: var(--resize-cursor);
    z-index: 2;
}

.panel-splitter:hover, .col-resizer:hover { background-color: #5a8fd8; }

body.resizing-panel, body.resizing-panel * { cursor: var(--resize-cursor) !important; }

#topbar_layout {
    padding-top: 0;
    padding-bottom: 0;
}

#flow_label {
    font-size: 14px;
    font-weight: bold;
}

#welcome_label {
    width: 100%;
}

#window_layout {
    padding: 0;
}

#treeview_layout {
    height: auto;
    width: 100%;
    overflow: hidden;
    flex-grow: 1;
}

#tab_pages {
    height: 95%;
}

#asset_treeview {
    width: 99%;
    display: flex;
    flex-direction: column;
}

#asset_treeview .anima-treeview-rowlayout {
    flex: 1;
    height: auto;
}

#media_view_layout {
    position: relative;
}

#cassette_view {
    display: none;
}

.cassette {
    margin: auto;
    margin-bottom: 20px;
}

.cassette-message {
    margin: auto;
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
}

.anima-loader {
    top: calc(50% - 160px);
}

.anima-button#search_button {
    background-color: var(--selected);
    margin-left: auto;
    margin-right: 30px;
}

.anima-button#search_button:hover { background-color: var(--hover); }

.anima-toggle-button#player_tool_button {
    margin-right: 4px;
}

.anima-button#icons_button {
    width: 8px;
    height: 8px;
    min-width: 8px;
    min-height: 8px;
    margin-top: auto;
    margin-bottom: auto;
}

#mode_dropdown .anima-dropdown-button {
    background-color: var(--selected-dark);
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

#node_editor_layout {
    right: 0px;
    width: 580px;
    height: 99%;
    min-width: 580px;
    border: var(--border-heavy);
}

#node_editor_label {
    background-color: var(--bg-light);
    text-align: center;
    margin-top: 0;
    margin-bottom: 0;
    margin-left: auto;
    margin-right: auto;
    padding: 2px;
    width: 100%;
    height: auto;
}

img#thumbnail_image {
    margin: 0;
    margin-left: auto;
    margin-right: auto;
    aspect-ratio: auto;
    object-fit: scale-down;
}

div#attribute_editor {
    padding: 0;
    padding-top: 8px;
    margin: 0;
    height: 100%;
    overflow-y: auto;
}

#comments_label {
    background-color: var(--bg-light);
    width: 100%;
    height: auto;
    text-align: left;
    margin-top: 0;
    margin-bottom: 0;
    margin-left: auto;
    margin-right: auto;
    padding: 2px;
    padding-left: 8px;
}


#asset_info_layout {
    margin: 0;
    margin-right: 4px;
    padding: 0;
}

#asset_info_label {
    background-color: var(--bg-light);
    text-align: left;
    margin-top: 0;
    margin-bottom: 2px;
    margin-left: 1px;
    margin-right: 0px;
    padding: 2px;
    padding-left: 4px;
    width: auto;
    height: auto;
    flex-grow: 1;
}

.asset-info-dropdown {
    background-color: var(--bg-alt);
    margin: 0;
    margin-bottom: 2px;
    padding: 0;
}
.asset-info-dropdown .anima-dropdown-button {
    background-color: var(--bg-alt);
    margin: 0;
    margin-right: 4px;
    padding: 2px;
    border: none;
}

#asset_type_dropdown, #asset_type_b_dropdown {
    width: 118px;
}

#asset_version_dropdown, #asset_version_b_dropdown {
    width: 68px;
}
 
#comment_text_area {
    width: 100%;
    height: auto;
    margin: 0;
    margin-left: 1px;
    user-select: text;
}

#comment_section {
    width: auto;
    height: 100%;
    overflow-x: hidden;
    overflow-y: scroll;
    margin: 0;
    padding: 0;
    user-select: text;
}

.anima-button#approved_button {
    background-color: #080;
    margin: 0;
}

.anima-button#to_change_button {
    background-color: #a00;
    margin: 0;
}

.dropdown-attribute {
    width: 100px;
}

.asset-view-header {
    background-color: var(--bg-light);
    margin: 0;
    padding: 0;
}

.asset-view-header-button {
    background-color: var(--bg-light);
    margin: 0;
    padding: 0;
    font-size: 11px;
}

.flow-menuitem {
    margin: 0;
    padding: 2px;
}

.anima-canvas-layout {
    margin: 0;
    padding: 0;
}

.anima-brush-button {
    width: 16px;
    height: 16px;
    border: none;
    margin: 0;
    margin-top: 2px;
    padding: 0;
    font-size: 10px;
    font-weight: bold;
    color: var(--selected);
}

.anima-brush-button .anima-dropdown-button {
    width: 16px;
    height: 16px;
    border: 2px solid var(--selected);
    border-radius: 50%;
    margin: auto;
    padding: 2px;
    padding-top: 1px;
    padding-bottom: 1px;
    text-align: center;
}

.anima-brush-button .anima-dropdown-button::after {
    content: '';
}

.anima-brush-button .anima-dropdown-menu {
    background-color: var(--bg-normal);
    width: 20px;
    min-width: 0;
    height: auto;
    border: none;
    margin: 0;
    padding: 2px;
    text-align: center;
    font-size: 10px;
    font-weight: bold;
    color: var(--selected);
}

.anima-brush-button .anima-dropdown-menu .anima-menuitem {
    width: 20px;
    height: 20px;
    border: 2px solid var(--selected);
    border-radius: 40%;
    margin: 0;
    margin-left: -2px;
    padding: 2px;
    text-align: center;
    font-size: 10px;
    font-weight: bold;
    color: var(--text);
}

#publish-dialog-toasset {
    margin: 10px;
    margin-bottom: 20px;
}

#publish-dialog-files {
    margin: 10px;
    margin-bottom: 20px;
}

.validated {
    background-color: #2a2;
}

.not-validated {
    background-color: #a22;
}

/* feedback shown next to the comment box after sending a comment */
.comment-status {
    padding: 0px 6px;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
}

.comment-status-ok {
    color: #6c6;
}

.comment-status-error {
    color: #e66;
}

/* PANELS: [assets_strip][asset_view_layout][.panel-splitter][media_view_layout][panel_grip][comments_panel] */

#assets_strip {
    display: none;
    width: 22px;
    min-width: 22px;
    flex-shrink: 0;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-top: 6px;
    box-sizing: border-box;
    border-right: var(--border);
    background-color: var(--bg-dark);
    cursor: pointer;
}

#assets_strip:hover {
    background-color: var(--hover);
}

#assets_strip .strip-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    color: var(--text-muted);
}

#main.assets-collapsed #assets_strip {
    display: flex;
}

#main.assets-collapsed #asset_view_layout,
#main.assets-collapsed .panel-splitter,
#main.assets-collapsed #assets_collapse_button {
    display: none;
}

/* collapse tab: slim, on the assets panel's edge, vertically centred */
.anima-button#assets_collapse_button {
    align-self: center;
    flex-shrink: 0;
    width: 12px;
    height: 48px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    border: none;
    border-radius: 0 4px 4px 0;
    background-color: var(--bg-alt);
    color: var(--text-muted);
}

.anima-button#assets_collapse_button:hover {
    background-color: var(--hover);
    color: var(--text);
}

#panel_grip {
    width: 5px;
    flex-shrink: 0;
    margin: 6px 0;
    background-color: var(--bg-alt);
    cursor: var(--resize-cursor);
}

#panel_grip:hover {
    background-color: #5a8fd8;
}

#comments_panel {
    width: 340px;
    flex-shrink: 0;
    height: 98%;
    margin: 6px 6px 6px 0;
    box-sizing: border-box;
    min-width: 0;
}

/* COMPACT COMMENTS */

.anima-comment-day {
    text-align: center;
    color: var(--text-muted);
    font-size: 10px;
    margin: 6px 0 2px;
}

.anima-comment-row {
    display: block;
    box-sizing: border-box;  /* width 100% (hbox layout) includes the padding: nothing sticks out on the right */
    padding: 3px 4px;
    margin-bottom: 2px;
    border-radius: 4px;
    cursor: pointer;
    user-select: text;
}

.anima-comment-row:not(.selected-dark):hover {
    background-color: var(--bg-alt);
}

.anima-comment-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

/* small icons centre themselves with an auto margin elsewhere - here only the frame chip takes the free space */
.anima-comment-head .small-icon {
    margin: 0;
}

.anima-comment-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 9px;
    font-weight: bold;
}

.anima-comment-author {
    font-weight: bold;
}

.anima-comment-meta {
    color: var(--text-muted);
    font-size: 10px;
}

.anima-comment-chip {
    font-size: 8px;
    line-height: 13px;
    padding: 0 3px;
    border-radius: 3px;
    color: #fff;
    letter-spacing: .03em;
}

.chip-internal { background-color: #3d5a80; }
.chip-client { background-color: #7a3fb0; }
.chip-delivery { background-color: #080; }
.chip-approval { background-color: #b35900; }
.chip-brief, .chip-comment, .chip-other { background-color: #555; }

/* play-voice on a voice comment's head: a play icon and the recording's m:ss */
.anima-comment-voice {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 9px;
    line-height: 13px;
    padding: 0 4px;
    border-radius: 3px;
    color: var(--text);
    background-color: var(--bg-light);
    cursor: pointer;
}

.anima-comment-voice:hover { background-color: var(--hover); }

.anima-comment-voice.disabled,
.anima-comment-voice.disabled:hover {
    opacity: .45;
    cursor: default;
    background-color: var(--bg-light);
}

.anima-comment-voice-icon { font-size: 8px; }

/* the comment whose voice plays: a stop icon and how far it is; a click stops it */
.anima-comment-voice.playing,
.anima-comment-voice.playing:hover {
    color: #fff;
    background-color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.anima-comment-text {
    padding-left: 26px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* a reply is set in under its comment, one level deep (a reply to a reply says whose it answers) */
.anima-comment-row.anima-comment-reply {
    margin-left: 14px;
    width: calc(100% - 14px);  /* the row is 100% wide: set in, it must not stick out on the right */
    padding-left: 8px;
    border-left: 2px solid var(--line);
}

.anima-comment-answers {
    color: var(--text-muted);
    font-size: 10px;
}

.anima-comment-reply-link {
    margin: 4px 0 0 26px;
    width: fit-content;
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
}

.anima-comment-reply-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* above the comment box while the next Send is a reply */
.anima-reply-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 6px;
    border-left: 2px solid var(--accent);
    border-radius: 2px;
    background-color: var(--raised);
    color: var(--text-muted);
    font-size: 10px;
}

.anima-reply-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.anima-reply-cancel {
    flex: none;
    cursor: pointer;
}

.anima-reply-cancel:hover {
    color: var(--text);
}

.anima-comment-filter-note {
    color: var(--text-muted);
    font-size: 10px;
    padding: 2px 4px 6px;
}

.anima-comment-editor {
    padding-left: 26px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: auto;
}

.anima-textarea.anima-comment-edit-text {
    box-sizing: border-box;
    width: 100%;
    min-height: 56px;
    margin: 0;
    resize: vertical;
    font: inherit;
    cursor: text;
}

.anima-comment-edit-hint {
    color: var(--text-muted);
    font-size: 10px;
}

.anima-comment-edit-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
}

#comments_view {
    flex: 1;
    min-height: 0;
    width: auto;
}

#comment_send_area {
    padding-top: 4px;
    gap: 4px;
}

#comment_text_area {
    height: 64px;
    overflow-y: auto;
}

#comment_buttons {
    gap: 4px;
    padding: 0;
}

#comment_buttons .anima-button {
    flex: 1;
    text-align: center;
    margin: 0;
}

/* the status note wraps in the narrow comments panel - it is the only place errors are shown */
#comment_send_area .comment-status {
    white-space: normal;
    text-align: left;
    align-self: stretch;
    margin: 0;
}

/* the voice comment section of the viewer's toolbar: the recorder and what voice comment plays; not shown while
   both are hidden (a category, no media, nothing playing) */
.anima-toolbar-group.toolbar-voice {
    gap: 8px;
}

.anima-toolbar-group.toolbar-voice:not(:has(> :not([style*="display: none"]))) {
    display: none;
}

/* the voice comment that plays (anima_flow_widgets.AnimaVoicePlaybackIndicator):
   a pulsing dot, "Playing voice comment · author", 0:12 / 1:23, Stop */
.voice-playing {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 1px 4px 1px 8px;
    border-radius: 10px;
    background-color: color-mix(in srgb, var(--accent) 22%, transparent);
    border: 1px solid var(--accent);
    color: var(--text);
    font-size: 11px;
    white-space: nowrap;
}

.voice-playing-dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent);
    animation: voice-rec-blink 1.2s ease-in-out infinite;
}

.voice-playing.loading .voice-playing-dot {
    animation-duration: .5s;
}

.voice-playing-time {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.voice-playing-time:empty {
    display: none;
}

.voice-playing .anima-button {
    margin: 0;
    padding: 1px 8px;
    font-size: 11px;
    border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
    .voice-playing-dot { animation: none; }
}

/* the voice recorder (anima_voice.AnimaVoiceRecorder):
   Record | red dot, m:ss / 5:00, input level, Stop | m:ss, Continue, Preview, Clear */
.voice-rec {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 0 2px;
}

.voice-rec .anima-button {
    margin: 0;
    padding: 2px 10px;
    font-size: 11px;
    white-space: nowrap;
}

.voice-rec .anima-button.disabled,
.voice-rec .anima-button.disabled:hover {
    background-color: var(--raised);
    color: var(--disabled);
    cursor: default;
}

/* a small red dot in front of Record */
.voice-rec-record::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background-color: var(--danger);
    vertical-align: middle;
}

.voice-rec-record.disabled::before {
    background-color: var(--disabled);
}

/* recording */
.voice-rec-dot {
    display: inline-block;
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--danger);
    animation: voice-rec-blink 1.2s ease-in-out infinite;
}

@keyframes voice-rec-blink {
    50% { opacity: .35; }
}

@media (prefers-reduced-motion: reduce) {
    .voice-rec-dot { animation: none; }
}

.voice-rec-time {
    flex: none;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.voice-rec-recording .voice-rec-time {
    color: var(--danger);
}

.voice-rec-level {
    display: inline-block;
    flex: none;
    width: 48px;
    height: 4px;
    border-radius: 2px;
    background-color: var(--line);
    overflow: hidden;
}

.voice-rec-level-fill {
    display: block;
    width: 0;
    height: 100%;
    background-color: var(--success);
    transition: width 60ms linear;
}

/* the mic stopped on its own: what was recorded can still be sent */
.voice-rec-note {
    flex: none;
    color: var(--warning);
    font-size: 10px;
    cursor: help;
}

/* the clip stays muted while recording */
.anima-player-button.voice-rec-locked,
.anima-player-volume:disabled {
    pointer-events: none;
    opacity: .4;
}
