/* Neutral dark theme (feature/neutral-dark-theme). Loaded last; component looks live here. */

html, body {
    font-family: var(--font-ui);
    font-size: 12px;
}

body {
    background-color: var(--page);
    color: var(--text);
}

/* WIDGETS */

.anima-label { color: var(--text); }

.anima-button, .anima-toggle-button {
    background-color: var(--raised);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 4px 10px;
    font-weight: 500;
    filter: none;
}
div.anima-button:hover, div.anima-toggle-button:hover { background-color: var(--hover-bg); }
.anima-toggle-button.toggled {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
    filter: none;
    padding: 4px 10px;
}

.anima-dropdown-button {
    background-color: var(--raised);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 3px 8px;
}
.anima-dropdown-button::after { color: var(--text-muted); font-size: 9px; }
div.anima-dropdown-button:hover { background-color: var(--hover-bg); }

.anima-dropdown-menu, .anima-menu {
    background-color: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 4px;
}
.anima-menuitem { color: var(--text); border-radius: var(--radius-sm); padding: 5px 8px; }
div.anima-menuitem:hover, div.anima-menuitem:focus { background-color: var(--hover-bg); }
.anima-menuitem.menu-section-start { border-top: 1px solid var(--line); border-radius: 0; margin-top: 4px; padding-top: 7px; }
.anima-menuitem.menu-dept-on::before, .anima-menuitem.menu-dept-off::before { display: inline-block; width: 1.2em; color: var(--accent); }
.anima-menuitem.menu-dept-on::before { content: '\2713'; }
.anima-menuitem.menu-dept-off::before { content: ''; }

.anima-modalwindow {
    background-color: var(--panel);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.anima-close { color: var(--text-muted); }
.anima-close:hover, .anima-close:focus { color: var(--text); }
.anima-confirm-ok { background-color: var(--danger); border-color: var(--danger); color: #fff; }

.anima-textarea {
    background-color: var(--raised);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 6px 8px;
}
.anima-textarea:focus { outline: none; border-color: var(--accent); }

input[type="color"] { border-radius: var(--radius-sm); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--hover-bg); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--line); }
* { scrollbar-width: thin; scrollbar-color: var(--hover-bg) transparent; }

.selected { background-color: var(--raised); }
.selected-dark { background-color: var(--raised); }
.toggled { filter: none; }

/* STATUS PILLS: text in the status colour (lightened when the source is very dark) on a tint of it */
[class*="bg-"].anima-rowitem, .anima-dropdown-button[class*="bg-"], .anima-menuitem[class*="bg-"] {
    border-radius: 999px;
    font-weight: 600;
    font-size: 10px;
    padding: 1px 8px;
    margin: 2px 4px;
    border: none;
    text-align: center;
}
.bg-lightred    { background-color: rgba(221,68,68,.18);   color: #ff8a8a; }
.bg-red         { background-color: rgba(229,72,77,.20);   color: #ff7a7f; }
.bg-darkred     { background-color: rgba(170,40,40,.25);   color: #ff8080; }
.bg-lightyellow { background-color: rgba(238,204,0,.16);   color: #f2d64b; }
.bg-yellow      { background-color: rgba(204,170,0,.18);   color: #e6c840; }
.bg-darkyellow  { background-color: rgba(153,136,0,.22);   color: #d4bd3c; }
.bg-orange      { background-color: rgba(245,166,35,.18);  color: #f5a623; }
.bg-lightgreen  { background-color: rgba(85,170,85,.18);   color: #7fd17f; }
.bg-green       { background-color: rgba(48,164,108,.18);  color: #4cc38a; }
.bg-darkgreen   { background-color: rgba(30,110,60,.25);   color: #5fca86; }
.bg-lightturq   { background-color: rgba(0,170,136,.18);   color: #3fd2b0; }
.bg-turqoise    { background-color: rgba(0,136,119,.20);   color: #38c2a8; }
.bg-darkturq    { background-color: rgba(0,96,90,.26);     color: #4cb8ac; }
.bg-lightblue   { background-color: rgba(80,80,200,.20);   color: #9c9cff; }
.bg-blue        { background-color: rgba(40,60,200,.22);   color: #8fa2ff; }
.bg-darkblue    { background-color: rgba(30,40,140,.30);   color: #8b97ff; }
.bg-lightpurple { background-color: rgba(170,68,204,.20);  color: #d58ff0; }
.bg-purple      { background-color: rgba(110,30,170,.24);  color: #c58cff; }
.bg-darkpurple  { background-color: rgba(70,30,120,.30);   color: #b38cf2; }
.bg-lightgrey   { background-color: rgba(153,153,153,.18); color: #c4c4cc; }
.bg-grey        { background-color: rgba(120,120,128,.20); color: #b0b0ba; }
.bg-darkgrey    { background-color: rgba(80,80,88,.30);    color: #a3a3ad; }

/* PAGE */

#main { background-color: var(--page); }
#asset_view_layout, #comments_panel { background-color: var(--panel); border-radius: var(--radius); }
#asset_view_layout { padding: 4px; box-sizing: border-box; }

/* brand row */
#flow_label { font-size: 13px; font-weight: 600; color: var(--text); }
#topbar_layout { align-items: center; }
#welcome_label { color: var(--text-muted); text-align: right; margin: 0 8px 0 0; padding: 0; line-height: 24px; }
/* Logout: a small outlined button, its text centred on the Welcome text's line */
.anima-button#logout_button {
    display: inline-flex; align-items: center; height: 24px; box-sizing: border-box;
    margin: 0; padding: 0 10px; white-space: nowrap; line-height: 1;
    background-color: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text);
}
.anima-button#logout_button:hover { background-color: var(--hover-bg); border-color: var(--text-muted); }

/* Player / Tools / Join Session: rounded tab buttons (only Join Session is shown in production) */
#asset_tool_layout { gap: 4px; align-items: center; }
#asset_tool_layout .anima-toggle-button { margin: 0; border-radius: var(--radius); padding: 4px 10px; }
.anima-button#search_button { background-color: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; margin-left: auto; }
.anima-button#search_button:hover { background-color: var(--accent-hover); }

/* asset list */
.anima-header { border-bottom: 1px solid var(--line); }
.anima-headeritem { background-color: transparent; border: none; color: var(--text-muted); font-size: 10px; font-weight: 500;
                    text-transform: uppercase; letter-spacing: .04em; }
.anima-row { border-bottom: 1px solid var(--line); border-radius: 0; }  /* a line between rows */
.anima-row:hover { background-color: var(--hover-bg); }
.anima-row.selected { background-color: var(--raised); box-shadow: inset 2px 0 0 var(--accent); }
.anima-rowitem { border-right: none; }
/* the left splitter is shaped like the right grip (#panel_grip), so both light up the same way on hover */
.panel-splitter { width: 5px; padding: 0; background-color: transparent; background-clip: border-box; }

/* viewer and timeline */
.anima-canvas-layout { border-radius: var(--radius); overflow: hidden; }
.anima-timeline { background-color: var(--raised); border-radius: var(--radius); }
.anima-clip { background-color: color-mix(in srgb, var(--accent) 35%, var(--raised)); border: none; border-radius: var(--radius-sm);
              color: var(--text); }
.anima-clip.selected { background-color: color-mix(in srgb, var(--accent) 60%, var(--raised)); }
div.anima-playhead { border-left: 2px solid var(--text); }
.anima-timeline-marker { border-left: 2px solid var(--warning); }

/* toolbar: groups are islands, icons muted, the active tool is the accent */
.anima-toolbar-group { background-color: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px 4px; }
.anima-player-button { background-color: var(--text-muted); }
div.anima-player-button:hover { background-color: var(--text); }
.anima-player-button.toggled { background-color: var(--accent); filter: none; border: none; padding: 0; }
.anima-player-timecode { font-family: var(--font-mono); color: var(--text); background: transparent; border: none; }

/* comments panel */
#asset_info_label { background: transparent; font-size: 13px; font-weight: 600; color: var(--text); padding: 8px 6px 6px; }
.anima-comment-day { text-transform: uppercase; letter-spacing: .06em; font-size: 9px; }
.anima-comment-row.selected-dark { background-color: var(--raised); }
.anima-comment-author { color: var(--text); font-weight: 600; }
.anima-button#approved_button { background-color: rgba(76,195,138,.16); border-color: transparent; color: var(--success); }
.anima-button#to_change_button { background-color: rgba(255,99,105,.16); border-color: transparent; color: var(--danger); }
.anima-button#send_button { background-color: var(--accent); border-color: var(--accent); color: #fff; }
.anima-button.anima-comment-edit-save { background-color: var(--accent); border-color: var(--accent); color: #fff; }
.anima-button#approved_button:hover { background-color: rgba(76,195,138,.26); }
.anima-button#to_change_button:hover { background-color: rgba(255,99,105,.26); }
.anima-button#send_button:hover { background-color: var(--accent-hover); }

/* strip, collapse tab and grip */
#assets_strip { background-color: var(--panel); border-right: 1px solid var(--line); }
/* collapse tab: sits on top of the splitter's middle and takes no width of its own, so the left edge is as slim as the right */
#asset_view_layout { margin-right: 0; }
.anima-button#assets_collapse_button {
    position: relative; z-index: 3;
    margin-left: -8.5px; margin-right: -3.5px;  /* 12 px tab centred on the 5 px splitter just before it */
    background-color: var(--raised); color: var(--text-muted); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
#panel_grip { background-color: transparent; }
#panel_grip:hover { background-color: var(--accent); }

/* comment frame chips */
.anima-comment-tc {
    font-family: var(--font-mono);
    font-size: 9px;
    color: #c4bfff;
    background-color: rgba(108,99,255,.16);
    border-radius: 4px;
    padding: 0 4px;
    cursor: pointer;
    margin-left: auto;  /* the last item of the comment's header, at its right edge */
}
.anima-comment-tc:hover { background-color: rgba(108,99,255,.30); }

/* asset list: the status column chooser fits its column on one line */
.anima-headeritem.anima-dropdown { text-transform: none; letter-spacing: 0; padding: 0; overflow: hidden; }
.anima-headeritem.anima-dropdown .anima-dropdown-button {
    display: block;
    margin: 0;
    padding: 1px 16px 1px 6px;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    font-weight: 600;
    color: var(--text);
    background-color: var(--raised);
    border: none;
}
.anima-headeritem.anima-dropdown .anima-dropdown-button::after { float: none; position: absolute; right: 5px; top: 2px; margin: 0; }

/* comments: a thin line between comments; the selected one gets the accent bar */
.anima-comment-row { border-radius: 0; border-bottom: 1px solid var(--line); padding: 8px 6px; margin: 0; }
.anima-comment-row.selected-dark { background-color: var(--raised); box-shadow: inset 2px 0 0 var(--accent); }

/* comments panel header: its own block - category path, name, then one row per detail */
#asset_info_layout { background-color: var(--raised); border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
                     padding: 10px 12px; margin: 0; }
#asset_info_label { display: flex; flex-direction: column; gap: 2px; padding: 0; text-align: left; font-size: 12px; font-weight: 400; }
#asset_info_label .asset-info-name { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
#asset_info_label .asset-info-path { font-size: 10px; color: var(--text-muted); word-break: break-all; }
#asset_info_label .asset-info-row { display: flex; gap: 8px; }
#asset_info_label .asset-info-key { color: var(--text-muted); flex: 0 0 64px; }  /* one narrow label column */
#asset_info_label .asset-info-value { color: var(--text); font-family: var(--font-mono); font-size: 11px; }
#asset_info_label .asset-info-empty { color: var(--text-muted); }

/* final review fixes */
.anima-label.comment-status-ok { color: var(--success); }
.anima-label.comment-status-error { color: var(--danger); }
.anima-comment-row:not(.selected-dark):hover { background-color: var(--hover-bg); }
/* playhead marker: a drawn triangle centred on the 2 px line (the old ▼ glyph's width depended on the font) */
div.anima-playhead::before {
    content: '';
    position: absolute;
    top: 0;
    left: -6px;  /* the line is the 2 px border just left of this box: its centre is at -1 px, the 10 px triangle's at -6 + 5 */
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--text);
}
.panel-splitter:hover, .col-resizer:hover { background-color: var(--accent); }
.anima-headeritem .anima-dropdown-menu, .anima-headeritem .anima-menuitem {
    text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 400; color: var(--text);
}
.highlighted { filter: none; outline: 2px dashed var(--accent); outline-offset: -2px; }

/* timeline: clips alternate their shade and a dark line separates them */
.anima-clip { box-shadow: inset -2px 0 0 var(--page); }
.anima-clip:nth-child(even of .anima-clip) { background-color: color-mix(in srgb, var(--accent) 22%, var(--raised)); }
.anima-clip:nth-child(even of .anima-clip).selected { background-color: color-mix(in srgb, var(--accent) 50%, var(--raised)); }

/* brush and text size: a ring with its number centred inside; the menu is a column of the same rings */
.anima-brush-button { width: auto; height: auto; margin: 0 2px; padding: 0; color: var(--text); }
.anima-brush-button .anima-dropdown-button,
.anima-brush-button .anima-dropdown-menu .anima-menuitem {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    border: 1.5px solid var(--text-muted);
    border-radius: 50%;
    background-color: transparent;
    color: var(--text);
    font-size: 10px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: -0.02em;
}
.anima-brush-button .anima-dropdown-button::after { content: none; }
.anima-brush-button .anima-dropdown-button:hover,
.anima-brush-button .anima-dropdown-menu .anima-menuitem:hover { border-color: var(--accent); background-color: var(--hover-bg); }
.anima-brush-button .anima-dropdown-menu {
    width: auto;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
    padding: 5px;
    background-color: var(--panel);
    border: 1px solid var(--line);
}

/* volume: Chrome already centres the knob on the track; the old -4px margin pulled it up */
input[type="range"].anima-player-volume::-webkit-slider-thumb { margin-top: 0; }

/* the player's timeline and toolbar keep their height; when space is tight the viewer gives it up */
.anima-clip-player > .anima-timeline,
.anima-clip-player > .anima-video-controls { flex-shrink: 0; }
.anima-clip-player > .anima-viewer-layout { min-height: 0; }

/* Project info: a centred dialog - header (name, fps), the links as a compact scrolling list, Auto play at the bottom */
.anima-modalwindow.project-info-window {
    left: 50%; top: 50%; transform: translate(-50%, -50%);
    box-sizing: border-box; width: min(520px, 92vw); max-height: 80vh; margin: 0; padding: 0;
    display: flex; flex-direction: column; overflow: hidden;
}
.project-info-window .anima-close { position: absolute; top: 12px; right: 16px; float: none; font-size: 22px; line-height: 1; color: var(--text-muted); cursor: pointer; }
.project-info-window .anima-close:hover { color: var(--text); }
.project-info-window .anima-modalcontent { margin: 0; padding: 0; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.project-info-header { display: flex; align-items: center; gap: 10px; padding: 14px 48px 12px 20px; border-bottom: 1px solid var(--line); }
.project-info-name { font-size: 16px; font-weight: 600; color: var(--text); }
.project-info-fps { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); background-color: var(--raised);
                    border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.project-info-section-title { padding: 12px 20px 2px; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.project-info-links { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 6px 8px; }
a.project-info-link { display: flex; align-items: center; gap: 10px; height: 28px; padding: 0 8px; border-radius: var(--radius-sm);
                      color: var(--text); text-decoration: none; }
a.project-info-link:hover { background-color: var(--hover-bg); }
.project-info-link-name { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-info-link-ext { color: var(--text-muted); font-size: 11px; opacity: 0; }
a.project-info-link:hover .project-info-link-ext { opacity: 1; }
.project-info-kind { flex: 0 0 18px; width: 18px; height: 18px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center;
                     font-size: 11px; font-weight: 600; line-height: 1; }
.project-info-kind[data-kind="sheet"]      { background-color: rgba(52,168,83,.20);  color: #5fd38a; }
.project-info-kind[data-kind="doc"]        { background-color: rgba(66,133,244,.22); color: #7fb0ff; }
.project-info-kind[data-kind="slides"]     { background-color: rgba(251,188,4,.20);  color: #f8c94a; }
.project-info-kind[data-kind="drawing"]    { background-color: rgba(234,67,53,.20);  color: #ff8a80; }
.project-info-kind[data-kind="folder"]     { background-color: rgba(154,154,166,.20); color: #c4c4cc; }
.project-info-kind[data-kind="excel"]      { background-color: rgba(33,115,70,.30);  color: #6fd29a; }
.project-info-kind[data-kind="word"]       { background-color: rgba(43,87,154,.32);  color: #8fb4ff; }
.project-info-kind[data-kind="powerpoint"] { background-color: rgba(208,68,35,.28);  color: #ff9a7a; }
.project-info-kind[data-kind="link"]       { background-color: rgba(108,99,255,.18); color: #c4bfff; }
.project-info-empty { color: var(--text-muted); padding: 12px; }
.project-info-footer { border-top: 1px solid var(--line); padding: 10px 20px; }

/* login page: a centred card - logo, title, labelled fields, one Sign in button */
body.login-page { min-height: 100vh; margin: 0; display: flex; align-items: center; justify-content: center; background-color: var(--page); }
.login-card { box-sizing: border-box; width: min(360px, calc(100vw - 32px)); padding: 28px 28px 24px; background-color: var(--panel);
              border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; }
.login-card img { width: 96px; height: auto; display: block; margin: 0 auto 12px; }
.login-card h1 { font-size: 16px; font-weight: 600; margin: 0; color: var(--text); }
.login-subtitle { margin: 4px 0 20px; color: var(--text-muted); }
.login-error { margin: -8px 0 16px; color: var(--status-red, #e06c6c); }
.login-card form { display: flex; flex-direction: column; text-align: left; }
.login-card label { color: var(--text-muted); font-size: 11px; font-weight: 500; margin: 0 0 4px; }
.login-card input { box-sizing: border-box; width: 100%; height: 32px; margin: 0 0 14px; padding: 0 10px; font: inherit; font-size: 13px;
                    color: var(--text); background-color: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-sm); outline: none; }
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,99,255,.25); }
.login-card button[type=submit] { box-sizing: border-box; width: 100%; height: 34px; margin: 6px 0 0; font: inherit; font-weight: 600; color: #fff;
                                  background-color: var(--accent); border: none; border-radius: var(--radius-sm); cursor: pointer; }
.login-card button[type=submit]:hover { background-color: var(--accent-hover); }

/* help: the ? button in the page's top-right corner (the comments panel's info block), and the Help dialog */
#asset_info_layout { position: relative; }
#asset_info_label { padding-right: 30px; box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; }  /* long names wrap, never under the button */
.anima-button#help_button {
    box-sizing: border-box; width: 22px; height: 22px; margin: 0; padding: 0; position: absolute; top: 8px; right: 8px;
    font-size: 0; border-radius: 50%; background-color: var(--raised); border: 1px solid var(--line); cursor: pointer;
}
.anima-button#help_button::before {
    content: ''; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; transform: translate(-50%, -50%);
    background-color: var(--text-muted);
    -webkit-mask: url('/static/img/question.svg') center / contain no-repeat; mask: url('/static/img/question.svg') center / contain no-repeat;
}
.anima-button#help_button:hover { background-color: var(--hover-bg); border-color: var(--accent); }
.anima-button#help_button:hover::before { background-color: var(--text); }

.anima-modalwindow.help-window {
    left: 50%; top: 50%; transform: translate(-50%, -50%);
    box-sizing: border-box; width: min(640px, 92vw); max-height: 80vh; margin: 0; padding: 0;
    display: flex; flex-direction: column; overflow: hidden;
}
.help-window .anima-close { position: absolute; top: 12px; right: 16px; float: none; font-size: 22px; line-height: 1; color: var(--text-muted); cursor: pointer; }
.help-window .anima-close:hover { color: var(--text); }
.help-window .anima-modalcontent { margin: 0; padding: 0; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.help-header { padding: 14px 48px 12px 20px; border-bottom: 1px solid var(--line); }
.help-title { font-size: 16px; font-weight: 600; color: var(--text); }
.help-subtitle { color: var(--text-muted); margin-top: 2px; }
.help-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 20px 20px; }
.help-section h3 { margin: 18px 0 8px; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.help-items { display: flex; flex-direction: column; gap: 8px; }
.help-item { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: baseline; line-height: 1.5; }
.help-item.help-text-only { grid-template-columns: 1fr; }
.help-shortcuts { gap: 4px; }
.help-text { color: var(--text); }
.help-keys { color: var(--text-muted); font-size: 11px; }
.help-window kbd {
    display: inline-block; min-width: 14px; padding: 0 5px; margin: 0 1px; text-align: center;
    font-family: var(--font-mono); font-size: 11px; line-height: 18px; color: var(--text);
    background-color: var(--raised); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
}

/* session role: a pill that says Leading or Following (click Following to take the lead) */
div.anima-player-session-button {
    width: auto; height: 20px; margin: 0 0 0 8px; padding: 0 9px; display: inline-flex; align-items: center;
    font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap; border-radius: 999px;
    -webkit-mask-image: none; mask-image: none;
    color: var(--text-muted); background-color: var(--raised); border: 1px solid var(--line);
}
div.anima-player-session-button.following:hover { color: var(--text); border-color: var(--accent); background-color: var(--hover-bg); }
div.anima-player-session-button.leading { color: #c4bfff; background-color: rgba(108,99,255,.18); border-color: var(--accent); cursor: default; }
