/* --blue, --blue-2, --orange, --ink, --muted, --line and --bg all come from
   site.css now and follow the theme; redeclaring them here is what kept this
   page light. Only --surface has no direct equivalent. */
:root {
  --surface: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg); font-family: "Poppins", sans-serif; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.collections-topbar {
  height: 84px; display: flex; align-items: center; background: var(--topbar-bg);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px);
}
.collections-topbar-inner { width: min(1180px, 90%); margin: 0 auto; display: flex; align-items: center; gap: 26px; }
.collections-brand img { height: 64px; width: auto; display: block; }
.collections-nav { margin-left: auto; display: flex; gap: 22px; color: var(--nav-ink); font-size: 14px; font-weight: 600; }
.collections-nav a:hover, .collections-nav a.active { color: var(--blue); }
.collections-shell { width: min(1180px, 90%); margin: 0 auto; padding: 45px 0 76px; }
.collections-loading { min-height: 420px; display: grid; place-items: center; color: var(--muted); }
.collections-loading i { margin-right: 8px; color: var(--blue); }
.collections-guest { max-width: 580px; margin: 55px auto; padding: 54px 38px; text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 18px 45px rgba(5,74,145,.07); }
.guest-icon { width: 68px; height: 68px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 20px; color: var(--blue); background: var(--sky); font-size: 25px; }
.collections-guest h1 { margin: 0 0 10px; color: var(--blue); font-size: 31px; }
.collections-guest p { margin: 0 auto 24px; max-width: 440px; color: var(--muted); line-height: 1.65; }
.button { min-height: 43px; border-radius: 999px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; font-weight: 700; cursor: pointer; }
.button-primary { color: var(--bg); background: var(--blue); }
.button-secondary { color: var(--blue); background: var(--sky); border: 1px solid var(--border-strong); }
.button-ghost { color: var(--nav-ink); background: var(--paper); border: 1px solid var(--line); }
.collections-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 7px; color: var(--orange); font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.collections-heading h1 { margin: 0 0 8px; color: var(--blue); font-size: clamp(32px, 5vw, 47px); letter-spacing: -.035em; }
.collections-heading p:last-child { margin: 0; color: var(--muted); }
.collections-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 30px; align-items: start; }
.collections-sidebar { position: sticky; top: 108px; background: var(--paper); border: 1px solid var(--line); border-radius: 19px; padding: 17px; box-shadow: 0 12px 32px rgba(15,23,42,.035); }
.folder-list { display: grid; gap: 5px; }
.folder-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; border-radius: 11px; }
.folder-row.active { background: var(--sky); }
.folder-button {
  min-width: 0; width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: transparent;
  color: var(--nav-ink); padding: 11px; text-align: left; cursor: pointer; border-radius: 11px; font-size: 13px; font-weight: 600;
}
.folder-row.active .folder-button { color: var(--blue); }
.folder-button span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-count { margin-left: auto; min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; color: var(--muted); background: var(--surface-2); font-size: 10px; }
.folder-menu { position: relative; }
.folder-menu > summary { list-style: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); cursor: pointer; }
.folder-menu > summary::-webkit-details-marker { display: none; }
.folder-menu-panel { position: absolute; right: 0; top: 33px; z-index: 5; width: 125px; padding: 5px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 28px rgba(15,23,42,.14); }
.folder-menu-panel button { width: 100%; border: 0; background: transparent; padding: 8px; text-align: left; border-radius: 7px; color: var(--nav-ink); cursor: pointer; font-size: 12px; }
.folder-menu-panel button:hover { background: var(--surface-2); }
.folder-menu-panel .delete-folder { color: var(--red); }
.sidebar-create { width: 100%; margin-top: 13px; }
.collections-content { min-width: 0; }
.content-toolbar { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.content-toolbar h2 { margin: 0; color: var(--blue); font-size: 22px; }
.content-toolbar p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.favorites-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.favorite-card { min-height: 230px; padding: 20px; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: 17px; transition: .2s ease; }
.favorite-card:hover { transform: translateY(-2px); border-color: var(--border-hover); box-shadow: 0 14px 32px rgba(5,74,145,.08); }
.favorite-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.favorite-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--blue); background: var(--sky); }
.favorite-actions { display: flex; gap: 7px; }
.favorite-actions button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--paper); cursor: pointer; }
.favorite-actions button:hover { color: var(--orange); border-color: var(--orange); }
.favorite-card h3 { margin: 0 0 8px; color: var(--blue); font-size: 17px; line-height: 1.35; }
.favorite-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.favorite-meta span { padding: 4px 7px; border-radius: 7px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); font-size: 10px; font-weight: 600; }
.favorite-folder-names { margin: auto 0 14px; color: var(--muted); font-size: 11px; }
.favorite-open { color: var(--blue); font-size: 13px; font-weight: 700; }
.favorite-open i { margin-left: 6px; }
.collections-empty, .collections-error { padding: 58px 25px; text-align: center; color: var(--muted); background: var(--paper); border: 1px dashed var(--border-strong); border-radius: 18px; }
.collections-empty i, .collections-error i { margin-bottom: 13px; color: var(--blue-2); font-size: 28px; }
.collections-empty h3, .collections-error h3 { margin: 0 0 7px; color: var(--blue); }
.collections-empty p, .collections-error p { margin: 0 0 18px; }
.folder-dialog { width: min(440px, calc(100% - 28px)); color: var(--ink); background: var(--paper); border: 0; border-radius: 20px; padding: 0; box-shadow: 0 28px 80px rgba(5,40,75,.25); }
.folder-dialog::backdrop { background: rgba(5,25,47,.55); backdrop-filter: blur(3px); }
.folder-dialog form { padding: 25px; }
.folder-dialog h2 { margin: 0 0 7px; color: var(--blue); }
.folder-dialog p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.folder-dialog label { display: block; color: var(--ink); font-size: 12px; font-weight: 700; }
.folder-dialog input { width: 100%; height: 46px; margin-top: 7px; padding: 0 12px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; outline: none; }
.folder-dialog input:focus { border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(62,124,177,.13); }
.folder-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.folder-notice { min-height: 18px; margin: 9px 0 0 !important; color: var(--red) !important; font-size: 11px !important; }
.organize-list { display: grid; gap: 8px; max-height: 250px; overflow: auto; margin: 15px 0 18px; }
.organize-option { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--nav-ink); font-size: 13px; cursor: pointer; }
.organize-option:has(input:checked) { color: var(--blue); background: var(--sky); border-color: var(--border-strong); }
.organize-option input { accent-color: var(--blue); }
.organize-empty { padding: 14px; color: var(--muted); background: var(--surface-2); border-radius: 10px; font-size: 13px; }

@media (max-width: 860px) {
  .collections-layout { grid-template-columns: 1fr; }
  .collections-sidebar { position: static; }
  .folder-list { display: flex; overflow-x: auto; padding-bottom: 5px; }
  .folder-row { min-width: 170px; }
  .sidebar-create { width: auto; }
}
@media (max-width: 650px) {
  .collections-nav { display: none; }
  .collections-heading { display: block; }
  .collections-heading .button { margin-top: 18px; }
  .favorites-grid { grid-template-columns: 1fr; }
  .collections-shell { padding-top: 30px; }
}
