/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Prevent iOS Safari auto-zoom on focus for small inputs */
@media (max-width: 767px) {
  input[type="text"], input[type="email"], input[type="password"], input[type="search"],
  textarea, select { font-size: 16px !important; }
}

.table-hover > tbody > tr:hover > * { --bs-table-hover-bg: color-mix(in srgb, var(--bs-primary) 7%, var(--bs-body-bg)); }
.dropdown-item.disabled { color: var(--bs-tertiary-color) !important; }
.dropdown-item:not(.disabled) { color: var(--bs-body-color); }
.dropdown-header { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--bs-tertiary-color); }
.svg-icon { display: inline-block; width: 1em; height: 1em; vertical-align: -2px; }
.dropdown-item.active-mode { color: var(--bs-body-color) !important; }

.form-label {font-weight: 500}
em {font-weight: 500; font-style: normal;}
:root {
  --bs-primary: #5094FD;
  --bs-primary-rgb: 80, 148, 253;
  --bs-link-color: #5094FD;
  --bs-link-color-rgb: 80, 148, 253;
  --bs-link-hover-color: #3a7be0;
  --bs-link-hover-color-rgb: 58, 123, 224;
  --bs-focus-ring-color: rgba(80, 148, 253, 0.25);
  --blockquote-bg: #f0f4f8;
  --blockquote-border: #a0b4c8;
  --blockquote-text: #3a4a5a;
}

/* External link icon */
.ext-link::after {
  content: "";
  display: inline-block;
  width: 0.7em; height: 0.7em;
  margin-left: 0.25em;
  vertical-align: baseline;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M9 2h5v5m0-5L7 9M6 3H3a1 1 0 00-1 1v9a1 1 0 001 1h9a1 1 0 001-1v-3' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M9 2h5v5m0-5L7 9M6 3H3a1 1 0 00-1 1v9a1 1 0 001 1h9a1 1 0 001-1v-3' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
  opacity: 0.4;
}

a { text-decoration: none; }
.btn-link { color: var(--bs-primary) !important; }

::placeholder {color: var(--bs-tertiary-color) !important; opacity: 1;}
dt {font-weight: 500;}
small {font-size: 0.95em; color: var(--bs-tertiary-color);}
table th {font-weight: 500; opacity: 0.8;}
strong {font-weight: 600;}


.dull-link {opacity: 0.5;}
.dull-link:hover {opacity: 1;}


/* Markdown body */
.doc-card { display: inline-block; max-width: 100%; border: 1px solid var(--bs-border-color); border-radius: 6px; padding: 1.25rem 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.doc-card .edit-pencil { opacity: 0.5; position: absolute; top: -0.1rem; right: 0; z-index: 1;}
.doc-card .edit-pencil:hover { opacity: 1; }
@media (max-width: 767.98px) { .doc-card { display: block; border: none; border-radius: 0; padding: 0; box-shadow: none; } }
.markdown-body { line-height: 1.6; width: 80ch; max-width: 100%; }
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
  margin-top: 1.25em;
  margin-bottom: 0.5em;
  font-weight: 600;
  line-height: 1.3;
}
.markdown-body h1 { font-size: 1.6rem; }
.markdown-body h2 { font-size: 1.35rem; }
.markdown-body h3 { font-size: 1.15rem; }
.markdown-body h4 { font-size: 1rem; }
.markdown-body > *:first-child { margin-top: 0; }
.markdown-body > *:last-child { margin-bottom: 0; }
.markdown-body ul, .markdown-body ol { padding-left: 1.5em; }
.markdown-body li + li { margin-top: 0.2em; }
.markdown-body li > p { margin-bottom: 0.25em; }
.markdown-body li > p:last-child { margin-bottom: 0; }
.markdown-body blockquote {
  position: relative;
  padding: 0.6em 1em 0.6em 1.1em;
  margin: 1em 0;
  background: var(--blockquote-bg);
  border-radius: 8px;
  border-left: 3px solid var(--blockquote-border);
  color: var(--blockquote-text);
  font-style: italic;
}
.markdown-body blockquote > *:last-child { margin-bottom: 0; }
.markdown-body blockquote > *:first-child { margin-top: 0; }
.markdown-body p {margin-bottom: 0.5rem;}
.markdown-body pre {
  padding: 0.75em 1em;
  background: var(--bs-tertiary-bg);
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.875em;
}
.markdown-body code {
  padding: 0.15em 0.35em;
  background: var(--bs-secondary-bg);
  border-radius: 3px;
  font-size: 0.9em;
}
.markdown-body pre code { padding: 0; background: none; border-radius: 0; font-size: inherit; }
.markdown-body table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.markdown-body table th, .markdown-body table td {
  padding: 0.4em 0.75em;
  border: 1px solid var(--bs-border-color);
  text-align: left;
}
.markdown-body table th { background: var(--bs-tertiary-bg); }
.markdown-body img { max-width: 100%; }
.markdown-body hr { border: none; border-top: 1px solid var(--bs-border-color); margin: 1.5em 0; }
.markdown-body a { text-decoration: underline; }
.markdown-body mark { background: #fff3b0; border-radius: 3px; color: #222; }
.markdown-body del { opacity: 0.6; }
.markdown-body em { font-style: italic; font-weight: normal;}


.comment blockquote {
  padding: 0.25em 0.7em 0.25em 0.8em;
  margin: 0.2em 0 0.2em 3em;
  width: auto;
  display: inline-block;
  background: var(--blockquote-bg);
  border-radius: 4px;
  border-left: 3px solid var(--blockquote-border);
  color: var(--blockquote-text);
  position: relative;
}
.comment blockquote .comment-delete {float: right; margin-right: -3em; color: var(--bs-tertiary-color); font-size: 0.7rem; opacity: 0.2}
.comment blockquote .comment-delete:hover {opacity: 1;}


/* Drag and drop */
[data-drag-over] { outline: 2px solid var(--bs-primary); outline-offset: -2px; border-radius: 4px; }
[draggable] { cursor: grab; }
[draggable] a, [draggable] img { -webkit-user-drag: none; }
.dragging { opacity: 0.4; }



.ez-toolbar .navbar-position {opacity: 0.5; pointer-events: none; color: var(--bs-tertiary-color); line-height: 16px;}
.ez-toolbar .btn-outline-secondary {border: none; padding: 8px 6px; display: inline-flex; align-items: center; justify-content: center;}
.ez-toolbar .btn-outline-secondary svg {color: var(--bs-primary);}
.ez-toolbar .btn-outline-secondary:hover,
.ez-toolbar .btn-outline-secondary:focus {
  background: color-mix(in srgb, var(--bs-primary) 10%, transparent);
  color: var(--bs-primary);
}
.ez-toolbar .btn-outline-secondary.view-mode-active,
.ez-toolbar .btn-outline-secondary.active {
  background: color-mix(in srgb, var(--bs-primary) 8%, var(--bs-body-bg));
}
/* Zoom buttons */
.ez-toolbar .zoom-btn .svg-icon { opacity: 0.55; }
.ez-toolbar .zoom-btn:hover .svg-icon { opacity: 1; }
.ez-toolbar .zoom-btn.disabled { opacity: 0.25; pointer-events: none; }
.dropdown-zoom-btn { display: inline-flex; align-items: center; padding: 4px 5px; margin: -6px 0; border: none; background: none; color: var(--bs-primary); border-radius: 3px; vertical-align: middle; cursor: pointer; user-select: none; -webkit-user-select: none; }
.dropdown-zoom-btn { float: right; }
.dropdown-zoom-btn .svg-icon { width: 18px; height: 18px; opacity: 0.75; }
.dropdown-zoom-btn:hover { background: color-mix(in srgb, var(--bs-primary) 10%, transparent); }
.dropdown-zoom-btn:hover .svg-icon { opacity: 1; }
.dropdown-zoom-btn.disabled { opacity: 0.2; pointer-events: auto; cursor: default; }
.dropdown-mode-icon { display: inline-block; width: 1.2em; text-align: center; opacity: 0.35; }
.dropdown-mode-icon.active { opacity: 1; }



.inline-emoji {font-size: 0.85em}


.path-icon .item-icon .thumb-wrap > img { max-width: 80cqi; max-height: 80cqi; object-fit: contain; }


.path-icon .item-icon { display: inline-flex; width: 40px; vertical-align: middle; margin-left: -4px; margin-right: -4px; }
.item-path {display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -0.04em; color: var(--bs-tertiary-color); padding-bottom: 3px; margin-bottom: -3px;}
.item-path strong {font-weight: 450; color: var(--bs-body-color);}


.activity-columns { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.activity-columns > * { flex: 1 1 20ch; max-width: 40ch; }
.activity-column {}

.activity-actions { font-size: 0.875rem; display: flex; gap: 0.75rem; }
.activity-action a { color: var(--bs-tertiary-color); }
.activity-action:hover a svg { color: var(--bs-primary); }

.activity-action { opacity: 0.5; }
.activity-action:hover { opacity: 1; }

.activity-action:hover a svg,
.activity-action .star-toggle:hover .star-icon,
.activity-action .heart-toggle:hover .heart-icon { filter: drop-shadow(0 0 2px color-mix(in srgb, currentColor 30%, var(--bs-body-bg))); }




.reaction-label { color: var(--bs-tertiary-color); margin-left: 2px; }
.activity-pane {letter-spacing: -0.02em; color: var(--bs-secondary-color); list-style: none; padding: 0; font-size: 0.875rem;}
.activity-pane li {margin-bottom: 0.2rem;}
.activity-pane .when {display: inline-block; width: 2.7rem; text-align: right;}
.activity-pane .when::after {content: ' '; margin: 0 0.1em; color: var(--bs-tertiary-color);}

.activity-pane a {color: var(--bs-body-color);}
.activity-pane a:hover { text-decoration: underline; }

.activity-pane em    {color: var(--bs-secondary-color); font-weight: 400;}
.activity-pane small {color: var(--bs-tertiary-color); font-size: inherit;}
.activity-toggle { max-width: 430px; padding: 8px 12px; margin: -8px -12px; border-radius: 4px; cursor: pointer; user-select: none; transition: opacity 0.2s ease, box-shadow 1s ease; }
.activity-toggle-border { transition: border-color 0.2s ease; padding-bottom: 3px; }
.activity-triangle { font-size: 0.6em; vertical-align: 2px; display: inline-block; transition: transform 0.2s ease; }
.activity-toggle.collapsed:hover { box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.activity-toggle:hover { opacity: 1 !important; }

/* Folder activity charts */
.folder-chart { margin-bottom: 1rem; }
.folder-chart h6 { font-size: 0.8em; color: var(--bs-tertiary-color); margin-bottom: 0.3rem; }
.folder-chart-row { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8em; margin-bottom: 2px; border-radius: 3px; padding: 1px 4px; background: linear-gradient(to left, rgba(var(--bs-primary-rgb), 0.13) var(--bar), transparent var(--bar)); }
.folder-chart-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-chart-label a { color: var(--bs-body-color); text-decoration: none; }
.folder-chart-label a:hover { text-decoration: underline; }
.folder-chart-count { flex: 0 0 auto; color: var(--bs-tertiary-color); font-size: 0.85em; }
.folder-activity-tab { color: var(--bs-tertiary-color); text-decoration: none; }
.folder-activity-tab:hover { color: var(--bs-body-color); }
.folder-activity-tab.active { color: var(--bs-body-color); font-weight: 500; }


/* Scalable item icons — container-query based.
   Parent sets .item-icon width; everything inside scales via cqi. */
.item-icon { container-type: inline-size; width: 100%; display: flex; align-items: center; justify-content: center; }
.item-icon:has(.emoji-icon), .item-icon:has(.media-placeholder) { max-width: 360px; }
.item-icon .emoji-icon { width: 80cqi; height: 80cqi; font-size: 60cqi; line-height: 80cqi; }
.item-icon .emoji-icon__base { font-size: 60cqi; left: -7.5cqi; top: -7.5cqi; }
.item-icon .emoji-icon__badge { font-size: 45cqi; bottom: 7.5cqi; right: 2.5cqi; }
.item-icon .emoji-icon__extra { font-size: 30cqi; bottom: -2.5cqi; right: 5cqi; }
.item-icon .emoji-icon__thumb { width: 60cqi; height: 60cqi; padding: 1px; }
.item-icon .emoji-icon__badge svg:not(.emoji-icon__play) { height: 45cqi; width: 45cqi; }
.item-icon .emoji-icon__play { width: 25cqi; height: 25cqi; }
.item-icon .thumb-wrap { display: inline-flex; position: relative; align-items: center; justify-content: center; }
.item-icon .thumb-wrap > img { max-width: 100%; height: auto; border: 1px solid var(--bs-border-color); padding: 0.05em; border-radius: 2px; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
/* Audio play/pause button (hollow triangle) */
.audio-play-btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.thumb-wrap > .audio-play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: auto; height: auto; padding: clamp(4px, 12cqi, 16px); background: color-mix(in srgb, var(--bs-primary) 50%, transparent); border-radius: 50%; color: #fff; filter: drop-shadow(0 0 2px rgba(0,0,0,0.3)); }
.thumb-wrap > .audio-play-btn:hover { background: color-mix(in srgb, var(--bs-primary) 90%, transparent); }
.thumb-wrap > .audio-play-btn .svg-icon { width: clamp(12px, 30cqi, 28px); height: clamp(12px, 30cqi, 28px); }
/* Video play/pause button (solid triangle) */
.video-play-btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.thumb-wrap > .video-play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: auto; height: auto; padding: clamp(0px, 6cqi, 16px); background: rgba(0,0,0,0.55); border-radius: 50%; color: #fff; filter: drop-shadow(0 0 2px rgba(0,0,0,0.3)); }
.thumb-wrap > .video-play-btn:hover { background: rgba(0,0,0,0.8); }
.thumb-wrap > .video-play-btn .svg-icon { width: clamp(12px, 20cqi, 28px); height: clamp(12px, 20cqi, 28px); }
.media-placeholder { display: inline-flex; align-items: center; opacity: 0.3; justify-content: center; width: 80cqi; height: 80cqi; background: var(--bs-secondary-bg); border-radius: 4px; font-size: 60cqi; line-height: 80cqi; }

/* Emoji icon — structure & decoration (sizes come from cqi rules above) */
.item-icon .emoji-icon { display: inline-block; text-align: center; vertical-align: middle; }
.item-icon .emoji-icon--composite { position: relative; }
.item-icon .emoji-icon--shrink { transform: scale(0.75); }
.item-icon .emoji-icon__base { position: relative; -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.75), rgba(0,0,0,0.1)); mask-image: linear-gradient(to bottom, rgba(0,0,0,0.75), rgba(0,0,0,0.1)); }
.item-icon .emoji-icon__thumb { object-fit: cover; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); padding: 0.05em; border-radius: 2px; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
.item-icon .emoji-icon__badge:has(~ .emoji-icon__extra) .emoji-icon__thumb { -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1), rgba(0,0,0,0.5)); mask-image: linear-gradient(to bottom, rgba(0,0,0,1), rgba(0,0,0,0.5)); }
.item-icon .emoji-icon__badge { position: absolute; line-height: 1; color: var(--bs-body-color); }
.item-icon .emoji-icon__extra { position: absolute; line-height: 1; filter: drop-shadow(0 0 2px var(--bs-body-bg)) drop-shadow(0 0 4px var(--bs-body-bg)); }
.item-icon .emoji-icon__play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); filter: drop-shadow(0 0 1px rgba(0,0,0,0.4)) drop-shadow(0 0 3px rgba(0,0,0,0.2)); pointer-events: none; margin: 0; }
.item-icon .emoji-icon__badge svg:not(.emoji-icon__play) { margin: 0 4px 0 0;}
.item-icon .emoji-icon__badge .icon-score { font-weight: 500; color: #198754; display: block; padding: 0 3px; font-size: 0.8em; }
.item-icon .emoji-icon__badge .icon-score::before { content: '+'; font-size: 0.75em; font-weight: 400; vertical-align: 1px; }




.ez-icon { display: inline-block; width: 32px; height: 32px; padding: 4px;}






/* Tiles view */
.tiles-header { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; justify-content: flex-end; }
.tiles-header .zoom-btn { font-size: 0.85rem; padding: 0 7px; line-height: 1.6; border: 1px solid var(--bs-border-color); border-radius: 4px; background: var(--bs-body-bg); cursor: pointer; color: var(--bs-secondary-color); }
.tiles-header .zoom-btn:hover { border-color: var(--bs-secondary-color); color: var(--bs-body-color); }

.tiles-wrap { position: relative; }
.tile { border: 1px solid var(--bs-border-color); border-radius: 6px; overflow: hidden;
        cursor: pointer; box-shadow: 0 2px 8px transparent;
        transition: box-shadow 0.15s, left 0.3s ease, top 0.3s ease, width 0.3s ease, height 0.3s ease, transform 0.3s ease; }
.tile:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.tile .item-icon .thumb-wrap { width: 100%; }
.tile .item-icon .thumb-wrap > img { width: 100%; display: block; border: none; padding: 0; box-shadow: none; }
.img-tiny { image-rendering: pixelated; }
.tile.row-active { border-color: var(--bs-primary); outline: 1px solid var(--bs-primary); }


/* Item props panel */
.item-props-panel {margin-left: 1rem; font-size: 0.875rem; position: sticky; top: 1rem; align-self: flex-start; max-height: calc(100vh - 2rem); overflow-y: auto;}
.props-close-btn {position: absolute; right: 0rem; top: 0rem; z-index: 1; color: var(--bs-tertiary-color) !important; text-decoration: none; font-size: 1.6em; padding: 0 0 0.25em 0.25em; line-height: 1; width: 1.8em; height: 1.8em; display: flex; align-items: center; justify-content: center; border-radius: 0 0 0 50%; background: rgba(127,127,127,0.1);}
.item-props-panel,
.item-props-panel > * {width: 340px;}
.item-props-panel .prop-section {font-weight: 300; font-size: 1.05rem;}
.item-props-panel .prop-section ~ .prop-section {display: block; border-top: 1px solid var(--bs-border-color); padding-top: 0.85em;}

.item-props-panel .item-icon:has(.emoji-icon) { max-width: 160px; margin: 0 auto; }
.item-props-panel .item-icon:has(.media-placeholder) { max-width: 200px; margin: 0 auto; }
.item-props-panel .item-icon .thumb-wrap img { max-height: 160px; border-radius: 4px; }
.item-props-panel dl {display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.5rem; margin-top: 0.25rem; letter-spacing: -0.03em;}
.item-props-panel dt {margin: 0; color: var(--bs-tertiary-color); font-weight: 400; min-width: 45px}
.item-props-panel dd {margin: 0; color: var(--bs-body-color); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}

.item-props-panel .props-thumb { width: 100%; height: 155px; display: flex; flex-direction: column; justify-content: center; }


/* For smaller screens, make properties panel thinner */
@media (max-width: 992px) {
  .item-props-panel, .item-props-panel > * {width: 280px;}
}

/* Small screens: pin properties panel to bottom of viewport */
@media (max-width: 576px) {
  .item-props-panel:not(.d-none) {
    display: block !important;
    position: fixed !important; bottom: 0; left: 0; right: 0; top: auto;
    z-index: 1040;
    margin: 0; width: 100% !important; max-height: 40vh; overflow-y: auto;
    border-top: 1px solid var(--bs-border-color); box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
    background: var(--bs-body-bg);
  }
  .item-props-panel > * { width: 100% !important; }
  .item-props-panel .props-thumb { float: left; width: 140px; margin: 0 0.75rem 0.25rem 0 !important; }

  .item-props-panel .item-icon:has(.emoji-icon),
  .item-props-panel .item-icon:has(.media-placeholder) { width: 140px; margin: 0 auto; }
  .item-props-panel .props-thumb .item-icon .thumb-wrap img { max-height: 120px; }
}


.item-props-panel .btn-link,
.item-props-panel a {opacity: 0.65;}
.item-props-panel .props-thumb a {opacity: 1;}

.item-props-panel dd:hover a.prop-edit-icon,
.item-props-panel .btn-link:hover,
.item-props-panel a:hover {opacity: 1;}

.item-props-panel .prop-edit-icon { font-size: 1em; flex-shrink: 0; opacity: 0.4; }
.prop-delete-link:hover { color: var(--bs-danger) !important; }

/* Reusable property-panel helpers */
.prop-action-link { font-size: 0.75em; font-weight: normal; }
.click-edit-display { cursor: pointer; }
.click-edit-input { font-size: inherit; padding: 1px 4px; width: 100%; }
.click-edit-select { padding: 1px 2rem 1px 0.5rem; font-size: inherit; }
.prop-defaults-header { font-size: 0.82em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--bs-tertiary-color); margin-top: -0.5rem; }
.check-slot { display: inline-block; width: 1.2em; }
.member-role { font-size: 0.9em; font-weight: 300; letter-spacing: -0.02em; }
.audio-thumb { max-width: 320px; border-radius: 6px; box-shadow: 0 2px 12px rgba(0,0,0,0.12); }
.note-thumb { max-width: 180px; max-height: 180px; border: 1px solid var(--bs-border-color); border-radius: 4px; }
.map-embed { border: none; border-radius: 4px; max-width: 100%; margin-bottom: 0.75rem; }

.member-item.user-self a {font-weight: 600; opacity: 1;}
.member-item.user-self .member-owner a {color: var(--bs-body-color); font-weight: inherit;}

.member-item.user-self .member-owner a {opacity: 1 !important;}
.member-item.role-explicit .member-owner span + span {color: #d63384; opacity: 0.8}



/* Inline Edit Status */
.inline-edit-status {
  position: absolute;
  top: 0.5em;
  right: 0.5em;
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  background: rgba(var(--bs-body-bg-rgb), 0.9);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  z-index: 1;
}
.inline-edit-status:empty { display: none; }
.inline-edit-status--saved {
  color: #198754;
  animation: fade-to-gray 10s ease-out forwards;
}
.inline-edit-status--error { color: var(--bs-danger); }

@keyframes fade-to-gray {
  0% { color: #198754; }
  100% { color: var(--bs-tertiary-color); }
}

/* Star toggle (header) */
.star-toggle {
  display: inline-flex; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer;
  font-size: 1em; color: var(--bs-tertiary-color); padding: 0; line-height: 1;
}
.star-toggle > button {
  all: unset; display: inline-flex; align-items: center; gap: 2px; cursor: pointer;
}
.star-toggle.disabled { cursor: default; }
.star-toggle:hover .star-icon,
.star-toggle.active .star-icon { color: #f0ad4e; }
.star-count { font-size: 0.75rem; color: var(--bs-tertiary-color); }

/* Heart toggle (table column) */
.heart-toggle {
  display: inline-flex; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer;
  font-size: 1em; padding: 0; line-height: 1;
}
.heart-toggle > button {
  all: unset; display: inline-flex; align-items: center; gap: 2px; cursor: pointer;
}
.heart-toggle.disabled { cursor: default; }
.heart-icon { color: var(--bs-tertiary-color); }
.heart-toggle:hover .heart-icon,
.heart-toggle.active .heart-icon { color: #e25555; }
.heart-count { font-size: 0.75rem; color: var(--bs-tertiary-color); }

/* Forum post header */
.forum-post-title { font-size: 1.25rem; font-weight: 500; line-height: 1.3; }
.forum-post-meta { font-size: 0.85rem; color: var(--bs-tertiary-color); }

/* Global Media Player */
.global-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1050;
}
.global-player.hidden { display: none; }
body.has-global-player { padding-bottom: 48px; }

/* Control bar */
.global-player-bar {
  height: 48px;
  background: #222;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
}

.global-player-btn {
  background: #333;
  border: 1px solid #444;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}
.global-player-btn:hover { background: #444; }
.global-player-btn.play-btn { width: 40px; }

.global-player-track {
  color: #ccc;
  font-size: 14px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-player-visualizer {
  width: 64px;
  height: 32px;
  border-radius: 3px;
  background: #222;
}

.global-player-progress {
  flex: 2;
  height: 6px;
  background: #444;
  border-radius: 3px;
  cursor: pointer;
  overflow: hidden;
}
.global-player-progress-bar {
  height: 100%;
  background: #0d6efd;
  width: 0;
  transition: width 0.1s linear;
}

.global-player-close {
  background: none;
  border: none;
  color: #666;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}
.global-player-close:hover { color: #f66; }

/* PiP video window */
.global-player-pip {
  position: fixed;
  bottom: 56px;
  right: 12px;
  width: 480px;
  background: #000;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.5);
  z-index: 1051;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.global-player-pip.hidden { display: none; }
.global-player-pip-header {
  display: flex;
  align-items: center;
  padding: 0 8px;
  background: #222;
  cursor: move;
  height: 36px;
  gap: 6px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.global-player-pip-title {
  flex: 1;
  font-size: 13px;
  color: #ccc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.global-player-pip-btn {
  background: #333;
  border: 1px solid #444;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.global-player-pip-btn:hover { background: #444; }
.global-player-pip-content { position: relative; }
.global-player-video {
  width: 100%;
  background: #000;
  display: block;
}
#global-player-yt,
#global-player-yt iframe {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  display: block;
}
.global-player-pip:fullscreen { width: 100vw; height: 100vh; border-radius: 0; }
.global-player-pip:fullscreen .global-player-pip-header { display: none; }
.global-player-pip:fullscreen .global-player-video,
.global-player-pip:fullscreen #global-player-yt,
.global-player-pip:fullscreen #global-player-yt iframe { width: 100%; height: 100%; aspect-ratio: auto; }
.global-player-pip:fullscreen .global-player-pip-content { width: 100%; height: 100%; }

@media (max-width: 576px) {
  .global-player-bar { padding: 0 8px; gap: 6px; }
  .global-player-btn { width: 28px; height: 28px; font-size: 12px; }
  .global-player-btn.play-btn { width: 34px; }
  .global-player-track { font-size: 12px; }
  .global-player-pip { width: 45%; right: 4px; bottom: 52px; }
}

/* Rating bar (post view) */
.rating-bar {
  display: flex; align-items: center; gap: 0.4rem; padding: 0.75rem 0;
  flex-wrap: wrap;
}
.rating-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.5rem; height: 2.5rem; border-radius: 0.75rem;
  background: var(--bs-tertiary-bg); border: 2px solid transparent;
  font-size: 1.1rem; font-weight: 600; color: var(--bs-secondary-color);
  cursor: pointer; transition: border-color 0.15s;
}
.rating-btn.fire-btn { padding: 0 0.5rem; }
.rating-btn > button {
  all: unset; display: inline-flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; cursor: pointer;
}
.rating-btn.disabled { cursor: default; opacity: 0.7; }
.rating-btn:hover { border-color: var(--bs-border-color); }
.rating-btn.active { border-color: var(--bs-primary); background: color-mix(in srgb, var(--bs-primary) 15%, var(--bs-body-bg)); color: var(--bs-primary); }
.rating-label { font-size: 0.85rem; color: var(--bs-tertiary-color); margin-right: 0.15rem; }
.rating-avg { font-size: 0.85rem; color: var(--bs-tertiary-color); margin-left: 0.25rem; }

/* Rating score (table cell) */
.rating-score {
  display: inline-block; font-size: 0.8rem; font-weight: 600;
  color: var(--bs-tertiary-color); min-width: 2rem; text-align: center;
}

/* Access badges */
.access-badge {
  display: inline-block;
  font-size: 0.75em;
  line-height: 1;
  padding: 3px 4px;
  border-radius: 5px;
  vertical-align: 2px;
  letter-spacing: -0.03em;
}
.access-badge.private {
  border: 1px solid color-mix(in srgb, #e25555 50%, var(--bs-body-bg));
  color: color-mix(in srgb, #c44 90%, white);
  padding-right: 5px;
  padding-left: 2px;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(226,85,85,0.1),
      rgba(226,85,85,0.1) 3px,
      rgba(226,85,85,0.05) 3px,
      rgba(226,85,85,0.05) 6px
    );
}
.access-badge.guests  { border: 1px solid var(--bs-tertiary-color); color: var(--bs-tertiary-color); }
.access-badge.public  { border: 1px solid #5b9bd5; color: #5b9bd5; }
.access-badge.members { border: 1px solid var(--bs-border-color); color: var(--bs-secondary-color); }
.access-badge.shared  {
  border: 1px solid color-mix(in srgb, #e25555 50%, var(--bs-body-bg));
  color: #c44;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(226,85,85,0.1),
      rgba(226,85,85,0.1) 3px,
      rgba(226,85,85,0.05) 3px,
      rgba(226,85,85,0.05) 6px
    );
}
.access-badge.role    { background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); color: var(--bs-secondary-color); font-weight: normal; }

/* Tag pills */
.tag-pill-group { display: inline-flex; flex-wrap: wrap; gap: 3px; align-items: center; vertical-align: 5%; }
.tag-pill { opacity: 0.7; display: inline-flex; align-items: center; gap: 2px; background: color-mix(in srgb, var(--bs-primary) 20%, var(--bs-body-bg)); color: var(--bs-primary); border-radius: 10px; padding: 1px 7px; font-size: 0.85em; font-weight: 500; line-height: 1.5; letter-spacing: -0.04em; white-space: nowrap; margin: -2px 0; }
.tag-pill:hover {opacity: 1;}
.tag-pill a { color: inherit; }
.tag-remove { all: unset; cursor: pointer; color: var(--bs-tertiary-color); font-size: 0.85em; line-height: 1; }
.tag-remove:hover { color: var(--bs-body-color); }
.tag-input { border: none; background: transparent; border-radius: 3px; padding: 1px 6px; font-size: 0.85em; width: 80px; outline: none; }

/* Strips (justified row) view */
.strips-wrap { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.strips-wrap .tile { overflow: hidden; border-radius: 4px; cursor: pointer; }
.strips-wrap .tile img { display: block; min-width: 10px; min-height: 10px; }

/* List view */
.list-view { --list-row-height: 40px; }
.list-row { letter-spacing: -0.03em; display: flex; align-items: center; gap: 0.1rem; height: var(--list-row-height); padding: 0 0.2rem; cursor: pointer; border-bottom: 1px solid var(--bs-border-color); transition: background 0.1s; }
.list-row:hover { background: var(--bs-tertiary-bg); }
.list-row.row-active { background: color-mix(in srgb, var(--bs-primary) 12%, var(--bs-body-bg)); box-shadow: inset 3px 0 0 var(--bs-primary); }
.list-row-icon { flex: 0 0 var(--list-row-height); display: flex; align-items: center; justify-content: center; }
.list-row-icon .item-icon { width: calc(var(--list-row-height) - 8px); }
.list-row-icon img { max-height: calc(var(--list-row-height) - 8px); object-fit: contain; }
.list-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; line-height: 1.3; }
.list-row-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.9rem; }
.list-row-title a:not(.tag-pill) { color: var(--bs-body-color); text-decoration: none; }
.list-row-title a:hover:not(.tag-pill) { text-decoration: underline; }
.list-row[data-folder] .list-row-title a { font-weight: 500; }
.list-row-meta { line-height: 1em;font-size: 0.825rem; color: var(--bs-tertiary-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row-react { flex: 0 0 auto; font-size: 0.85rem; color: var(--bs-tertiary-color); }

/* Lightbox overlay */
.lightbox-overlay   { position: fixed; background: rgba(0,0,0,0.92); z-index: 1030;
                      display: flex; align-items: center; justify-content: center;
                      border-radius: 8px; }
.lightbox-img       { max-width: calc(100% - 80px); max-height: calc(100% - 40px); object-fit: contain;
                      user-select: none; -webkit-user-drag: none; }
.lightbox-close     { position: absolute; top: 8px; right: 12px; background: none; border: none;
                      color: var(--bs-secondary-color); font-size: 1.8rem; cursor: pointer; line-height: 1; padding: 4px 8px; }
.lightbox-close:hover { color: #fff; }
.lightbox-counter   { position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
                      color: var(--bs-tertiary-color); font-size: 0.8rem; pointer-events: none; }
.lightbox-nav       { position: absolute; top: 50%; transform: translateY(-50%); background: none;
                      border: none; color: var(--bs-secondary-color); font-size: 1.4rem; cursor: pointer; padding: 12px; }
.lightbox-nav:hover { color: #fff; }
.lightbox-prev      { left: 8px; }
.lightbox-next      { right: 8px; }
@media (max-width: 576px) {
  .lightbox-overlay { left: 0 !important; right: 0 !important; border-radius: 0; }
}

/* Grid view — Win98 explorer style: fixed icon area, labels aligned across rows */
.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--grid-min, 120px), calc(100% * var(--grid-max-frac, 0.25))));
  gap: 0px;
}
.grid-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  container-type: inline-size;
  padding: 4px 2px 2px;
  letter-spacing: -0.04em;
}
.grid-cell:hover { background: var(--bs-tertiary-bg); }
.grid-cell.row-active { background: color-mix(in srgb, var(--bs-primary) 12%, var(--bs-body-bg)); outline: 1px solid var(--bs-primary); }
.grid-cell .item-icon { display: flex; align-items: center; justify-content: center; min-height: 80cqi; }
.grid-cell .item-icon .thumb-wrap > img { max-width: 80cqi; max-height: 80cqi; object-fit: contain; }
.grid-cell-title {
  font-size: calc(0.75rem + var(--grid-font-bump, 0px));
  line-height: 1.15;
  text-align: center;
  overflow-wrap: break-word;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding: 1px 2px 0;
  width: 100%;
}
.grid-cell-title a { color: var(--bs-body-color); text-decoration: none; }
.grid-cell-title a:hover { text-decoration: underline; }
.grid-cell[data-folder] .grid-cell-title a { font-weight: 500; }
.grid-cell-meta {
  font-size: calc(0.65rem + var(--grid-font-bump, 0px));
  line-height: 1.1;
  color: var(--bs-tertiary-color);
  text-align: center;
  width: 100%;
  padding: 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Media containers (video/image bg in show views) */
.media-container { background: #000; text-align: center; max-width: 100%; }
.media-container-light { background: var(--bs-secondary-bg); text-align: center; padding: 1em; }

/* Dash admin cards */
.dash-card { border: 1px solid var(--bs-border-color); transition: background 0.1s; }
.dash-card:hover { background: var(--bs-tertiary-bg); }

/* Data table (table view) */
.data-table-wrap { overflow-x: auto; }
.data-table { min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.85rem; letter-spacing: -0.01em; }
.data-table thead th {
  font-size: 0.7rem; font-weight: 400; text-transform: uppercase; letter-spacing: -0.02em;
  color: var(--bs-tertiary-color); background: var(--bs-tertiary-bg); border-bottom: 2px solid var(--bs-border-color);
  padding: 0.4rem 0.3rem; position: sticky; top: 0; z-index: 1;
}
.data-table td {
  padding: 0.35rem 0.45rem; border-bottom: 1px solid var(--bs-border-color);
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--bs-secondary-color); vertical-align: middle;
}
.data-table th { white-space: nowrap; }
.data-table .col-icon { width: var(--table-icon-size, 54px); }
.data-table td:first-child,
.data-table th:first-child { min-width: var(--table-icon-size, 54px); }
.data-table .col-name { max-width: none; }
.data-table td:nth-child(2) { color: var(--bs-body-color); }
.data-table tr[data-href] { cursor: pointer; transition: background 0.1s; }
.data-table tbody tr:hover td { background: var(--bs-tertiary-bg); }
.data-table tr.row-active td { background: color-mix(in srgb, var(--bs-primary) 12%, var(--bs-body-bg)); }
.data-table tr.row-active td:first-child { box-shadow: inset 3px 0 0 var(--bs-primary); }
.data-table tr[data-folder] td:nth-child(2) { font-weight: 500; }
.data-table td a { color: inherit; text-decoration: none; }
.data-table td a:hover { text-decoration: underline; }
.data-table .item-icon { display: block; text-align: center; }
.data-table .item-icon img,
.data-table .item-icon .thumb-wrap > img { max-height: var(--table-icon-size, 54px); object-fit: contain; }
.data-table-wrap.table-wrap-text td { white-space: normal; }
.data-table td:nth-child(2) > a,
.data-table .td-clamp {
  display: -webkit-box;
  -webkit-line-clamp: var(--table-clamp, 1);
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Dark mode overrides */
[data-bs-theme="dark"] {
  --bs-primary: #5094FD;
  --bs-primary-rgb: 80, 148, 253;
  --bs-link-color: #6db3ff;
  --bs-link-color-rgb: 109, 179, 255;
  --bs-link-hover-color: #93c8ff;
  --bs-link-hover-color-rgb: 147, 200, 255;
  --bs-focus-ring-color: rgba(80, 148, 253, 0.25);
  --blockquote-bg: #1e2a3a;
  --blockquote-border: #5070a0;
  --blockquote-text: #b0c0d0;
}
