/* ReCollect Web App – home screen styles (matches recollect-web theme) */

/* Global reset for hidden elements */
[hidden] {
  display: none !important;
}
.app-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

/* Header: gradient, max ~2in (192px), modern */
.app-header {
  flex-shrink: 0;
  max-height: 192px; /* ~2in at 96dpi */
  min-height: 56px;
  padding: 0 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.app-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0.5rem 0;
}

@media (min-width: 768px) {
  .app-header-inner {
    min-height: 72px;
  }
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--white);
  text-decoration: none;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  padding-top: 8px;
}

.app-brand:hover {
  color: var(--white);
  opacity: 0.95;
}

.app-brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
}

.app-brand-text {
  font-weight: 400;
}

.app-brand-text strong {
  font-weight: 700;
}

.brand-now {
  font-weight: 300;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
/* Force order: Timeline | Bookmark | Extension | Menu */
#btnTimeline { order: 1; }
#btnBookmarks { order: 2; }
#btnExtension { order: 3; }
.app-header-menu-wrap { order: 4; }

.app-header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--white);
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  transition: background 0.2s ease;
}

.app-header-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.app-header-btn[hidden],
.app-header-actions .app-header-btn[hidden] {
  display: none !important;
}

.app-header-btn svg {
  flex-shrink: 0;
}

.app-header-btn-login {
  width: auto;
  min-width: 44px;
  padding: 0 14px;
  font-size: 0.95rem;
  font-weight: 600;
}

.app-header-login-text {
  white-space: nowrap;
}

.app-header-profile-avatar-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
}

.app-header-profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-header-profile-avatar-wrap .app-header-profile-icon-fallback {
  flex-shrink: 0;
  color: currentColor;
}

.app-header-profile-avatar-wrap .app-header-profile-icon-fallback[hidden],
.app-header-profile-avatar-wrap .app-header-profile-initial[hidden] {
  display: none !important;
}

.app-header-profile-initial {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text, #fff);
  background: rgba(255, 255, 255, 0.2);
}

.app-header-menu-wrap {
  position: relative;
}

.app-header-dropdown {
  position: absolute !important;
  right: 0;
  top: 100%;
  margin-top: 4px;
  z-index: 1001;
  min-width: 200px;
  padding: 6px 0;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.app-header-dropdown[hidden] {
  display: none !important;
}

.app-dropdown-user {
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  word-break: break-all;
}

.app-dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  font-size: 0.95rem;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}

.app-dropdown-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.app-header-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: #e53935;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-header-badge:empty,
.app-header-badge[aria-hidden="true"]:empty {
  display: none;
}

/* Login gate – only visible when not signed in; fully hidden after login */
.app-gate {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: linear-gradient(180deg, rgba(173, 43, 201, 0.06) 0%, var(--bg) 30%);
}

.app-gate[hidden] {
  display: none !important;
}

.app-gate-card {
  max-width: 400px;
  text-align: center;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
}

.app-gate-logo {
  margin-bottom: 1rem;
}

.app-gate-logo img {
  border-radius: 50%;
  border: 2px solid rgba(173, 43, 201, 0.3);
}

.app-gate-brand-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
}

.app-gate-logo {
  width: 72px;
  height: 72px;
  margin-bottom: 1rem;
}

.app-gate-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.app-gate-title {
  margin: 0;
    font-size: 1.85rem;
    font-weight: 400;
    letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 50%, var(--orange) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--purple);
}

.app-gate-title strong {
  font-weight: 700;
}

.app-gate-now {
  font-weight: 300;
}

/* Profile view – centered layout and containers */
#viewProfile .app-view-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem 2rem;
}

#viewProfile .app-view-header {
  width: 100%;
  max-width: 520px;
}

.app-profile-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.app-profile-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(173, 43, 201, 0.12);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.app-profile-avatar-large {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(173, 43, 201, 0.35) 0%, rgba(173, 43, 201, 0.25) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--purple);
}

.app-profile-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-profile-info {
  min-width: 0;
}

.app-profile-info h3 {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.app-profile-info p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.app-profile-section {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(173, 43, 201, 0.1);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

.app-profile-section-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.app-profile-plan-text {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.app-profile-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.app-profile-hint a {
  color: inherit;
  font-weight: bold;
}

.app-profile-subscription-history {
  margin-top: 1rem;
  border-top: 1px solid rgba(173, 43, 201, 0.15);
  padding-top: 1rem;
}

.app-profile-subscription-history-summary {
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--purple);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.app-profile-subscription-history-summary::-webkit-details-marker {
  display: none;
}

.app-profile-subscription-history-summary::before {
  content: '▶';
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.app-profile-subscription-history[open] .app-profile-subscription-history-summary::before {
  transform: rotate(90deg);
}

.app-profile-subscription-history-count {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.app-profile-subscription-history-list {
  margin-top: 0.75rem;
  padding-left: 1.25rem;
}

.app-profile-subscription-history-item {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.app-profile-subscription-history-date {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.app-profile-usage-item {
  margin-top: 0.5rem;
}

.app-profile-usage-header {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--text);
}

.app-profile-progress-track {
  height: 8px;
  border-radius: 4px;
  background: rgba(173, 43, 201, 0.2);
  overflow: hidden;
}

.app-profile-progress-bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #AD2BC9 0%, var(--purple) 100%);
  transition: width 0.25s ease;
}

.app-gate-lead {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.app-gate-note {
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.app-gate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 280px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  background: var(--white);
  border: 1px solid #dadce0;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.app-gate-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.app-gate-btn-secondary {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.app-gate-btn-secondary:hover {
  background: #e2e8f0;
}

.app-gate-signup {
  margin-top: 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  text-align: center;
}

.app-link-btn {
  border: none;
  background: none;
  color: #0f172a;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.app-link-btn:hover {
  color: #1e293b;
}

.app-link-accent {
  color: var(--purple);
  font-weight: 600;
  text-decoration: none;
}

.app-link-accent:hover {
  color: #9a26b5;
  text-decoration: underline;
}

/* Modal */
.app-modal[hidden] {
  display: none;
}

.app-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.app-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.app-gate-card--modal {
  position: relative;
  z-index: 1;
  width: min(420px, 92vw);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
}

.app-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
}

.app-modal-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #0f172a;
  margin-bottom: 1rem;
}

.app-modal-checkbox input {
  width: 16px;
  height: 16px;
}


/* Apple Sign In – black button per Apple HIG */
.app-gate-btn-apple {
  margin-top: 1.25rem;
  color: #fff;
  background: #000;
  border-color: #000;
}

.app-gate-btn-apple:hover {
  background: #1a1a1a;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.app-gate-footer {
  margin: 1.5rem 0 0;
  font-size: 0.9rem;
}

.app-gate-footer a {
  color: var(--purple);
  font-weight: 500;
  text-decoration: none;
}

.app-gate-footer a:hover {
  text-decoration: underline;
}

/* Main content */
.app-main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 1rem 1.5rem 2rem;
}

@media (max-width: 600px) {

  .app-main,
  .app-header {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
/* Detail view: hide search bar and Add button */
.app-main.app-main--detail-view #appSearchWrap,
.app-main.app-main--detail-view #searchResults,
.app-main.app-main--detail-view #appHome {
  display: none !important;
}

/* Search bar + Add button */
.app-search-wrap {
  padding: 1rem 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Home page only: extra margin around search bar (Google-like) */
.app-main:not(.app-main--detail-view):not(:has(#searchResults[data-visible="true"])) .app-search-wrap {
  margin-top: 0.2in;
  margin-bottom: 0.2in;
}

.app-search-wrap .app-search-bar {
  flex: 1;
  min-width: 0;
  max-width: 640px;
}

/* Home Add button: white with gradient text/icon (testing) */
.app-add-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  min-width: 56px;
  padding: 0 20px;
  border: 1px solid rgba(173, 43, 201, 0.35);
  border-radius: 26px;
  background: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.app-add-link-btn:hover {
  transform: translateY(-1px);
  background: rgba(243, 229, 245, 0.6);
  box-shadow: 0 4px 12px rgba(173, 43, 201, 0.1);
  border-color: rgba(173, 43, 201, 0.4);
}

.app-add-link-btn:active {
  transform: translateY(0);
}

.app-add-link-btn-icon,
.app-add-link-btn-text {
  background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 50%, var(--orange) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.app-add-link-btn-icon {
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 300;
}

.app-add-status {
  display: flex;
  align-items: center;
  gap: 12px;
    padding: 0 18px;
    height: 46px;
    background: white;
    border: 1px solid rgba(173, 43, 201, 0.15);
    border-radius: 23px;
    box-shadow: 0 3px 10px rgba(173, 43, 201, 0.08);
    animation: app-fade-in 0.2s ease;
  white-space: nowrap;
}

.app-layout-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border-radius: 8px;
  padding: 2px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  margin-right: 8px;
  /* space before refresh btn */
}

/* Update app-layout-toggle to be more generic if needed, 
   currently likely scoped to section controls. Let's make sure it works globally. */
.app-layout-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}

.app-layout-toggle:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
}

.app-layout-toggle.active {
  background: var(--white);
  color: var(--purple);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
#appAddStatusText {
  font-size: 0.95rem;
  font-weight: 500;
    color: var(--purple);
}
.app-add-status-dots {
  display: flex;
  gap: 5px;
    animation: app-add-status-wavy 1.5s ease-in-out infinite;
    animation-delay: 0.2s;
}

.app-add-status-dot {
  width: 6px;
  height: 6px;
  background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
  border-radius: 50%;
  animation: app-add-status-bounce 0.8s infinite alternate;
}

.app-add-status-dot:nth-child(2) {
  animation-delay: 0.2s;
  background: linear-gradient(135deg, var(--pink) 0%, var(--orange) 100%);
}

.app-add-status-dot:nth-child(3) {
  animation-delay: 0.4s;
  background: linear-gradient(135deg, var(--orange) 0%, #FFD54F 100%);
}

@keyframes app-add-status-wavy {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}
@keyframes app-add-status-bounce {
  from {
    transform: translateY(2px);
  }

  to {
    transform: translateY(-4px);
  }
}

@keyframes app-fade-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}
.app-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 16px 0 18px;
  background: var(--card-bg);
  border: 1px solid #e0e0e0;
  border-radius: 26px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.app-search-bar:focus-within {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  border-color: rgba(173, 43, 201, 0.35);
}

.app-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.app-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: var(--text);
  outline: none;
}

.app-search-input::placeholder {
  color: var(--text-muted);
}

.app-search-clear {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-search-clear:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.app-search-clear::after {
  content: "×";
  font-size: 20px;
  line-height: 1;
}

.app-search-mic {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-search-mic:hover {
  background: rgba(173, 43, 201, 0.1);
  color: var(--purple);
}

.app-search-mic.listening {
  color: var(--purple);
  background: rgba(173, 43, 201, 0.15);
  animation: app-mic-pulse 1.2s ease-in-out infinite;
}

@keyframes app-mic-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes app-add-link-spin {
  to { transform: rotate(360deg); }
}

/* Sections */
.app-section {
  margin-bottom: 2rem;
}

.app-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding: 0 2px;
}

.app-search-results .app-section-head {
  margin-bottom: 2rem;
}
.app-section-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.app-section-title--videos { color: #7B1FA2; }
.app-section-title--social { color: #1565C0; }
.app-section-title--web   { color: #2E7D32; }
.app-section-title--notes { color: #E65100; }
.app-section-title--bookmarks { color: var(--purple-dark); }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                /* Layout toggle controls */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                /* Category Header & Controls */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                .app-category-header {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  display: flex;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  align-items: center;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  justify-content: space-between;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  gap: 1rem;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  padding: 0.5rem 0 0.75rem;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  margin-bottom: 0.5rem;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  flex-wrap: wrap;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                @media (max-width: 600px) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  .app-category-header {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    flex-direction: column;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    align-items: flex-start;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    gap: 0.75rem;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  .app-category-controls {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    width: 100%;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    justify-content: flex-start;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    flex-wrap: wrap;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    gap: 0.75rem;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                .app-category-header[hidden] {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  display: none !important;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                .app-category-title {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  margin: 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  font-size: 1.15rem;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  font-weight: 700;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  letter-spacing: -0.02em;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  color: #555;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                .app-category-controls {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  display: flex;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  align-items: center;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  gap: 1rem;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                .app-control-group {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  display: flex;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  align-items: center;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  gap: 0.5rem;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                .app-control-label {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  font-size: 0.85rem;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  font-weight: 600;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  color: var(--text-muted);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  letter-spacing: 0.03em;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                .app-control-select-wrap {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  position: relative;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                .app-category-header .app-control-select {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  padding: 6px 32px 6px 12px;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  font-size: 0.9rem;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  font-weight: 500;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  color: var(--text);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  background: var(--white);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  border: 1px solid #e0e0e0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  border-radius: 8px;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  cursor: pointer;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  appearance: none;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  -webkit-appearance: none;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  min-width: 120px;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  transition: border-color 0.2s, box-shadow 0.2s;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                .app-category-header .app-control-select:hover {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  border-color: #bdbdbd;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                .app-category-header .app-control-select:focus {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  outline: none;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  border-color: var(--purple);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  box-shadow: 0 0 0 3px rgba(173, 43, 201, 0.15);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                .app-control-select-icon {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  position: absolute;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  right: 10px;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  top: 50%;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  transform: translateY(-50%);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  color: var(--text-muted);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  pointer-events: none;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  display: flex;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  align-items: center;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                /* Group sections */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                .app-group-section {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  margin-bottom: 2.5rem;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                .app-group-title {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  font-size: 1rem;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  font-weight: 600;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  color: var(--text-muted);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  margin-bottom: 1rem;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  padding-bottom: 0.5rem;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  display: flex;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  align-items: center;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  gap: 0.5rem;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                .app-group-title::before {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  content: "";
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  display: block;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  width: 4px;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  height: 16px;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  background: var(--purple);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  border-radius: 2px;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }
.app-section-layout-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.04);
  padding: 3px;
  border-radius: 8px;
  margin-left: auto;
  margin-right: 0.5rem;
}

.app-layout-toggle {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
}

.app-layout-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.app-layout-toggle.active {
  background: var(--white);
  color: var(--purple);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.app-layout-toggle svg {
  display: block;
}
.app-view-all {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--purple);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  flex-shrink: 0;
}

.app-view-all:hover {
  text-decoration: underline;
}

.app-view-all:focus {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}


/* Home "All" view: sections per category */
.app-home-sections {
  display: block;
}

.app-home-sections .app-section:last-child {
  margin-bottom: 0;
}



/* Bulk Controls & Pagination */
.app-bulk-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--white);
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.app-bulk-controls[hidden] {
  display: none !important;
}

.app-bulk-controls-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.app-bulk-sep {
  width: 1px;
  align-self: stretch;
  min-height: 20px;
  background: #e0e0e0;
  flex-shrink: 0;
}

.app-bulk-controls-center {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  margin: 0 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.app-bulk-controls-center::-webkit-scrollbar {
  height: 4px;
}

.app-bulk-controls-center::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
}

.app-bulk-tag-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #e0e0e0;
  background: #f5f5f5;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.app-bulk-tag-chip:hover {
  border-color: var(--purple);
  background: rgba(173, 43, 201, 0.08);
  color: var(--purple);
}

.app-bulk-tag-chip.selected {
  border-color: var(--purple);
  background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
  color: white;
}

.app-bulk-controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.app-bulk-controls-right .app-control-group--bulk {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-bulk-controls-right .app-control-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.app-bulk-controls-right .app-control-select {
  padding: 6px 32px 6px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: var(--white);
  appearance: none;
  -webkit-appearance: none;
  min-width: 100px;
  cursor: pointer;
}

.app-bulk-controls-right .app-control-select-wrap {
  position: relative;
}

.app-bulk-controls-right .app-control-select-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.app-control-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  user-select: none;
}

.app-control-divider {
  color: #ddd;
  font-size: 1.2rem;
  font-weight: 300;
}

.app-control-btn {
  padding: 6px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.app-control-btn:hover:not(:disabled) {
  background: #eee;
  border-color: #bdbdbd;
}

.app-control-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.app-control-btn--danger {
  color: #fff;
  background: #e53935;
  border-color: #d32f2f;
}

.app-control-btn--danger:hover:not(:disabled) {
  background: #d32f2f;
  border-color: #c62828;
}

.app-control-select {
  padding: 6px 12px;
  font-size: 0.9rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.app-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .app-bulk-controls {
    padding: 0.4rem 0.5rem;
    gap: 0.5rem;
  }
  .app-bulk-controls-left {
    gap: 6px;
  }
  .app-control-checkbox-label {
    gap: 6px;
    font-size: 0.9rem;
  }
  .app-bulk-controls-center {
    padding: 0 8px;
    margin: 0 4px;
  }
  .app-bulk-sep {
    margin: 0 2px;
  }
  .app-pagination {
    padding: 0.35rem 0.5rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    gap: 0.5rem;
  }
  .app-pagination-btn {
    padding: 6px 10px;
    font-size: 0.875rem;
    min-width: 70px;
  }
  .app-pagination-info {
    font-size: 0.85rem;
  }
  .app-pagination-show {
    margin-left: 0.5rem;
  }
  .app-pagination-show label {
    display: none;
  }
}

.app-pagination[hidden] {
  display: none !important;
}

.app-pagination-btn {
  padding: 8px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--purple);
  background: var(--white);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  min-width: 100px;
}

.app-pagination-btn:hover:not(:disabled) {
  background: #f8f9fa;
  border-color: var(--purple);
}

.app-pagination-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: #e0e0e0;
  color: var(--text-muted);
}

.app-pagination-info {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.app-pagination-show {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1rem;
}

.app-pagination-show label {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

.app-card-select-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 20;
  width: 24px;
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

/* Show checkbox on hover or when in selection mode */
.app-card:hover .app-card-select-overlay,
.app-selection-mode .app-card-select-overlay {
  display: flex !important;
}
.app-card-check {
  width: 20px;
    height: 20px;
  cursor: pointer;
  accent-color: var(--purple);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Removed card outline on selection */
/* View panels (Bookmarks, Timeline, Detail) – same content width as app header */
.app-view {
  padding: 0 0 2rem;
}

.app-view-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 0;
}

.app-view-header {
  display: flex;
  flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0 2px;
}

.app-view-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.app-view-back {
  padding: 8px 12px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--purple);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-left: -12px;
    align-self: flex-start;
}

.app-view-back:hover {
  background: rgba(173, 43, 201, 0.1);
}

.app-view-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  width: 100%;
}

.app-view-action {
  padding: 8px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  background: var(--white);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.app-view-action:hover {
  background: #f5f5f5;
  border-color: #bdbdbd;
  color: var(--text);
}

/* Timeline date strip with back/forward */
.app-timeline-date-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
}

.app-timeline-date-nav-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 56px;
  padding: 0;
  border: 1px solid #e0e0e0;
  background: var(--card-bg);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  border-radius: 10px;
}

.app-timeline-date-nav-btn:first-child {
  border-radius: 10px 6px 6px 10px;
}

.app-timeline-date-nav-btn:last-child {
  border-radius: 6px 10px 10px 6px;
}

.app-timeline-date-nav-btn:hover:not(:disabled) {
  background: rgba(173, 43, 201, 0.08);
  border-color: rgba(173, 43, 201, 0.4);
  color: var(--purple);
}

.app-timeline-date-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.app-timeline-date-strip-wrap {
  flex: 1;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  padding: 0 4px;
}

.app-timeline-date-strip {
  display: flex;
  gap: 8px;
  padding: 12px 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}

.app-timeline-date-chip {
  flex: 0 0 auto;
  width: 56px;
  padding: 10px 0;
  text-align: center;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  background: var(--card-bg);
  cursor: pointer;
  scroll-snap-align: start;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.app-timeline-date-chip:hover {
  border-color: rgba(173, 43, 201, 0.4);
  background: rgba(173, 43, 201, 0.06);
}

.app-timeline-date-chip.selected {
  background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 50%, var(--orange) 100%);
  border-color: transparent;
  color: var(--white);
}

.app-timeline-date-chip .day-name {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  opacity: 0.9;
}

.app-timeline-date-chip .day-num {
  display: block;
  font-size: 18px;
  font-weight: 700;
  margin-top: 4px;
}

.app-timeline-date-picker {
  position: absolute;
  top: 100%;
    right: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    border: none;
    padding: 0;
    margin: 0;
    visibility: visible;
}

.app-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.app-timeline-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.app-timeline-item:last-child {
  border-bottom: none;
}

.app-timeline-time {
  flex: 0 0 56px;
  text-align: right;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.app-timeline-time-ampm {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

.app-timeline-card-wrap {
  flex: 1;
  min-width: 0;
}

/* Timeline: rectangular card – preview left, details right */
.app-timeline-card-wrap .app-card {
  flex-direction: row;
  align-items: stretch;
  min-height: 104px;
  padding: 0;
}

.app-timeline-card-wrap .app-card:hover {
  transform: none;
}

.app-timeline-card-wrap .app-card-link {
  flex: 1;
  flex-direction: row;
  min-width: 0;
}

.app-timeline-card-wrap .app-card-thumb,
.app-timeline-card-wrap .app-card-thumb-placeholder {
  width: 120px;
  min-width: 120px;
  height: 104px;
  flex-shrink: 0;
  object-fit: contain;
  object-position: center;
  border-bottom: none;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.app-timeline-card-wrap .app-card-thumb-placeholder {
  font-size: 0.85rem;
  font-weight: 400;
}

.app-timeline-card-wrap .app-card-thumb-placeholder-note .app-card-note-graphic {
  width: 48px;
  height: 48px;
}

.app-timeline-card-wrap .app-card-thumb-placeholder-note .app-card-note-has-images {
  font-size: 0.7rem;
}

.app-timeline-card-wrap .app-card-thumb-placeholder-note .app-card-thumb-placeholder-text {
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: 0.7rem;
}

.app-timeline-card-wrap .app-card-body {
  flex: 1;
  min-width: 0;
  padding: 10px 12px 0;
  justify-content: center;
}

.app-timeline-card-wrap .app-card-title {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.app-timeline-card-wrap .app-card-sub {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.app-timeline-card-wrap .app-card-actions {
  flex-shrink: 0;
  align-self: center;
  padding: 8px 12px 0;
  border-left: 1px solid rgba(0, 0, 0, 0.06);
}

/* Filter bar */
.app-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0 1rem;
  margin-bottom: 0.5rem;
}

.app-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.app-filter-tags-sep {
  display: none !important; /* Removed left separator */
}

.app-filter-tags-wrap {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  background: #f5f5f5;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 4px 14px;
  margin: 0 0.5rem;
}

.app-filter-tags-wrap::-webkit-scrollbar {
  display: none;
}

.app-filter-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  padding: 2px 0;
  align-items: center;
}

.app-filter-tag-chip {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e0e0e0;
  background: #f5f5f5;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.app-filter-tag-chip:hover {
  border-color: var(--purple);
  background: rgba(173, 43, 201, 0.08);
  color: var(--purple);
}

.app-filter-tag-chip.active {
  border-color: var(--purple);
  background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
  color: white;
}

@media (max-width: 600px) {
  .app-filter-bar {
    flex-wrap: nowrap;
    overflow: hidden;
    gap: 0.25rem;
    /* Reduced from 0.5rem */
  }

  .app-filter-chips {
    flex: 1;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: -8px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    display: flex;
    gap: 0.25rem;
    /* Reduced from 0.5rem */
  }

  .app-filter-chips::-webkit-scrollbar {
    display: none;
  }

  .app-filter-chip {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px 10px;
    /* Reduced from 14px */
    font-size: 0.85rem;
    /* Slightly smaller font to fit more */
  }

  .app-layout-controls {
    margin-left: 0.15rem;
    flex-shrink: 0;
    gap: 2px;
    /* Tighten internal gap */
    padding: 2px;
  }

  .app-layout-toggle {
    width: 28px;
    height: 28px;
  }

  .app-filter-refresh-btn {
    flex-shrink: 0;
    width: 32px;
    /* Even smaller to prioritize chips */
    height: 32px;
  }

  .app-filter-tags-sep {
    height: 20px;
  }

  .app-filter-tags-wrap {
    flex: 1;
    min-width: 60px;
  }

  .app-filter-tag-chip {
    padding: 5px 8px;
    font-size: 0.75rem;
  }
}
.app-filter-layout-controls {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 1rem;
  margin-right: 0.25rem;
  background: transparent;
  border: none;
  padding: 0;
}

.app-filter-layout-controls .app-section-layout-controls {
  margin-left: 0;
}

.app-filter-layout-controls[hidden] {
  display: none !important;
}

.app-filter-refresh-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.app-filter-refresh-btn:hover {
  background: #f0f0f0;
  border-color: rgba(0, 0, 0, 0.14);
}

.app-filter-refresh-btn:active {
  transform: scale(0.96);
}

.app-filter-refresh-icon {
  display: block;
}

.app-filter-chip {
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--card-bg);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.app-filter-chip:hover {
  color: var(--text);
  background: #f5f5f5;
  border-color: rgba(0, 0, 0, 0.12);
}

.app-filter-chip.active {
  color: var(--white);
  background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 50%, var(--orange) 100%);
  border-color: transparent;
}

/* Main content grid – responsive card grid */
.app-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.app-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.9rem;
  align-items: start;
}

/* Grid card: square image on top, details below */
.app-cards-grid:not(.app-cards-grid--list) .app-card-link {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
}

.app-cards-grid:not(.app-cards-grid--list) .app-card-thumb,
.app-cards-grid:not(.app-cards-grid--list) .app-card-thumb-placeholder {
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  width: 100%;
  height: auto !important;
  min-height: unset !important;
  max-height: 165px;
  object-fit: contain;
  object-position: center;
  overflow: hidden;
  margin: 0 auto !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  background: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: block;
}

.app-cards-grid:not(.app-cards-grid--list) .app-card-thumb-placeholder {
  background: #fff;
}

.app-cards-grid:not(.app-cards-grid--list) .app-card-thumb-placeholder-note {
  padding: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  background: #fff;
}

/* Facebook video/reel embed in card when no thumbnail (same preview as details page) */
.app-card-thumb-placeholder--embed {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}
/* Fit full embed preview inside card (contain, not zoom/crop); 16:9 is typical for these embeds */
.app-card-thumb-embed {
  width: 100%;
  height: auto;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  pointer-events: none;
}
/* When card thumb is square, fit by height so full width of embed is visible */
.app-cards-grid:not(.app-cards-grid--list) .app-card-thumb-placeholder--embed .app-card-thumb-embed {
  width: auto;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
}
/* Facebook on card: fit by width to reduce zoom – full 16:9 visible, no crop */
.app-card-thumb-placeholder--embed-facebook .app-card-thumb-embed {
  width: 100%;
  height: auto;
  max-height: 100%;
  aspect-ratio: 16 / 9;
}
.app-cards-grid:not(.app-cards-grid--list) .app-card-thumb-placeholder--embed-facebook .app-card-thumb-embed {
  width: 100%;
  height: auto;
  max-height: 100%;
  aspect-ratio: 16 / 9;
}
/* Instagram: full preview contained and centered (same as details, no zoom/crop) */
.app-card-thumb-placeholder--embed-instagram .app-card-thumb-embed {
  width: auto;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 1 / 1;
}
.app-cards-grid:not(.app-cards-grid--list) .app-card-thumb-placeholder--embed-instagram .app-card-thumb-embed {
  width: auto;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 1 / 1;
}
/* TikTok: full vertical view contained and centered (no zoom/crop) */
.app-card-thumb-placeholder--embed-tiktok .app-card-thumb-embed {
  width: auto;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 9 / 16;
}
.app-cards-grid:not(.app-cards-grid--list) .app-card-thumb-placeholder--embed-tiktok .app-card-thumb-embed {
  width: auto;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 9 / 16;
}

.app-cards-grid:not(.app-cards-grid--list) .app-card-body {
  flex: 1 1 auto;
  min-height: calc(2.5em + 4px + 2.6em + 6px);
  padding: 4px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* Reserve 2 lines each for title and description – uniform card height */
.app-cards-grid:not(.app-cards-grid--list) .app-card-title {
  line-clamp: 2;
  -webkit-line-clamp: 2;
  min-height: 2.5em;
  line-height: 1.25;
  margin: 0;
}

.app-cards-grid:not(.app-cards-grid--list) .app-card-sub {
  line-clamp: 2;
  -webkit-line-clamp: 2;
  min-height: 2.6em;
  line-height: 1.3;
  margin: 0;
  margin-top: 4px;
}

.app-cards-grid:not(.app-cards-grid--list) .app-card-actions {
  margin-top: 2px;
  padding-top: 4px;
  flex-shrink: 0;
}

/* Tablet / iPad portrait: 4 columns */
@media (min-width: 768px) {
  .app-cards-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.9rem;
  }
}

/* Desktop: 5 columns */
@media (min-width: 1024px) {
  .app-cards-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  /* Compact card body for 5-column grid – 2 lines title, 2 lines description */
  .app-cards-grid:not(.app-cards-grid--list) .app-card-body {
    padding: 4px 8px 6px;
    min-height: calc(2.5em + 4px + 2.6em + 4px);
  }
  .app-cards-grid:not(.app-cards-grid--list) .app-card-title {
    font-size: 0.85rem;
    min-height: 2.5em;
    line-height: 1.25;
  }
  .app-cards-grid:not(.app-cards-grid--list) .app-card-sub {
    font-size: 0.72rem;
    min-height: 2.6em;
    line-height: 1.3;
  }
  .app-cards-grid:not(.app-cards-grid--list) .app-card-body-age {
    font-size: 0.6rem;
    min-height: 1.2em;
  }

  /* Fixed height for list cards on desktop - uniform spacing */
  .app-cards-grid--list .app-card {
    height: 108px;
    min-height: 108px;
  }
}

@media (max-width: 767px) {
  .app-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* Grouped by platform: fixed max card height, image constrained and cropped */
.app-grouped-grid .app-cards-grid--list .app-card {
  min-height: 100px;
  max-height: 120px;
}

.app-grouped-grid .app-cards-grid--list .app-card-link {
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
}

.app-grouped-grid .app-cards-grid--list .app-card-thumb,
.app-grouped-grid .app-cards-grid--list .app-card-thumb-placeholder {
  height: 100% !important;
  min-height: 100px;
  max-height: 120px !important;
  flex: 0 0 auto;
  align-self: stretch;
  display: block;
  object-fit: contain;
  object-position: center;
  overflow: hidden;
  border-bottom: none;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.app-grouped-grid .app-cards-grid--list .app-card-thumb-placeholder {
  display: flex;
}

/* Grid view when grouped: square thumb (inherits from base grid rule) */
.app-grouped-grid .app-cards-grid:not(.app-cards-grid--list) .app-card-thumb,
.app-grouped-grid .app-cards-grid:not(.app-cards-grid--list) .app-card-thumb-placeholder {
  margin: 0 !important;
  padding: 0 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  border-right: none;
}

.app-grouped-grid .app-cards-grid:not(.app-cards-grid--list) .app-card-thumb {
  display: block;
  object-fit: contain;
  object-position: center;
}

/* List view layout - compact horizontal cards */
.app-cards-grid--list {
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 0.6rem !important;
  align-items: start !important;
}

.app-cards-grid--list .app-card {
  flex-direction: row;
  align-items: stretch;
  min-height: 100px;
  max-height: 120px;
  padding: 0;
  overflow: hidden;
}

.app-cards-grid--list .app-card:hover {
  transform: none;
}

.app-cards-grid--list .app-card-link {
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.app-cards-grid--list .app-card-thumb,
.app-cards-grid--list .app-card-thumb-placeholder {
  width: 140px;
  min-width: 140px;
  height: 100%;
  min-height: 100px;
  max-height: 120px !important;
  flex-shrink: 0;
  align-self: stretch;
  object-fit: contain;
  object-position: center;
  border-bottom: none;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.app-cards-grid--list .app-card-thumb-placeholder {
  font-size: 0.85rem;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-cards-grid--list .app-card-thumb-placeholder-note .app-card-note-graphic {
  width: 48px;
  height: 48px;
}

.app-cards-grid--list .app-card-thumb-placeholder-note .app-card-note-has-images {
  font-size: 0.7rem;
}

.app-cards-grid--list .app-card-thumb-placeholder-note .app-card-thumb-placeholder-text {
  line-clamp: 2;
  -webkit-line-clamp: 2;
  font-size: 0.7rem;
}

.app-cards-grid--list .app-card-body {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 6px 10px 0;
  justify-content: flex-start;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.app-cards-grid--list .app-card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  overflow: hidden;
  height: 2.5em;
  min-height: 2.5em;
  flex-shrink: 0;
}

.app-cards-grid--list .app-card-sub {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  overflow: hidden;
  height: 2.6em;
  min-height: 2.6em;
  flex-shrink: 0;
}

.app-cards-grid--list .app-card-actions {
  flex: 0 0 90px;
  align-self: stretch;
  padding: 6px 6px 0;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  border-top: none;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  min-width: 90px;
  background: rgba(0, 0, 0, 0.01);
}

.app-cards-grid--list .app-card-actions-left {
  flex-direction: column;
  align-items: center;
  gap: 2px;
  order: 1;
}

.app-cards-grid--list .app-card-actions-btns {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  order: 0;
}

.app-cards-grid--list .app-card-actions-meta {
  margin-top: 2px;
}

@media (max-width: 600px) {
  .app-cards-grid--list .app-card-actions {
    flex: 0 0 72px;
    min-width: 72px;
    padding: 6px 4px 0;
    justify-items: center;
    align-items: center;
    gap: 2px;
  }
  
  .app-cards-grid--list .app-card-meta-inline {
    justify-self: center;
    align-self: center;
    align-items: center;
    gap: 2px;
  }
  
  .app-cards-grid--list .app-card-bookmark {
    justify-self: center;
  }
  
  .app-cards-grid--list .app-card-menu-btn {
    justify-self: center;
  }
  
  .app-cards-grid--list .app-card-chip {
    font-size: 0.65rem;
    padding: 2px 6px;
  }
  
  .app-cards-grid--list .app-card-date {
    font-size: 0.7rem;
  }
  
  .app-cards-grid--list .app-card-bookmark,
  .app-cards-grid--list .app-card-menu-btn {
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
  }
}

.app-cards-grid--list .app-card-meta-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

@media (max-width: 900px) {
  .app-cards-grid--list {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 600px) {

  .app-cards-grid--list .app-card-thumb,
  .app-cards-grid--list .app-card-thumb-placeholder {
    width: 100px;
    min-width: 100px;
  }
}
.app-cards--grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}


@media (max-width: 600px) {
  .app-cards--grid {
    grid-template-columns: 1fr;
  }
}

/* Single content card – info card style for grid */
.app-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.app-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

/* Placeholder card while adding a link – shows preview title/description when available */
.app-card-add-pending {
  pointer-events: none;
}
.app-card-add-pending:hover {
  transform: none;
  box-shadow: var(--shadow);
}
.app-card-add-pending-thumb {
  width: 100%;
  height: 200px;
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.app-card-add-pending-thumb-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(173, 43, 201, 0.25);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: app-add-link-spin 0.8s linear infinite;
}
.app-card-add-pending-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.app-card-add-pending-body {
  flex: 0 0 auto;
  min-width: 0;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.app-card-add-pending-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.app-card-add-pending-content .app-card-title,
.app-card-add-pending-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.app-card-add-pending-content .app-card-sub,
.app-card-add-pending-desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.app-card-add-pending-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.app-card-add-pending-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(173, 43, 201, 0.3);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: app-add-link-spin 0.7s linear infinite;
}
.app-card-add-pending-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.app-card-link {
  display: flex;
  flex-direction: column;
  padding: 0;
  text-decoration: none;
  color: inherit;
  flex: 1;
  min-width: 0;
}

.app-card-thumb {
  width: 100%;
  height: 200px;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.app-card-thumb-placeholder {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 400;
  flex-shrink: 0;
  background: #fff;
  text-align: center;
  padding: 0.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.app-card-thumb-placeholder--loading {
  background: #fff;
  color: var(--text-muted);
  text-shadow: none;
}
.app-card-thumb-placeholder--loading .app-card-add-pending-thumb-spinner {
  width: 32px;
  height: 32px;
}

.app-card-thumb-placeholder--note {
  background: #fff;
  color: var(--text-muted);
}

.app-card-thumb-placeholder-note {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.25rem;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.app-card-thumb-placeholder-note .app-card-note-graphic {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  color: rgba(0, 0, 0, 0.2);
}

.app-card-thumb-placeholder--note .app-card-note-graphic {
  color: rgba(140, 90, 60, 0.35);
}

.app-card-thumb-placeholder-note .app-card-note-has-images {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

.app-card-thumb-placeholder-note .app-card-thumb-placeholder-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  display: -webkit-box;
  line-clamp: 4;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.app-card-body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: calc(2.5em + 2.6em + 1.4em + 4px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px 0;
}

.app-card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
  flex-shrink: 0;
  min-height: 2.5em;
}

.app-card-title-link {
  color: inherit;
  text-decoration: none;
}

.app-card-title-link:hover {
  text-decoration: underline;
}

.app-card-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  flex-shrink: 0;
  min-height: 2.6em;
}

.app-card-body-age {
  font-size: 0.65rem;
  font-weight: normal;
  color: var(--text-muted);
  flex-shrink: 0;
  min-height: 1.4em;
  line-height: 1.4;
}

.app-card-body-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
  flex-shrink: 0;
}

.app-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  flex-wrap: wrap;
}

.app-card-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 6px 10px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  margin-top: auto;
}

.app-card-actions-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 0;
}

.app-card-actions-age {
  font-size: 0.65rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.app-card-actions-btns {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.app-card-actions-meta {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  flex-shrink: 0;
}

.app-card-meta-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.app-card-chip {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(173, 43, 201, 0.12);
  color: var(--purple-dark);
}

.app-card-chip.video { background: rgba(123, 31, 162, 0.12); color: #7B1FA2; }
.app-card-chip.social { background: rgba(21, 101, 192, 0.12); color: #1565C0; }
.app-card-chip.web   { background: rgba(46, 125, 50, 0.12);  color: #2E7D32; }
.app-card-chip.note  { background: rgba(230, 81, 0, 0.12);  color: #E65100; }

.app-card-date {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.app-card-note-images-badge {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 8px;
  border-radius: 10px;
}


.app-card-bookmark {
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
    /* Increased icon size */
    transition: all 0.2s;
}

.app-card-bookmark:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #f57c00;
  transform: scale(1.1);
}

.app-card-bookmark.is-bookmarked {
  color: #ffb74d;
}

.app-card-menu-btn {
  width: 40px;
    height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
    /* Increased icon size */
    transition: all 0.2s;
}

.app-card-menu-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

/* Dropdown menu */
.app-dropdown {
  position: fixed;
  z-index: 1000;
  min-width: 180px;
  padding: 6px 0;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.app-dropdown button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  font-size: 0.95rem;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.app-dropdown button:hover {
  background: rgba(0, 0, 0, 0.05);
}

.app-dropdown button[data-action="delete"] {
  color: #c62828;
}

/* View-all panels */
.app-view-all-panel {
  display: none;
  padding: 1rem 0 2rem;
}

.app-view-all-panel[data-visible="true"] {
  display: block;
}

.app-view-all-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.app-view-all-back {
  padding: 8px 12px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--purple);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.app-view-all-back:hover {
  background: rgba(173, 43, 201, 0.1);
}

/* Hide home when a view-all panel is visible */
.app-home[data-panel-open="true"] {
  display: none;
}

.app-search-results[data-visible="true"] ~ .app-home {
  display: none !important;
}

.app-search-results[data-visible="true"] {
  display: block;
}

/* AI Search Animation */
.app-ai-search-active .app-search-bar {
  border-color: var(--purple);
  box-shadow: 0 0 15px rgba(173, 43, 201, 0.4);
  animation: app-ai-glow 2s infinite alternate;
}

@keyframes app-ai-glow {
  0% {
    box-shadow: 0 0 5px rgba(173, 43, 201, 0.2);
  }

  100% {
    box-shadow: 0 0 20px rgba(173, 43, 201, 0.5);
  }
}

.app-ai-loader {
  display: flex;
  flex-direction: column;
  padding: 4rem 1.5rem;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  text-align: center;
}

.app-ai-loader-dots {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.app-ai-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  animation: app-ai-dot-wave 1.4s infinite ease-in-out;
}

.app-ai-dot:nth-child(1) {
  background: var(--purple);
  animation-delay: -0.32s;
}

.app-ai-dot:nth-child(2) {
  background: var(--pink);
  animation-delay: -0.16s;
}

.app-ai-dot:nth-child(3) {
  background: var(--orange);
}

@keyframes app-ai-dot-wave {

  0%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-12px);
  }
}

.app-ai-loader-text {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 50%, var(--orange) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  animation: app-ai-text-pulse 2s infinite ease-in-out;
}

.app-ai-loader-subtext {
  font-size: 0.9rem;
  font-weight: 400;
  -webkit-text-fill-color: var(--text-muted);
  color: var(--text-muted);
  opacity: 0.8;
}

@keyframes app-ai-text-pulse {

  0%,
  100% {
    opacity: 0.8;
    transform: scale(0.98);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}
/* Empty / loading */
.app-empty,
.app-loading {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.app-empty-state {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-muted);
}

.app-empty-state p {
  margin: 0;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* Detail modal – landscape style */
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.app-modal[hidden] {
  display: none;
}

.app-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.app-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.app-modal-dialog--detail {
  max-width: 960px;
}

.app-modal-dialog--add-link {
  max-width: 480px;
  margin: 1rem;
  border-radius: 16px;
  overflow: hidden;
}

.app-add-link-header {
  position: relative;
  padding: 1.25rem 3rem 1rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.app-add-link-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.app-add-link-form {
  padding: 1.25rem;
  overflow-y: auto;
  max-height: calc(90vh - 120px);
}

.app-add-link-field {
  margin-bottom: 1rem;
}

.app-add-link-field label,
.app-add-link-field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.app-add-link-category-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-add-link-category-btn {
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  background: var(--white);
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.app-add-link-category-btn:hover {
  background: #f5f5f5;
  border-color: #bdbdbd;
}

.app-add-link-category-btn.selected {
  background: #f5f5f5;
  border-color: #9e9e9e;
  color: var(--text);
  font-weight: 600;
}

.app-add-link-field input,
.app-add-link-field select,
.app-add-link-field textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
}

.app-add-link-field input:focus,
.app-add-link-field select:focus,
.app-add-link-field textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 2px rgba(173, 43, 201, 0.2);
}

.app-add-link-field textarea {
  resize: vertical;
  min-height: 60px;
}

.app-add-link-notes-tags-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.app-add-link-notes-tags-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.app-add-link-notes-tags-chips::-webkit-scrollbar {
  height: 6px;
}

.app-add-link-notes-tags-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  background: #fafafa;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.app-add-link-notes-tags-chip:hover {
  border-color: var(--purple);
  background: rgba(173, 43, 201, 0.08);
  color: var(--purple);
}

.app-add-link-notes-tags-chip.selected {
  border-color: var(--purple);
  background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
  color: white;
}

.app-add-link-notes-tags-add {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
  border: 1px dashed #bdbdbd;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.app-add-link-notes-tags-add:hover {
  border-color: var(--purple);
  color: var(--purple);
  background: rgba(173, 43, 201, 0.08);
}

.app-add-link-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.app-add-link-cancel {
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
}

.app-add-link-cancel:hover {
  background: #f5f5f5;
  color: var(--text);
}

.app-add-link-save {
  padding: 10px 28px;
  min-width: 100px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 50%, var(--orange) 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.app-add-link-save:hover {
  opacity: 0.95;
}

.app-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 420px;
  max-height: 90vh;
  gap: 1.5rem;
}

.app-detail-layout--page {
  max-height: none;
  min-height: 480px;
}

.app-detail-layout--note .app-detail-preview {
  display: none;
}

.app-detail-layout--note {
  grid-template-columns: 1fr;
}

.app-detail-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  max-width: 38rem;
}

.app-detail-title-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: none;
  color: rgba(140, 90, 60, 0.5);
}

.app-detail-title-icon:not(:empty) {
  display: block;
}

.app-detail-title-icon svg {
  width: 100%;
  height: 100%;
}

.app-detail-details-box {
  margin: 0;
}

.app-detail-details-box--note {
  padding: 1rem 1.25rem;
  background: #f8f6f3;
  border-radius: 12px;
  border: 1px solid #e8e4df;
  margin: 0.5rem 0;
  max-width: 38rem;
  min-height: calc(10 * 1.6em);
}

.app-detail-details-box--note .app-detail-desc {
  margin: 0 0 0.5rem;
  line-height: 1.6;
}

.app-detail-details-box--note .app-detail-notes {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e8e4df;
}

.app-detail-details-box--note .app-detail-notes-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.app-detail-edit-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 1.35rem;
  font-weight: 700;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
}

.app-detail-edit-input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 2px rgba(173, 43, 201, 0.2);
}

.app-detail-edit-textarea {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  line-height: 1.5;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  resize: vertical;
  min-height: 120px;
}

.app-detail-edit-textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 2px rgba(173, 43, 201, 0.2);
}

.app-detail-edit-char-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.app-detail-edit-char-count.limit-reached {
  color: #f44336;
  font-weight: 600;
}

@media (max-width: 700px) {
  .app-detail-layout {
    grid-template-columns: 1fr;
    max-height: 90vh;
    overflow: auto;
  }
  .app-detail-layout--page {
    max-height: none;
  }
}

/* Detail as standalone page – back link within same width as app header */
.app-detail-page .app-detail-page-header {
  padding: 0.75rem 0;
  background: var(--white);
  border-bottom: 1px solid #eee;
}

.app-detail-page .app-detail-page-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 0 1.5rem;
}

.app-detail-back {
  font-size: 0.95rem;
  color: var(--purple);
  text-decoration: none;
}

.app-detail-back:hover {
  text-decoration: underline;
}

.app-detail-page .app-detail-page-main {
  padding: 1rem;
  max-width: 960px;
  margin: 0 auto;
}

.app-detail-preview {
  background: #1a1a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  min-height: 340px;
  border-radius: 20px;
  overflow: hidden;
}

.app-detail-media {
  width: 100%;
  max-height: 520px;
  min-height: 200px;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.app-detail-media.app-detail-media--placeholder {
  background: #fff;
}

.app-detail-media-placeholder {
  width: 100%;
  height: 100%;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.app-detail-media img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  display: block;
}

.app-detail-media .app-detail-embed {
  width: 100%;
  height: 100%;
  min-height: 280px;
  max-height: 520px;
  border: none;
  border-radius: 14px;
  aspect-ratio: 16 / 9;
}

.app-detail-media .app-detail-video {
  width: 100%;
  height: auto;
  max-height: 520px;
  display: block;
  border-radius: 14px;
}

.app-detail-media .app-detail-note-graphic-wrap {
  width: 100%;
  height: 100%;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 14px;
}

.app-detail-media .app-detail-note-graphic {
  width: 160px;
  height: 160px;
  color: rgba(140, 90, 60, 0.35);
}

.app-detail-open-btn {
  margin-top: 12px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--white);
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  text-decoration: none;
}

.app-detail-open-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.app-detail-content {
  padding: 1.5rem 1.75rem;
  overflow: auto;
  position: relative;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.app-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.app-modal-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.app-detail-title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  padding-right: 2rem;
  line-height: 1.35;
}

.app-detail-meta {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}


.app-detail-desc {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 15;
  line-clamp: 15;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.app-detail-tags-wrap {
  padding: 0.75rem 1rem;
  background: #f8f6f3;
  border-radius: 12px;
  border: 1px solid #e8e4df;
  margin-bottom: 0.5rem;
  max-width: 38rem;
}

.app-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.app-detail-tag {
  font-size: 0.8rem;
  padding: 4px 10px;
  background: #f3e5f5;
  border-radius: 8px;
  color: var(--purple-dark);
}

.app-detail-actions-wrap {
  padding: 0.75rem 1rem;
  background: #f8f6f3;
  border-radius: 12px;
  border: 1px solid #e8e4df;
  margin-top: auto;
  max-width: 38rem;
}

.app-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-detail-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--purple);
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
}

.app-detail-action:hover {
  background: rgba(173, 43, 201, 0.1);
  border-color: rgba(173, 43, 201, 0.3);
}

.app-detail-action--danger {
  color: #c62828;
  border-color: #ffcdd2;
  background: #ffebee;
}

.app-detail-action--danger:hover {
  background: #ffcdd2;
}

.app-detail-notes {
  margin-top: 1rem;
  padding: 12px;
  background: #fffde7;
  border-radius: 8px;
  border: 1px solid #fff59d;
  font-size: 0.9rem;
  color: #5d4037;
}

.app-detail-notes-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.app-detail-note-images {
  margin: 0.75rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}

.app-detail-note-images .app-detail-note-image {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.app-detail-note-images-hint {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Add note dialog (inline in modal or as small modal) */
.app-note-dialog {
  padding: 1rem 0;
}

.app-note-dialog textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  resize: vertical;
}

.app-note-dialog-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.app-note-dialog-actions button {
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid #e0e0e0;
  background: var(--card-bg);
  color: var(--text);
}

.app-note-dialog-actions button.primary {
  background: var(--purple);
  color: var(--white);
  border-color: var(--purple);
}

/* Scroll to top button */
.app-scroll-top {
  position: fixed;
  bottom: 2rem;
  right: calc((100% - 1200px) / 2 + 2rem);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--white);
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: transform 0.3s, opacity 0.3s, box-shadow 0.3s;
  opacity: 0;
  pointer-events: none;
}

/* Ensure it doesn't go off-screen on smaller windows */
@media (max-width: 1260px) {
  .app-scroll-top {
    right: 2rem;
  }
}


.app-scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.app-scroll-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.app-scroll-top:active {
  transform: translateY(-2px);
}

.app-scroll-top svg {
  display: block;
}

/* Note Modal specific styles */
.app-modal-dialog--note {
  max-width: 500px;
  border-radius: 20px;
}

.app-note-modal-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.app-add-link-char-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.app-add-link-char-count.limit-reached {
  color: #f44336;
  font-weight: 600;
}

.app-note-char-count {
  color: var(--text-muted);
}

.app-note-char-count.limit-reached {
  color: #f44336;
  font-weight: 700;
}

.app-note-premium-hint {
  color: #AD2BC9;
  font-weight: 500;
}

.app-add-link-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.app-add-link-btn-cancel {
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.app-add-link-btn-cancel:hover {
  background: #f5f5f5;
  color: var(--text);
}

.app-add-link-btn-submit {
  padding: 10px 24px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
  color: white;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(173, 43, 201, 0.3);
  transition: all 0.2s;
}

.app-add-link-btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(173, 43, 201, 0.4);
}

/* Tag Modal */
.app-modal-dialog--tag {
  max-width: 480px;
  border-radius: 20px;
}

.app-tag-modal-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.app-tag-modal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
  padding: 4px 0;
}

.app-tag-modal-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #e0e0e0;
  background: #f8f8f8;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.app-tag-modal-chip:hover {
  border-color: var(--purple);
  background: rgba(173, 43, 201, 0.08);
  color: var(--purple);
}

.app-tag-modal-chip.selected {
  border-color: var(--purple);
  background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
  color: white;
}

.app-tag-modal-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1rem;
  margin-top: 0.25rem;
  box-sizing: border-box;
}

.app-tag-modal-input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 2px rgba(173, 43, 201, 0.2);
}

@media (max-width: 600px) {
  .app-scroll-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
  }
}
/* AI Summary styles */
.app-detail-action--ai {
  display: none !important;
  /* Temporarily hidden */
  background: #fff;
  border: 1px solid #e0e0e0;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.2s;
  cursor: pointer;
  margin-left: auto;
  /* Push to right side */
}

.app-detail-action--ai:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  border-color: #AD2BC9;
}

.app-detail-action--ai .app-detail-action-icon {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1;
  background: linear-gradient(135deg, #4285F4 0%, #AD2BC9 50%, #F06292 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.app-detail-ai-summary-wrap {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, #f3e5f5 0%, #e8eaf6 100%);
  border-radius: 16px;
  border: 1px solid rgba(173, 43, 201, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  animation: app-fade-in 0.3s ease-out;
}

.app-detail-ai-summary-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.75rem;
  color: #4a148c;
}

.app-detail-ai-summary-icon {
  font-size: 1.2rem;
}

.app-detail-ai-summary-close {
  margin-left: auto;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #4a148c;
  cursor: pointer;
  line-height: 1;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.app-detail-ai-summary-close:hover {
  opacity: 1;
}

.app-detail-ai-summary-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #333;
}

@keyframes app-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

    to {
    transform: translateY(0);
  }
}
/* Confirmation Modal */
/* Help view – in-page, fills main area like profile */
.app-view--help .app-view-inner--help {
  padding: 0 0.5rem 2rem;
}

.app-view-header--help {
  margin-bottom: 0.5rem;
}

.app-help-iframe {
  width: 100%;
  height: calc(100vh - 220px);
  min-height: 400px;
  border: none;
  border-radius: var(--radius);
  background: #fff;
  margin-top: 0.5rem;
}

.app-modal-dialog--confirm {
  width: 90%;
  max-width: 400px;
  padding: 0;
  overflow: hidden;
}

.app-confirm-content {
  padding: 24px;
  text-align: center;
  color: var(--text-color);
  font-size: 1rem;
  line-height: 1.5;
}

.app-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.app-btn-secondary,
.app-btn-danger {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.app-btn-secondary {
  background: transparent;
  color: var(--text-muted);
}

.app-btn-secondary:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-color);
}

.app-btn-danger {
  background: #ffebee;
  color: #d32f2f;
}

.app-btn-danger:hover {
  background: #ffcdd2;
  transform: translateY(-1px);
}
/* Profile - Vector Search Migration */
.app-profile-migrate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: #AD2BC9;
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 2px 8px rgba(173, 43, 201, 0.35);
}

.app-profile-migrate-btn:hover {
  background: #9a26b5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(173, 43, 201, 0.45);
}

.app-profile-migrate-btn:active {
  transform: translateY(0);
}

.app-profile-migrate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.app-profile-migrate-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.app-profile-migrate-status {
  margin-top: 1rem;
  padding: 12px 16px;
  background: rgba(173, 43, 201, 0.08);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text);
}

.app-profile-migrate-status[hidden] {
  display: none;
}

/* Profile - Export data */
.app-profile-export-range {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 0.75rem;
}

.app-profile-export-option {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
}

.app-profile-export-option input {
  accent-color: var(--purple);
  cursor: pointer;
}

.app-profile-export-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: flex-end;
}

.app-profile-export-dates[hidden] {
  display: none;
}

.app-profile-export-date-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.app-profile-export-date {
  padding: 8px 10px;
  font-size: 0.95rem;
  border: 1px solid rgba(173, 43, 201, 0.25);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  min-width: 140px;
}

.app-profile-export-date:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 2px rgba(173, 43, 201, 0.15);
}

.app-profile-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0.5rem;
}

.app-profile-export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: #AD2BC9;
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 2px 8px rgba(173, 43, 201, 0.35);
}

.app-profile-export-btn:hover {
  background: #9a26b5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(173, 43, 201, 0.45);
}

.app-profile-export-btn:active {
  transform: translateY(0);
}

.app-profile-export-icon {
  font-size: 1rem;
  line-height: 1;
}

.app-profile-export-status {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.app-profile-export-status[hidden] {
  display: none;
}

/* Admin dashboard */
.admin-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.admin-section {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-section-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.admin-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem;
}

.admin-card-label {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.admin-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}

.admin-card-sub {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #94a3b8;
}

.admin-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #64748b;
}

.admin-filter select,
.admin-filter input {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  font-size: 0.9rem;
  color: #0f172a;
  background: #fff;
}

.admin-action-btn,
.admin-link-btn {
  border: none;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-action-btn {
  background: #0f172a;
  color: #fff;
}

.admin-link-btn {
  background: #e2e8f0;
  color: #0f172a;
}

.admin-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.admin-plan-card {
  background: #f1f5f9;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.admin-plan-card strong {
  color: #0f172a;
}

.admin-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.admin-table th,
.admin-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  font-size: 0.85rem;
}

.admin-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
}

.admin-muted {
  margin: 0.75rem 0 0;
  color: #94a3b8;
  font-size: 0.85rem;
}