/*
 * 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(--accent) 7%, white); }
.dropdown-item.disabled { color: #ccc !important; }
.dropdown-item:not(.disabled) { color: #333; }
.dropdown-header { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: #999; }
.svg-icon { display: inline-block; width: 1em; height: 1em; vertical-align: -2px; }
.dropdown-item.active-mode { color: #333 !important; }

.form-label {font-weight: 500}
em {font-weight: 500; font-style: normal;}
:root { --accent: #5094FD; }

/* 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; color: var(--accent); }
.btn-link { color: var(--accent) !important; }
s.btn-link:hover {  }

::placeholder {color: #BBB !important; opacity: 1;}
dt {font-weight: 500;}
small {font-size: 0.95em; color: #bbb;}
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 #e0e0e0; 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: #f0f4f8;
  border-radius: 8px;
  border-left: 3px solid #a0b4c8;
  color: #3a4a5a;
  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: #f6f8fa;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.875em;
}
.markdown-body code {
  padding: 0.15em 0.35em;
  background: #f0f0f0;
  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 #ddd;
  text-align: left;
}
.markdown-body table th { background: #f6f8fa; }
.markdown-body img { max-width: 100%; }
.markdown-body hr { border: none; border-top: 1px solid #ddd; margin: 1.5em 0; }
.markdown-body a { text-decoration: underline; }
.markdown-body mark { background: #fff3b0; border-radius: 3px; }
.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: #f0f4f8;
  border-radius: 4px;
  border-left: 3px solid #a0b4c8;
  color: #3a4a5a;
  position: relative;
}
.comment blockquote .comment-delete {float: right; margin-right: -3em; color: #CCC; font-size: 0.7rem; opacity: 0.2}
.comment blockquote .comment-delete:hover {opacity: 1;}


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



.ez-toolbar .navbar-position {opacity: 0.5; pointer-events: none; color: #888; 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(--accent);}
.ez-toolbar .btn-outline-secondary:hover,
.ez-toolbar .btn-outline-secondary:focus {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
}
.ez-toolbar .btn-outline-secondary.view-mode-active,
.ez-toolbar .btn-outline-secondary.active {
  background: #edf4ff;
}
/* Grid zoom pill — groups grid icon + zoom buttons in a rounded capsule */
.ez-toolbar .zoom-pill {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid #f4f4f4;
  border-radius: 7px;
  padding: 0;
  margin-left: 2px;
  gap: 0;
}
.ez-toolbar .zoom-pill .btn-outline-secondary { padding: 6px 5px; }
.ez-toolbar .zoom-pill .zoom-btn { padding: 6px 6px; }
.ez-toolbar .zoom-pill .zoom-btn .svg-icon { width: 14px; height: 14px; opacity: 0.55; }
.ez-toolbar .zoom-pill .zoom-btn:hover .svg-icon { opacity: 1; }
.ez-toolbar .zoom-pill .zoom-btn.disabled { opacity: 0.25; pointer-events: none; }



.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: #bbb; padding-bottom: 3px; margin-bottom: -3px;}
.item-path strong {font-weight: 450; color: #333;}


.activity-column {max-width: 60ch;}
.activity-pane {letter-spacing: -0.02em; color: #777; 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: #CCC;}

.activity-pane em    {color: #555; font-weight: 400;}
.activity-pane small {color: #888; font-size: inherit;}
.activity-toggle { max-width: 586px; padding: 8px 12px; margin: -8px -12px; border-radius: 4px; transition: opacity 0.2s ease, box-shadow 1s ease; }
.activity-toggle.collapsed:hover { box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.activity-toggle:hover { opacity: 1 !important; }


/* 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(.audio-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-block; position: relative; }
.item-icon .thumb-wrap > img { max-width: 100%; height: auto; border: 1px solid #BBB; padding: 0.05em; border-radius: 2px; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
/* Audio play/pause button */
.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(--accent) 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(--accent) 90%, transparent); }
.thumb-wrap > .audio-play-btn .svg-icon { width: clamp(12px, 30cqi, 28px); height: clamp(12px, 30cqi, 28px); }
.audio-placeholder { display: inline-flex; align-items: center; opacity: 0.3; justify-content: center; width: 80cqi; height: 80cqi; background: #e8e8e8; 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: white; border: 1px solid #BBB; 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: black; }
.item-icon .emoji-icon__extra { position: absolute; line-height: 1; filter: drop-shadow(0 0 2px white) drop-shadow(0 0 4px white); }
.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; }
.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;}





/* Items table */

.items-table {table-layout: fixed; font-size: 0.9rem; letter-spacing: -0.02em; margin-left: 0.7rem;}
.items-table th {font-size: 0.825rem; color: #666}
.items-table td {vertical-align: middle;}
.items-table tr[data-href] {cursor: pointer;}

.items-table tr > *             { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.items-table tr > :nth-child(1) { width: 40px; padding-inline: 0; }
.items-table tr > :nth-child(2) { text-align: left; }
.items-table tr > :nth-child(3) { width: 2.5rem; color: #888; font-size: 0.85rem; text-align: left;}
.items-table tr > :nth-child(4) { width: 5rem; color: #888; font-size: 0.85rem; padding-right: 0.5rem;}

.items-table .item-title     {line-height: 0.8rem; display: block;}
.items-table .item-title a   {color: #333;}
.items-table .item-title div {color: #999; font-size: 0.75rem; margin-top: 0.2em}

.items-table.zoom-1 .item-icon { min-height: 40px; }
.items-table.zoom-grid .item-icon:has(.emoji-icon), .items-table.zoom-grid .item-icon:has(.audio-placeholder) { max-width: 50%; }
.items-table .item-icon .thumb-wrap > img { max-width: 80cqi; max-height: 80cqi; object-fit: contain; }


@media (max-width: 767px) {
  .items-table { font-size: 0.85em; }
  .items-table tr > :nth-child(3) { width: 2rem; font-size: 0.75rem;}
  .items-table tr > :nth-child(4) { width: 4.5rem; font-size: 0.75rem;}
  .items-table td img {max-width: 24px; max-height: 24px;}
}

/* Items table - zoom grid base */
.items-table.zoom-grid { display: block; table-layout: auto; }
.items-table.zoom-grid thead { display: none; }
.items-table.zoom-grid tbody { display: grid; gap: 0; }
.items-table.zoom-grid tr {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr auto;
  grid-template-areas: "icon icon" "name name";
}
.items-table.zoom-grid td {
  width: auto !important;
  text-align: left !important;
  padding: 0.2rem 0.25rem 0;
  overflow: visible;
  white-space: normal;
  border: 0;
}
.items-table.zoom-grid td:nth-child(1) {grid-area: icon; text-align: center !important; display: flex; align-items: flex-end; justify-content: center;}
.items-table.zoom-grid td:nth-child(2) {grid-area: name; font-size: 0.75rem; height: 52px;}
.items-table.zoom-grid td:nth-child(3) {display: none;}
.items-table.zoom-grid td:nth-child(4) {display: none;}

.items-table.zoom-grid .item-title     {text-align: center;}
.items-table.zoom-grid .item-title a   {overflow-wrap: break-word; word-break: break-word; -webkit-hyphens: auto; hyphens: auto; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;}
.items-table.zoom-grid .item-title a:nth-child(2) {display: none;}

/* Zoom levels */
.items-table.zoom-2 tbody { grid-template-columns: repeat(auto-fit, minmax(108px, 10%)); letter-spacing: -0.03em; } /* 100 to ~160px */
.items-table.zoom-3 tbody { grid-template-columns: repeat(auto-fit, minmax(120px, 25%)); } /* 120 to ~320 px */
.items-table.zoom-4 tbody { grid-template-columns: repeat(auto-fit, minmax(180px, 50%)); } /* 180 to ~640 px */
.items-table.zoom-4.pdf-pages tbody tr:first-child { grid-column: 1 / -1; }
.items-table.zoom-5 tbody { grid-template-columns: 1fr;}
.items-table.zoom-5 tr { padding: 2em 0 1em;}

@media (max-width: 1199px) {
  .items-table.zoom-2 tbody { grid-template-columns: repeat(auto-fit, minmax(90px, 12.5%)); } /* 80 to ~150 */
}

@media (max-width: 767px) {
  .items-table.zoom-2 tbody { grid-template-columns: repeat(auto-fit, minmax(72px, 16.6%)); letter-spacing: -0.05em; } /* 72 to 96px */

  .items-table.zoom-grid td:nth-child(1) {padding: 0 0.2rem; }
  .items-table.zoom-grid td:nth-child(2) {font-size: 0.7rem; }
  .items-table.zoom-grid .item-title div {font-size: 0.6rem; margin-top: 0;}

  .items-table.zoom-grid.zoom-2 td:nth-child(2) {height: 40px;}
  .items-table.zoom-grid.zoom-3 td:nth-child(2) {height: 40px;}
  .items-table.zoom-grid.zoom-4 td:nth-child(2) {height: 40px;}
}



/* 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 #ccc; border-radius: 4px; background: #fff; cursor: pointer; color: #666; }
.tiles-header .zoom-btn:hover { border-color: #999; color: #333; }

.tiles-wrap { position: relative; }
.tile { border: 1px solid #e8e8e8; 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; }
.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; }
.tile .img-tiny { image-rendering: pixelated; }
.tile.row-active { border-color: #4285f4; outline: 1px solid #4285f4; }


/* 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: 0; top: -0.25rem; z-index: 1; text-decoration: none; font-size: 1.6em; padding: 0.25em 0.5em 0.5em; color: #888; line-height: 1;}
.props-close-btn:hover {color: #333;}
.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 #ddd; padding-top: 0.85em;}

.item-props-panel .item-icon:has(.emoji-icon) { max-width: 160px; margin: 0 auto; }
.item-props-panel .item-icon:has(.audio-placeholder) { max-width: 360px; 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.75rem; margin-top: 0.25rem; letter-spacing: -0.03em;}
.item-props-panel dt {margin: 0; color: #999; font-weight: 400; min-width: 50px}
.item-props-panel dd {margin: 0; color: #444; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}


/* 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 #bbb; box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
    background: #fff;
  }
  .item-props-panel > * { width: 100% !important; }
  .item-props-panel .props-thumb { float: left; width: 100px; margin: 0 0.75rem 0.25rem 0 !important; }

  .item-props-panel .item-icon:has(.emoji-icon), .item-props-panel .item-icon:has(.audio-placeholder) { width: 80px; 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 dd:hover a.prop-edit-icon,
.item-props-panel .btn-link:hover,
.item-props-panel a:hover {opacity: 1;}
.item-props-panel .prop-members a {}
.item-props-panel .prop-edit-icon { font-size: 1em; flex-shrink: 0; opacity: 0.4; }


.member-item.user-self a {font-weight: 600; opacity: 1;}
.member-item.user-self .member-owner a {color: black; 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}

.member-editor {}
.member-uploader {}


/* Inline Edit Status */
.inline-edit-status {
  position: absolute;
  top: 0.5em;
  right: 0.5em;
  font-size: 0.75rem;
  color: #666;
  background: rgba(255, 255, 255, 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: #dc3545; }

@keyframes fade-to-gray {
  0% { color: #198754; }
  100% { color: #999; }
}

/* Star toggle (header) */
.star-toggle {
  display: inline-flex; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; color: #bbb; 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 { color: #f0ad4e; }
.star-toggle.active .star-icon { color: #f0ad4e; }
.star-count { font-size: 0.75rem; color: #888; }

/* Heart toggle (table column) */
.heart-toggle {
  display: inline-flex; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer;
  font-size: 0.9rem; 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: #ccc; }
.heart-toggle:hover .heart-icon { color: #e25555; }
.heart-toggle.active .heart-icon { color: #e25555; }
.heart-count { font-size: 0.75rem; color: #888; }

/* 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: #888; }

/* Global Audio Player */
.global-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: #222;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  z-index: 1050;
}
.global-player.hidden { display: none; }
.global-player audio { display: none; }
body.has-global-player { padding-bottom: 48px; }

.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; }

@media (max-width: 576px) {
  .global-player { 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; }
}

/* 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: #f5f5f5; border: 2px solid transparent;
  font-size: 1.1rem; font-weight: 600; color: #555;
  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: #ccc; }
.rating-btn.active { border-color: var(--accent); background: #dbeafe; color: var(--accent); }
.rating-label { font-size: 0.85rem; color: #888; margin-right: 0.15rem; }
.rating-avg { font-size: 0.85rem; color: #888; margin-left: 0.25rem; }

/* Rating score (table cell) */
.rating-score {
  display: inline-block; font-size: 0.8rem; font-weight: 600;
  color: #888; 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%, white);
  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 #999; color: #999; }
.access-badge.public  { border: 1px solid #5b9bd5; color: #5b9bd5; }
.access-badge.members { border: 1px solid #BBB; color: #777; }
.access-badge.shared  {
  border: 1px solid color-mix(in srgb, #e25555 50%, white);
  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: #f8f9fa; border: 1px solid #dee2e6; color: #6c757d; font-weight: normal; }

/* Tag pills */
.tag-pill { display: inline-flex; align-items: center; gap: 2px; background: #e9ecef; color: #555; border-radius: 3px; padding: 0 6px; font-size: 0.75rem; line-height: 1.6; white-space: nowrap; }
.tag-pill a { color: #555; }
.tag-pill-sm { font-size: 0.7rem; padding: 0 4px; }
.tag-remove { all: unset; cursor: pointer; color: #999; font-size: 0.85rem; line-height: 1; }
.tag-remove:hover { color: #c00; }
.tag-input { border: none; background: #fff; border-radius: 3px; padding: 1px 6px; font-size: 0.75rem; 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; }

/* 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: #aaa; 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: #888; font-size: 0.8rem; pointer-events: none; }
.lightbox-nav       { position: absolute; top: 50%; transform: translateY(-50%); background: none;
                      border: none; color: #aaa; 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; }
}

