/* SaaS cabinet shell. Scoped to authenticated non-admin pages from base.html. */
:root {
  --app-bg: #09080d;
  --app-sidebar: #0d0b12;
  --app-panel: rgba(20, 16, 27, .78);
  --app-panel-solid: #15111c;
  --app-line: rgba(255, 255, 255, .10);
  --app-line-soft: rgba(255, 255, 255, .065);
  --app-text: #f5f1f7;
  --app-muted: #9f96a8;
  --app-accent: #d744ff;
  --app-accent-2: #a82bff;
  --app-success: #58d9a4;
  --app-warning: #f2c75b;
}

/* Notifications list: image-led cards match the approved mobile news layout. */
.app-notifications-page .app-notification-item {
  padding: 16px 58px 16px 16px;
}
.app-notifications-page .app-notification-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--app-muted);
  font-size: 12px;
  line-height: 1.2;
}
.app-notifications-page .app-notification-meta span { color: #e785ff; font-weight: 800; text-transform: uppercase; }
.app-notifications-page .app-notification-meta b { color: #8e8195; font-weight: 700; }
.app-notifications-page .app-notification-meta time { color: #c0b4c5; }
.app-notifications-page .app-notification-open { align-items: flex-start; }
.app-notifications-page .app-notification-thumb,
.app-notifications-page .app-notification-icon {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(215,68,255,.28);
  border-radius: 9px;
  overflow: hidden;
}
.app-notifications-page .app-notification-thumb { display: block; background: #17121d; }
.app-notifications-page .app-notification-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.app-notifications-page .app-notification-copy { align-content: start; gap: 8px; min-width: 0; }
.app-notifications-page .app-notification-copy strong {
  display: -webkit-box;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  line-height: 1.24;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.app-notifications-page .app-notification-image-count {
  justify-self: start;
  padding: 5px 10px;
  border: 1px solid rgba(215,68,255,.38);
  border-radius: 999px;
  color: #e985ff;
  background: rgba(215,68,255,.10);
  font-size: 10px;
  font-weight: 800;
}
.app-notifications-page .app-notification-preview {
  display: -webkit-box;
  margin: 12px 0 0;
  overflow: hidden;
  color: #d6cad9;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-line;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.app-notifications-page .app-notification-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(215,68,255,.16);
}
.app-notifications-page .app-notification-open-link {
  min-height: 44px;
  padding: 0;
  border: 0;
  color: #e785ff;
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.app-notifications-page .app-notification-open-link:hover,
.app-notifications-page .app-notification-open-link:focus-visible { color: #fff; outline: none; }
.app-notifications-page .app-notification-actions .app-notification-stats {
  position: static;
  min-height: 36px;
  margin-left: auto;
  padding-inline: 16px;
  font-size: 12px;
}
.app-notifications-page .app-notification-stats-panel { width: 100%; }

@media (max-width: 760px) {
  .app-notifications-page .app-notification-item { padding: 16px 54px 16px 16px; }
  .app-notifications-page .app-notification-meta { gap: 8px; margin-bottom: 12px; font-size: 11px; }
  .app-notifications-page .app-notification-thumb { flex-basis: 76px; width: 76px; height: 76px; border-radius: 15px; }
  .app-notifications-page .app-notification-icon { flex-basis: 30px; width: 30px; height: 30px; border-radius: 9px; }
  .app-notifications-page .app-notification-copy strong { font-size: 20px; }
  .app-notifications-page .app-notification-preview { margin-top: 16px; font-size: 16px; }
  .app-notifications-page .app-notification-actions { margin-top: 16px; padding-top: 12px; }
  .app-notifications-page .app-notification-open-link,
  .app-notifications-page .app-notification-actions .app-notification-stats { font-size: 15px; }
}

/* Dashboard follows the approved cabinet reference: overview first, image-led news second. */
.app-dashboard-page .app-overview-section-head { margin-top: 0; margin-bottom: 15px; }
.app-dashboard-page .app-news-item { padding: 24px; border-radius: 18px; }
.app-dashboard-page .app-news-card { display: block; width: 100%; }
.app-dashboard-page .app-news-main { display: grid; grid-template-columns: 132px minmax(0, 1fr); align-items: start; gap: 20px; min-width: 0; }
.app-dashboard-page .app-news-main:not(.has-image) { grid-template-columns: 32px minmax(0, 1fr); gap: 14px; }
.app-dashboard-page .app-news-meta { display: flex; align-items: center; gap: 10px; color: var(--app-muted); font-size: 12px; line-height: 1.2; }
.app-dashboard-page .app-news-meta > span { color: #e785ff; font-weight: 800; text-transform: uppercase; }
.app-dashboard-page .app-news-meta b { color: #8e8195; font-weight: 700; }
.app-dashboard-page .app-news-meta time { color: #c0b4c5; }
.app-dashboard-page .app-news-thumb { display: block; width: 132px; height: 140px; border: 1px solid rgba(215,68,255,.28); border-radius: 15px; overflow: hidden; background: #17121d; }
.app-dashboard-page .app-news-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.app-dashboard-page .app-news-icon { align-self: start; }
.app-dashboard-page .app-news-copy { display: grid; align-content: start; min-width: 0; gap: 9px; }
.app-dashboard-page .app-news-copy > strong { display: -webkit-box; overflow: hidden; color: #fff; font-size: 20px; line-height: 1.28; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.app-dashboard-page .app-news-image-count { justify-self: start; width: fit-content; padding: 5px 10px; border: 1px solid rgba(215,68,255,.38); border-radius: 999px; color: #e985ff; background: rgba(215,68,255,.10); font-size: 10px; font-weight: 800; }
.app-dashboard-page .app-news-preview { margin-top: 1px; font-size: 15px; line-height: 1.5; -webkit-line-clamp: 3; }
.app-dashboard-page .app-news-open-hint { font-size: 14px; }

@media (max-width: 760px) {
  .app-dashboard-page .app-overview-section-head { margin-top: 27px; }
  .app-dashboard-page .app-news-item { padding: 16px; border-radius: 16px; }
  .app-dashboard-page .app-news-main { grid-template-columns: 92px minmax(0, 1fr); gap: 14px; }
  .app-dashboard-page .app-news-main:not(.has-image) { grid-template-columns: 30px minmax(0, 1fr); gap: 12px; }
  .app-dashboard-page .app-news-meta { gap: 8px; font-size: 11px; }
  .app-dashboard-page .app-news-thumb { width: 92px; height: 98px; border-radius: 13px; }
  .app-dashboard-page .app-news-icon { flex-basis: 30px; width: 30px; height: 30px; border-radius: 9px; }
  .app-dashboard-page .app-news-copy > strong { font-size: 18px; }
  .app-dashboard-page .app-news-preview { font-size: 15px; }
  .app-dashboard-page .app-news-open-hint { font-size: 15px; }
}

@media (max-width: 380px) {
  .app-dashboard-page .app-news-main { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; }
  .app-dashboard-page .app-news-thumb { width: 76px; height: 82px; }
  .app-dashboard-page .app-news-copy > strong { font-size: 17px; }
}

/* Project filters: one clean violet outline, with a dedicated dropdown arrow. */
.app-projects-page .app-filter-bar .app-select-wrap { position: relative; display: block; flex: 0 1 180px; min-width: 0; }
.app-projects-page .app-filter-bar .app-select-wrap select { width: 100%; padding-right: 42px; border: 1px solid rgba(215,68,255,.44) !important; border-radius: 9px !important; background-color: rgba(15,10,22,.92) !important; background-image: none !important; box-shadow: none !important; appearance: none; -webkit-appearance: none; cursor: pointer; }
.app-projects-page .app-filter-bar .app-select-wrap select:hover { border-color: rgba(236,120,255,.78) !important; }
.app-projects-page .app-filter-bar .app-select-wrap select:focus,
.app-projects-page .app-filter-bar .app-select-wrap select:focus-visible { border-color: rgba(218,92,255,.86) !important; outline: none !important; outline-offset: 0 !important; box-shadow: none !important; }
.app-projects-page .app-filter-bar .app-select-arrow { position: absolute; top: 50%; right: 17px; width: 8px; height: 8px; border-right: 1.5px solid #eaa4ff; border-bottom: 1.5px solid #eaa4ff; transform: translateY(-68%) rotate(45deg); pointer-events: none; }
.app-projects-page .app-filter-bar .app-select-wrap select option { color: #f3eef7; background: #171020; }
.app-projects-page .app-filter-bar .app-select-wrap select option:checked { color: #fff; background: #5b1d75; }

body:has(.app-shell) {
  min-height: 100vh;
  background: radial-gradient(circle at 82% -6%, rgba(128, 39, 161, .20), transparent 28%), var(--app-bg);
  font-family: Manrope, Inter, Arial, sans-serif;
}
body:has(.app-shell) > .site-stars { opacity: .62; }
body:has(.app-shell) > main,
body:has(.app-shell) > .footer { position: static; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); color: var(--app-text); }
.app-sidebar { position: sticky; top: 0; z-index: 30; display: flex; flex-direction: column; min-height: 100vh; padding: 28px 16px 18px; border-right: 1px solid var(--app-line); background: rgba(13, 11, 18, .90); }
.app-sidebar-top { display: grid; gap: 25px; }
.app-logo { display: inline-flex; flex-direction: column; width: fit-content; padding: 0 12px; line-height: 1; }
.app-logo-title { color: #fff; font-size: 18px; font-weight: 900; letter-spacing: -.045em; }
.app-logo-title span { color: var(--app-accent); }
.app-logo-title .app-logo-pro { color: var(--app-accent); }
.app-logo-subtitle { margin-top: 7px; color: var(--app-muted); font-size: 10px; letter-spacing: .09em; }
.app-site-link { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--app-line); border-radius: 10px; color: #d7cbd9; background: rgba(255,255,255,.028); font-size: 13px; font-weight: 800; transition: color .2s ease, border-color .2s ease, background .2s ease; }
.app-site-link:hover { border-color: rgba(215,68,255,.42); color: #fff; background: rgba(215,68,255,.09); }
.app-admin-link { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 12px; border: 1px solid rgba(215,68,255,.38); border-radius: 10px; color: #edb7ff; background: linear-gradient(135deg, rgba(120,36,173,.25), rgba(215,68,255,.1)); font-size: 13px; font-weight: 800; transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease; }
.app-admin-link span { color: var(--app-accent); font-size: 16px; line-height: 1; }
.app-admin-link:hover { border-color: rgba(215,68,255,.72); color: #fff; background: linear-gradient(135deg, rgba(137,41,195,.42), rgba(215,68,255,.2)); transform: translateY(-1px); }
.app-create-cta { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid rgba(239, 142, 255, .62); border-radius: 12px; color: #fff; background: linear-gradient(135deg, #a42bff, #dc42e8); font-size: 14px; font-weight: 800; box-shadow: 0 10px 28px rgba(190, 43, 232, .18); transition: transform .22s ease, filter .22s ease, box-shadow .22s ease; }
.app-create-cta span { font-size: 21px; line-height: 0; }
.app-create-cta:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 14px 34px rgba(190, 43, 232, .28); }
.app-nav { display: grid; gap: 22px; margin-top: 35px; }
.app-nav-group { display: grid; gap: 4px; }
.app-nav-group + .app-nav-group { position: relative; }
.app-nav-group + .app-nav-group::before { content: ""; position: absolute; top: -11px; right: 13px; left: 13px; height: 1px; background: linear-gradient(90deg, transparent, rgba(215,68,255,.42) 22%, rgba(215,68,255,.68) 50%, rgba(215,68,255,.42) 78%, transparent); opacity: .9; }
.app-nav-label { padding: 0 13px 7px; color: #6e6576; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.app-nav-label-accent { color: #e98aff; }
.app-nav-item { position: relative; display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 9px 12px; border: 1px solid transparent; border-radius: 11px; color: #afa6b6; font-size: 13px; font-weight: 700; transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease; }
.app-nav-item:hover { color: #fff; background: rgba(255, 255, 255, .045); transform: translateX(2px); }
.app-nav-item.is-active { border-color: rgba(215, 68, 255, .20); color: #fff; background: linear-gradient(90deg, rgba(215, 68, 255, .15), rgba(215, 68, 255, .055)); }
.app-nav-item.is-active::before { content: ""; position: absolute; left: -1px; top: 9px; bottom: 9px; width: 2px; border-radius: 99px; background: var(--app-accent); }
.app-nav-icon { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border: 1px solid rgba(255, 255, 255, .075); border-radius: 8px; color: #a69baa; font-size: 16px; line-height: 1; }
.app-nav-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-nav-item.is-active .app-nav-icon { color: #e98aff; border-color: rgba(215, 68, 255, .34); background: rgba(215, 68, 255, .12); }
.app-nav-badge { display: inline-grid; place-items: center; min-width: 19px; height: 19px; margin-left: auto; padding: 0 5px; border-radius: 999px; color: #fff; background: var(--app-accent); font-size: 10px; line-height: 1; }
.app-sidebar-bottom { display: grid; gap: 14px; margin-top: auto; padding-top: 22px; border-top: 1px solid var(--app-line-soft); }
.app-sidebar-user { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px 8px; border-radius: 11px; background: rgba(255, 255, 255, .035); }
.app-sidebar-user > span:last-child, .app-user-popover-head > span:last-child { display: grid; min-width: 0; gap: 3px; }
.app-sidebar-user strong, .app-user-popover-head strong { overflow: hidden; color: #eee7f0; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.app-sidebar-user small, .app-user-popover-head small { overflow: hidden; color: var(--app-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.app-avatar { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #a92fff, #e54bd9); font-size: 14px; font-weight: 800; }
.app-avatar-small { flex-basis: 30px; width: 30px; height: 30px; font-size: 12px; }
.app-logout { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 9px; border: 0; color: #928899; background: transparent; font-size: 12px; font-weight: 700; text-align: left; transition: color .2s ease; }
.app-logout:hover { color: #fff; }

.app-main-column { position: relative; min-width: 0; min-height: 100vh; }
.app-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 22px; min-height: 70px; padding: 0 20px; border-bottom: 1px solid var(--app-line-soft); background: rgba(9, 8, 13, .86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.app-topbar-main { display: flex; align-items: center; min-width: 0; gap: 30px; }
.app-desktop-brand, .app-desktop-nav, .app-topbar-logout { display: none; }
.app-topbar-title { display: flex; align-items: center; gap: 13px; color: #eee8f1; font-size: 18px; font-weight: 800; }
.app-mobile-menu-toggle { display: none; align-items: center; justify-content: center; flex: 0 0 36px; flex-direction: column; gap: 4px; width: 36px; height: 36px; padding: 0; border: 1px solid var(--app-line); border-radius: 10px; color: #fff; background: rgba(255,255,255,.04); }
.app-mobile-menu-toggle span { display: block; width: 16px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .2s ease, opacity .2s ease; }
.app-mobile-menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(6px) rotate(45deg); }
.app-mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.app-mobile-menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-6px) rotate(-45deg); }
.app-mobile-brand { display: none; color: #fff; font-size: 16px; font-weight: 900; letter-spacing: -.045em; line-height: 1; }
.app-mobile-brand span span { color: #e785ff; }
.app-mobile-brand .app-mobile-brand-pro { color: #e785ff; }
.app-logo-title .app-logo-divider, .app-mobile-brand .app-logo-divider { display: inline-block; color: #fff; font-size: calc(1em + 1px); font-weight: 500; line-height: .85; transform: scaleX(.76); transform-origin: center; }
.app-mobile-brand:hover { color: #fff; }
.app-topbar-actions { display: flex; align-items: center; gap: 10px; }
.app-topbar-logout button { min-height: 36px; padding: 0 3px; border: 0; color: #a99eae; background: transparent; font-size: 12px; font-weight: 800; transition: color .2s ease; }
.app-topbar-logout button:hover { color: #fff; }
.app-credit-badge { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border: 1px solid rgba(215, 68, 255, .28); border-radius: 999px; color: #f2dafa; background: rgba(215, 68, 255, .09); font-size: 12px; font-weight: 800; }
.app-credit-badge:hover { border-color: rgba(215, 68, 255, .56); background: rgba(215, 68, 255, .14); }
.app-popover-wrap { position: relative; }
.app-icon-button, .app-user-trigger { border: 1px solid var(--app-line); color: #e8e0ea; background: rgba(255, 255, 255, .035); transition: background .2s ease, border-color .2s ease; }
.app-icon-button { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; font-size: 18px; }
.app-icon-button:hover, .app-user-trigger:hover { border-color: rgba(215, 68, 255, .35); background: rgba(215, 68, 255, .09); }
.app-topbar-bell.has-unread-news .app-bell-icon { display: block; transform-box: fill-box; transform-origin: 50% 12%; animation: app-bell-ring 2.4s ease-in-out infinite; -webkit-animation: app-bell-ring 2.4s ease-in-out infinite; will-change: transform; }
.app-topbar-bell.has-unread-news::after { content: ""; position: absolute; inset: -3px; border: 1px solid rgba(215, 68, 255, .46); border-radius: 13px; pointer-events: none; opacity: 0; animation: app-bell-alert-pulse 2.4s ease-out infinite; -webkit-animation: app-bell-alert-pulse 2.4s ease-out infinite; }
@keyframes app-bell-ring { 0%, 72%, 100% { transform: rotate(0deg); } 75% { transform: rotate(10deg); } 78% { transform: rotate(-8deg); } 81% { transform: rotate(6deg); } 84% { transform: rotate(-4deg); } 87% { transform: rotate(2deg); } 90% { transform: rotate(0deg); } }
@keyframes app-bell-alert-pulse { 0%, 48%, 100% { opacity: 0; transform: scale(.96); } 16% { opacity: .65; } 32% { opacity: 0; transform: scale(1.08); } }
@keyframes app-news-dot-pulse { 0%, 100% { opacity: .72; transform: scale(.9); box-shadow: 0 0 5px currentColor; } 50% { opacity: 1; transform: scale(1.2); box-shadow: 0 0 15px currentColor; } }
@keyframes app-news-dot-ring { 0%, 100% { opacity: 0; transform: scale(.72); } 22% { opacity: .58; } 58% { opacity: 0; transform: scale(1.75); } }
.app-topbar-badge { position: absolute; top: -5px; right: -5px; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border: 2px solid var(--app-bg); border-radius: 999px; color: #fff; background: var(--app-accent); font-size: 9px; line-height: 1; }
.app-user-trigger { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 5px 9px 5px 6px; border-radius: 12px; text-align: left; }
.app-user-trigger-copy { display: grid; min-width: 0; gap: 1px; }
.app-user-trigger-copy strong { max-width: 130px; overflow: hidden; color: #eee7f0; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.app-user-trigger-copy small { max-width: 130px; overflow: hidden; color: var(--app-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.app-chevron { color: #8f8594; font-size: 16px; }
.app-popover { position: absolute; top: calc(100% + 10px); right: 0; z-index: 50; width: min(340px, calc(100vw - 28px)); padding: 10px; border: 1px solid rgba(215, 68, 255, .25); border-radius: 15px; background: rgba(21, 17, 28, .98); box-shadow: 0 20px 50px rgba(0, 0, 0, .48); }
.app-popover[hidden], .app-create-popover[hidden] { display: none; }
.app-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 7px 10px; color: #fff; font-size: 13px; }
.app-popover-head a, .app-popover-head button { border: 0; color: #e785ff; background: transparent; font-size: 11px; font-weight: 800; }
.app-popover-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 8px; border-top: 1px solid var(--app-line-soft); border-radius: 9px; }
.app-popover-row:hover { background: rgba(255,255,255,.045); }
.app-popover-row > span:last-child { display: grid; min-width: 0; gap: 2px; overflow-wrap: anywhere; }
.app-popover-row strong, .app-popover-row small { color: #f3edf4; font-size: 12px; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.app-popover-row small { color: var(--app-muted); font-size: 10px; }
.app-popover-dot { position: relative; flex: 0 0 8px; width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--app-accent); box-shadow: 0 0 10px currentColor; }
.app-popover-dot.is-green { color: var(--app-success); background: var(--app-success); }
.app-popover-dot.is-pink { color: var(--app-accent); animation: app-news-dot-pulse 1.8s ease-in-out infinite; -webkit-animation: app-news-dot-pulse 1.8s ease-in-out infinite; }
.app-popover-dot.is-pink::after { content: ""; position: absolute; inset: -4px; border: 1px solid currentColor; border-radius: 50%; pointer-events: none; opacity: 0; animation: app-news-dot-ring 1.8s ease-out infinite; -webkit-animation: app-news-dot-ring 1.8s ease-out infinite; }
.app-popover-dot.is-muted { color: #8e6a9d; background: #72547f; box-shadow: 0 0 5px rgba(142,106,157,.35); animation: none; -webkit-animation: none; }
.app-popover-empty { padding: 12px 8px; border-top: 1px solid var(--app-line-soft); color: var(--app-muted); font-size: 12px; }
.app-popover-footer { display: block; padding: 11px 8px 4px; border-top: 1px solid var(--app-line-soft); color: #e785ff; font-size: 11px; font-weight: 800; }
.app-user-popover { padding: 8px; }
.app-user-popover-head { display: flex; align-items: center; gap: 10px; padding: 9px 7px 12px; border-bottom: 1px solid var(--app-line-soft); }
.app-user-popover > a, .app-user-popover > form button { display: block; width: 100%; padding: 10px 7px; border: 0; color: #d2c8d5; background: transparent; font-size: 12px; text-align: left; }
.app-user-popover > a:hover, .app-user-popover > form button:hover { color: #fff; background: rgba(255,255,255,.045); }
.app-user-popover > form { border-top: 1px solid var(--app-line-soft); }
.app-create-popover { position: absolute; top: 64px; left: 25px; z-index: 25; width: min(390px, calc(100% - 50px)); padding: 11px; border: 1px solid rgba(215, 68, 255, .30); border-radius: 16px; background: rgba(21, 17, 28, .98); box-shadow: 0 22px 55px rgba(0, 0, 0, .48); }
.app-create-popover .app-popover-head { padding-bottom: 8px; }
.app-create-option { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 8px; border-top: 1px solid var(--app-line-soft); border-radius: 9px; color: #fff; }
.app-create-option:hover { background: rgba(215, 68, 255, .10); }
.app-create-option > span:nth-child(2) { display: grid; gap: 3px; }
.app-create-option strong { font-size: 12px; }
.app-create-option small { color: var(--app-muted); font-size: 10px; line-height: 1.35; }
.app-create-option > span:last-child { color: #e785ff; font-size: 17px; }
.app-create-option-icon { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(215, 68, 255, .32); border-radius: 9px; color: #e785ff; background: rgba(215, 68, 255, .09); }

/* Desktop cabinet workspace: add 30px of breathing room beside the sidebar and right edge. */
body:has(.app-shell) main { width: min(100%, 1440px); margin: 0 auto; padding: 0 50px; }
body:has(.app-shell) .section { width: 100%; max-width: none; margin: 0; padding: 42px 0 64px; }
body:has(.app-shell) .section.shell { width: 100%; }
body:has(.app-shell) .app-footer { display: flex; justify-content: space-between; gap: 16px; margin: 0 20px; padding: 20px 0 28px; border-top: 1px solid var(--app-line-soft); color: #807587; font-size: 11px; }
.app-bottom-nav { display: none; }

@media (min-width: 1051px) {
  /* Desktop cabinet keeps the established sidebar; public home uses its own header. */
  .app-shell-user { display: grid; min-height: 100vh; }
}

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 214px minmax(0, 1fr); }
  .app-sidebar { padding-inline: 12px; }
  .app-logo-title { font-size: 16px; }
  .app-nav-item { font-size: 13px; }
  .app-topbar { padding-inline: 20px; }
  body:has(.app-shell) main { padding-inline: 20px; }
  body:has(.app-shell) .app-footer { margin-inline: 20px; }
}

@media (max-width: 760px) {
  body:has(.app-shell) { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .app-shell { display: block; min-height: 0; }
  .app-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(292px, 86vw); min-height: 100vh; transform: translateX(-102%); transition: transform .28s cubic-bezier(.16,.84,.44,1); box-shadow: 18px 0 50px rgba(0,0,0,.50); }
  body.app-menu-open .app-sidebar { transform: translateX(0); }
  body.app-menu-open::after { content: ""; position: fixed; inset: 0; z-index: 55; background: rgba(3,2,5,.66); }
  .app-main-column { min-height: 0; }
  .app-topbar { min-height: 62px; padding: 0 20px; }
  .app-mobile-menu-toggle { display: flex; }
  .app-topbar-title { gap: 0; }
  .app-topbar-section { display: none; }
  .app-mobile-brand { display: inline-flex; align-items: center; min-height: 34px; }
  .app-user-trigger-copy, .app-chevron { display: none; }
  .app-user-trigger { padding: 5px; border: 0; background: transparent; }
  .app-topbar-actions { gap: 5px; }
  .app-notification-popover { position: fixed; top: 70px; right: 12px; left: 12px; width: auto; max-height: min(70vh, 460px); overflow-y: auto; overscroll-behavior: contain; }
  .app-credit-badge { min-height: 31px; padding-inline: 9px; font-size: 11px; }
  .app-create-popover { position: fixed; top: auto; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); left: 12px; width: auto; }
  body:has(.app-shell) main { padding-inline: 20px; }
  body:has(.app-shell) .section { padding-top: 28px; }
  body:has(.app-shell) .app-footer { display: none; }
  .app-bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr); min-height: 64px; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(215,68,255,.18); background: rgba(13,11,18,.96); box-shadow: 0 -10px 30px rgba(0,0,0,.28); }
  .app-bottom-nav a { display: grid; place-items: center; align-content: center; gap: 3px; min-width: 0; border-radius: 9px; color: #968b9e; font-size: 9px; font-weight: 700; }
  .app-bottom-nav a > span { position: relative; color: #b8aabe; font-size: 18px; line-height: 1; }
  .app-bottom-nav a.is-active { color: #fff; background: rgba(215,68,255,.11); }
  .app-bottom-nav a.is-active > span { color: #e785ff; }
  .app-bottom-nav .app-bottom-create { color: #fff; }
  .app-bottom-nav .app-bottom-create > span { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; color: #fff; background: linear-gradient(135deg,#a42bff,#dc42e8); font-size: 21px; }
  .app-bottom-nav b { position: absolute; top: -5px; right: -8px; display: grid; place-items: center; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 99px; color: #fff; background: var(--app-accent); font-size: 8px; }
}

@media (max-width: 420px) {
  .app-topbar-title { font-size: 16px; }
  .app-credit-badge span { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  .app-sidebar, .app-nav-item, .app-create-cta, .app-topbar-bell.has-unread-news .app-bell-icon, .app-topbar-bell.has-unread-news::after, .app-popover-dot.is-pink, .app-popover-dot.is-pink::after { transition: none; animation: none; -webkit-animation: none; }
}

/* Match the readable scale of the public landing page inside the cabinet. */
body:has(.app-shell) { font-size: 15px; }
.app-nav-label { font-size: 11px; }
.app-nav-item { font-size: 14px; }
.app-sidebar-user strong { font-size: 13px; }
.app-sidebar-user small { font-size: 11px; }
.app-logout { font-size: 13px; }
.app-page-head p { font-size: 16px; }
.app-kpi-label { font-size: 12px; }
.app-kpi-meta { font-size: 11px; }
.app-section-head h2 { font-size: 20px; }
.app-creation-card strong { font-size: 15px; }
.app-creation-card small { font-size: 12px; }
.app-project-copy strong { font-size: 14px; }
.app-project-copy small { font-size: 11px; }
.app-list-meta { font-size: 12px; }
.app-notification-copy strong { font-size: 14px; }
.app-notification-copy p { font-size: 12px; }
.app-settings-card > p { font-size: 12px; }
.app-settings-card label { font-size: 12px; }
.app-toggle-row strong { font-size: 12px; }
.app-toggle-row small { font-size: 11px; }
.app-billing-card p { font-size: 12px; }
.app-history-row strong { font-size: 12px; }
.app-history-row span { font-size: 11px; }

@media (max-width: 1050px) {
  .app-nav-item { font-size: 13px; }
}
@media (max-width: 760px) {
  .app-nav-item { font-size: 14px; }
  .app-site-link { min-height: 40px; }
}

/* Shared cabinet content primitives. */
.app-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.app-context-back { display: inline-flex; align-items: center; width: fit-content; min-height: 32px; margin-bottom: 9px; color: #e785ff; font-size: 12px; font-weight: 800; transition: color .2s ease; }
.app-context-back:hover { color: #fff; }
.app-page-head h1 { max-width: 880px; margin: 0 0 8px; font-size: clamp(30px, 4vw, 50px); line-height: 1.02; letter-spacing: -.06em; }
.app-page-head h1 span { color: var(--app-accent); }
.app-page-head p { max-width: 650px; margin: 0; color: var(--app-muted); font-size: 15px; }
.app-info-title { max-width: 720px; margin: 0 0 14px; color: #fff; font-size: clamp(30px, 3.2vw, 40px); line-height: 1.08; letter-spacing: -.055em; }
.app-info-copy { display: grid; gap: 16px; max-width: 760px; }
.app-info-copy p { margin: 0; }
.app-page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.app-button, .app-shell .button { min-height: 42px; border-radius: 11px; }
.app-button-secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; border: 1px solid var(--app-line); border-radius: 11px; color: #e9e1eb; background: rgba(255,255,255,.035); font-size: 12px; font-weight: 800; }
.app-button-secondary:hover { border-color: rgba(215,68,255,.42); background: rgba(215,68,255,.08); }
.app-kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 28px; }
.app-kpi-card { position: relative; min-height: 126px; padding: 19px 20px; overflow: hidden; border: 1px solid var(--app-line); border-radius: 16px; background: linear-gradient(145deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); }
.app-kpi-card::after { content: ""; position: absolute; right: -36px; bottom: -58px; width: 130px; height: 130px; border-radius: 50%; background: rgba(215,68,255,.10); filter: blur(16px); pointer-events: none; }
.app-kpi-label { display: block; color: var(--app-muted); font-size: 11px; font-weight: 700; }
.app-kpi-value { display: block; margin-top: 12px; color: #fff; font-size: clamp(25px, 3vw, 34px); font-weight: 800; letter-spacing: -.06em; line-height: 1; }
.app-kpi-meta { display: block; margin-top: 10px; color: #bdb1c3; font-size: 10px; }
.app-kpi-meta a { color: #e785ff; }
.app-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 34px 0 15px; }
.app-section-head h2 { margin: 0; color: #fff; font-size: 19px; letter-spacing: -.035em; }
.app-section-head a { color: #df7cf6; font-size: var(--font-size-md); font-weight: var(--font-weight-semibold); }
.app-section-head a.app-section-all-projects { font-size: 14px; }
.app-creation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.app-creation-card { display: flex; align-items: center; gap: 15px; min-height: 112px; padding: 19px; border: 1px solid var(--app-line); border-radius: 16px; background: linear-gradient(145deg, rgba(215,68,255,.10), rgba(255,255,255,.025)); transition: transform .22s ease, border-color .22s ease, background .22s ease; }
.app-creation-card:hover { transform: translateY(-3px); border-color: rgba(215,68,255,.42); background: linear-gradient(145deg, rgba(215,68,255,.16), rgba(255,255,255,.04)); }
.app-creation-icon { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border: 1px solid rgba(215,68,255,.35); border-radius: 12px; color: #ee9eff; background: rgba(215,68,255,.12); font-size: 22px; }
.app-creation-card > span:nth-child(2) { display: grid; gap: 5px; }
.app-creation-card strong { color: #fff; font-size: 14px; }
.app-creation-card small { color: var(--app-muted); font-size: 11px; line-height: 1.4; }
.app-creation-arrow { margin-left: auto; color: #e785ff; font-size: 18px; }
.app-media-filter { display: inline-flex; align-items: center; gap: 10px; width: fit-content; margin: -2px 0 14px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.app-media-filter a { display: inline-flex; align-items: center; justify-content: center; min-width: 76px; min-height: 35px; padding: 0 15px; border: 1px solid rgba(215,68,255,.44); border-radius: 10px; color: var(--app-muted); background: rgba(215,68,255,.045); font-size: 12px; font-weight: 800; line-height: 1; white-space: nowrap; transition: border-color .2s ease, color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease; }
.app-media-filter a:hover { color: #fff; border-color: rgba(236,120,255,.82); background: linear-gradient(135deg, rgba(167,44,255,.16), rgba(233,75,220,.13)); box-shadow: 0 5px 16px rgba(215,68,255,.14); transform: translateY(-1px); }
.app-media-filter a.is-active { color: #fff; border-color: rgba(215,68,255,.46); background: linear-gradient(135deg, rgba(167,44,255,.72), rgba(233,75,220,.56)); box-shadow: 0 5px 16px rgba(215,68,255,.18); }
.app-create-page {
  width: 100%;
  max-width: 1040px !important;
  margin-inline: auto !important;
}
.app-create-page .app-page-head {
  display: block;
  max-width: 900px;
  margin-bottom: 28px;
}
.app-create-page .app-page-head > div { min-width: 0; }
.app-create-page .app-creation-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}
.app-create-page .app-creation-card {
  min-width: 0;
  min-height: 138px;
  padding: 22px;
}
.app-create-page .app-creation-card > span:nth-child(2) { min-width: 0; }
.app-create-page .app-creation-card strong,
.app-create-page .app-creation-card small { overflow-wrap: anywhere; }
.app-create-page .app-creation-card small { max-width: 36ch; }
.app-create-page > .notice { max-width: 900px; margin-inline: auto; }
.app-project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.app-project-card { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--app-line); border-radius: 15px; background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018)); transition: transform .22s ease, border-color .22s ease; }
.app-project-card:hover { transform: translateY(-3px); border-color: rgba(215,68,255,.36); }
.app-project-link { display: flex; flex: 1; flex-direction: column; min-width: 0; color: inherit; }
.app-project-preview { position: relative; display: grid; place-items: center; height: 174px; overflow: hidden; border-bottom: 1px solid var(--app-line-soft); color: #d779ef; background: radial-gradient(circle at 50% 20%, rgba(215,68,255,.16), transparent 45%), #100d15; }
.app-project-card.is-video .app-project-preview { background: radial-gradient(circle at 50% 35%, rgba(215,68,255,.28), transparent 46%), #100d15; }
.app-project-video-preview { display: block; width: 100%; height: 100%; object-fit: contain; background: #0a080d; }
.app-project-video-overlay { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.58); border-radius: 50%; color: #fff; background: rgba(28,12,39,.72); box-shadow: 0 7px 20px rgba(0,0,0,.30); font-size: 17px; transform: translate(-50%, -50%); pointer-events: none; }
.app-project-video-mark { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 8px; border: 1px solid rgba(215,68,255,.5); border-radius: 14px; color: #f0a2ff; background: rgba(215,68,255,.13); font-size: 20px; }
.app-project-preview img { width: 100%; height: 100%; object-fit: cover; }
.app-project-copy { display: grid; gap: 6px; padding: 14px 15px 16px; }
.app-project-copy strong { overflow: hidden; color: #f3edf4; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.app-project-copy small { overflow: hidden; color: var(--app-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.app-project-status { display: inline-flex; width: fit-content; padding: 3px 7px; border: 1px solid rgba(88,217,164,.28); border-radius: 999px; color: #9aefd0; background: rgba(88,217,164,.08); font-size: 9px; font-weight: 800; }
.app-project-menu { position: absolute; top: 9px; right: 9px; z-index: 2; }
.app-project-menu > summary { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid rgba(0,0,0,.16); border-radius: 9px; color: #fff; background: rgba(10,8,14,.68); cursor: pointer; list-style: none; backdrop-filter: blur(8px); }
.app-project-menu > summary::-webkit-details-marker { display: none; }
.app-project-menu[open] > summary { border-color: rgba(215,68,255,.46); background: rgba(35,16,45,.94); }
.app-project-menu-list { position: absolute; top: 35px; right: 0; display: grid; width: 154px; padding: 5px; border: 1px solid rgba(215,68,255,.28); border-radius: 11px; background: rgba(21,17,28,.98); box-shadow: 0 14px 30px rgba(0,0,0,.42); }
.app-project-menu-list a, .app-project-menu-list button { padding: 8px 9px; border: 0; border-radius: 7px; color: #d5c9d8; background: transparent; font-size: 11px; text-align: left; }
.app-project-menu-list a:hover, .app-project-menu-list button:hover { color: #fff; background: rgba(215,68,255,.12); }
.app-project-menu-list .is-danger { color: #f5a8c7; }
.app-news-strip { display: grid; gap: 10px; margin-bottom: 24px; }
.app-news-section-head { margin-bottom: 12px; }
.app-news-item { padding: 14px 16px; border: 1px solid rgba(215,68,255,.24); border-radius: 13px; background: rgba(215,68,255,.07); }
.app-news-item.is-unread { border-color: rgba(215,68,255,.50); background: rgba(215,68,255,.11); }
.app-news-card { display: flex; align-items: flex-start; width: 100%; gap: 11px; padding: 0; border: 0; color: inherit; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.app-news-card:focus-visible { outline: 2px solid rgba(231,133,255,.82); outline-offset: 5px; border-radius: 8px; }
.app-news-icon, .app-news-dialog-icon { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border: 1px solid rgba(215,68,255,.38); border-radius: 10px; color: #ed8cff; background: rgba(215,68,255,.13); }
.app-news-copy { display: grid; min-width: 0; flex: 1 1 auto; gap: 5px; }
.app-news-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; }
.app-news-head strong { min-width: 0; color: #fff; font-size: 14px; line-height: 1.3; }
.app-news-head time { flex: 0 0 auto; color: var(--app-muted); font-size: 11px; }
.app-news-preview { display: -webkit-box; overflow: hidden; color: #d6cad9; font-size: 13px; line-height: 1.45; white-space: pre-wrap; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.app-news-image { display: block; width: 100%; max-height: 240px; margin-top: 9px; border: 1px solid rgba(215,68,255,.24); border-radius: 11px; object-fit: cover; background: #0b0a0e; }
.app-news-open-hint { color: #e785ff; font-size: 11px; font-weight: 800; }
.app-news-strip form { margin: 10px 0 0 43px; }
.app-news-strip form button { padding: 5px 8px; border: 1px solid rgba(215,68,255,.36); border-radius: 7px; color: #f0d9f5; background: transparent; font-size: 10px; }
.app-news-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(3,2,6,.72); }
.app-news-modal[hidden] { display: none; }
.app-news-dialog { position: relative; width: min(560px, 100%); max-height: min(78vh, 640px); overflow: auto; padding: 28px; border: 1px solid rgba(215,68,255,.42); border-radius: 18px; background: #17121d; box-shadow: 0 24px 80px rgba(0,0,0,.58), 0 0 34px rgba(215,68,255,.12); }
.app-news-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--app-line); border-radius: 10px; color: #fff; background: rgba(255,255,255,.035); font-size: 22px; line-height: 1; cursor: pointer; }
.app-news-close:hover { border-color: rgba(215,68,255,.50); background: rgba(215,68,255,.12); }
.app-news-dialog-icon { margin-bottom: 18px; }
.app-news-dialog .eyebrow { margin-bottom: 9px; }
.app-news-dialog h2 { max-width: calc(100% - 34px); margin: 0 0 8px; color: #fff; font-size: clamp(22px, 3vw, 30px); line-height: 1.15; }
.app-news-dialog > time { color: var(--app-muted); font-size: 12px; }
.app-news-dialog > p { margin: 20px 0 0; color: #e0d6e2; font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.app-news-dialog .app-news-image { max-height: 320px; margin-top: 18px; }
body.app-news-modal-open { overflow: hidden; }
.app-empty-state { display: grid; place-items: center; min-height: 180px; padding: 25px; border: 1px dashed rgba(215,68,255,.24); border-radius: 15px; color: var(--app-muted); text-align: center; }
.app-empty-state h3 { margin: 0 0 5px; color: #fff; font-size: 15px; }
.app-empty-state p { margin: 0 0 15px; font-size: 12px; }
.app-filter-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 22px; padding: 12px; border: 1px solid var(--app-line); border-radius: 14px; background: rgba(255,255,255,.025); }
.app-filter-bar input, .app-filter-bar select, .app-settings-card input, .app-settings-card textarea { min-height: 39px; padding: 0 11px; border: 1px solid var(--app-line); border-radius: 9px; outline: none; color: #fff; background: rgba(7,6,10,.72); font-size: 12px; }
.app-filter-bar input { flex: 1 1 220px; }
.app-filter-bar select { flex: 0 1 180px; }
.app-filter-bar input:focus, .app-filter-bar select:focus, .app-settings-card input:focus, .app-settings-card textarea:focus { border-color: rgba(215,68,255,.66); }
.app-filter-submit { min-height: 39px; padding: 0 13px; border: 1px solid rgba(215,68,255,.46); border-radius: 9px; color: #fff; background: rgba(215,68,255,.14); font-size: 11px; font-weight: 800; }
.app-filter-submit:hover { background: rgba(215,68,255,.25); }
.app-list-meta { margin: 0 0 14px; color: var(--app-muted); font-size: 11px; }
.app-notification-list { display: grid; gap: 10px; }
.app-notification-item { position: relative; display: block; padding: 16px 58px 58px 16px; border: 1px solid rgba(215,68,255,.40); border-radius: 14px; background: rgba(215,68,255,.025); }
.app-notification-item.is-unread { border-color: rgba(215,68,255,.48); background: rgba(215,68,255,.10); }
.app-notification-open { display: flex; align-items: flex-start; width: 100%; gap: 12px; padding: 0; border: 0; color: inherit; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.app-notification-open:focus-visible { outline: 2px solid rgba(231,133,255,.82); outline-offset: 5px; border-radius: 8px; }
.app-notification-icon { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px; color: #f5a8ff; background: rgba(215,68,255,.16); }
.app-notification-copy { display: grid; min-width: 0; gap: 4px; }
.app-notification-copy strong { color: #fff; font-size: 13px; }
.app-notification-copy p { margin: 0; color: var(--app-muted); font-size: 11px; line-height: 1.45; }
.app-notification-copy time { color: #72687a; font-size: 10px; }
.app-notification-item:not(.is-unread) .app-notification-icon { color: #b3a8b7; background: rgba(215,68,255,.05); }
.app-notification-delete-form { position: absolute; top: 13px; right: 13px; margin: 0; }
.app-notification-delete { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid rgba(215,68,255,.24); border-radius: 9px; color: #a99aaa; background: rgba(255,255,255,.025); cursor: pointer; }
.app-notification-delete svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.app-notification-delete:hover, .app-notification-delete:focus-visible { border-color: rgba(245,168,199,.58); color: #f5a8c7; background: rgba(245,168,199,.10); outline: none; }
.app-notification-stats { position: absolute; right: 16px; bottom: 14px; min-height: 36px; padding: 0 10px; border: 1px solid rgba(215,68,255,.42); border-radius: 9px; color: #e985ff; background: rgba(215,68,255,.06); font-size: 12px; font-weight: 800; cursor: pointer; }
.app-notification-stats:hover, .app-notification-stats:focus-visible { border-color: rgba(215,68,255,.72); color: #fff; background: rgba(215,68,255,.14); outline: none; }
.app-notification-stats-panel { margin-top: 12px; }

/* News are readable as articles: compact previews, structured paragraphs and a contained image gallery. */
.app-news-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; margin-top: 12px; }
.app-news-gallery.is-single { grid-template-columns: minmax(0, 1fr); }
.app-news-image { width: 100%; height: 220px; max-height: 220px; margin: 0; border: 1px solid rgba(215,68,255,.24); border-radius: 11px; object-fit: contain; background: radial-gradient(circle at 50% 0%, rgba(215,68,255,.09), rgba(7,6,10,.96) 72%); }
.app-news-gallery.is-single .app-news-image { height: 280px; max-height: 280px; }
.app-news-dialog { width: min(720px, 100%); max-height: min(84vh, 760px); }
.app-news-dialog .app-news-gallery { margin-top: 20px; }
.app-news-dialog .app-news-image { height: clamp(180px, 30vh, 300px); max-height: 300px; margin: 0; }
.app-news-body { margin-top: 20px; color: #e0d6e2; font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.app-news-body p { margin: 0; white-space: pre-line; }
.app-news-body p + p { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(215,68,255,.14); }
.app-news-dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 14px; border-top: 1px solid rgba(215,68,255,.16); }
.app-news-collapse { min-height: 40px; padding: 0 12px; border: 1px solid rgba(215,68,255,.42); border-radius: 9px; color: #e985ff; background: rgba(215,68,255,.06); font-size: 12px; font-weight: 800; cursor: pointer; }
.app-news-collapse:hover, .app-news-collapse:focus-visible { border-color: rgba(215,68,255,.72); color: #fff; background: rgba(215,68,255,.14); outline: none; }
.app-news-stats-panel { margin-top: 12px; padding: 12px; border: 1px solid rgba(215,68,255,.28); border-radius: 11px; color: #d9c5e1; background: rgba(215,68,255,.06); }
.app-news-stats-panel[hidden] { display: none; }
.app-news-stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.app-news-stats-grid > div { display: grid; gap: 4px; padding: 9px 7px; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; background: rgba(255,255,255,.03); }
.app-news-stats-grid strong { color: #fff; font-size: 18px; }
.app-news-stats-grid span, .app-news-stats-panel p { color: #bfaec5; font-size: 11px; line-height: 1.45; }
.app-news-stats-panel p { margin: 10px 0 0; }
.app-news-stats-panel p b { color: #fff; }
body.app-news-modal-open .footer, body.app-news-modal-open .app-footer, body.app-news-modal-open .app-bottom-nav, body.app-news-modal-open .admin-mobile-nav { visibility: hidden; }
.app-notification-preview { display: -webkit-box; overflow: hidden; color: var(--app-muted); font-size: 13px; line-height: 1.55; white-space: pre-line; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.app-notification-copy time { display: block; margin-top: 2px; }
.app-notification-copy .app-news-open-hint { display: block; margin-top: 3px; }

.app-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.app-settings-card { padding: 20px; border: 1px solid var(--app-line); border-radius: 15px; background: rgba(255,255,255,.028); }
.app-settings-card.full { grid-column: 1 / -1; }
.app-settings-card h2 { margin: 0 0 5px; color: #fff; font-size: 16px; }
.app-settings-card > p { margin: 0 0 16px; color: var(--app-muted); font-size: 11px; }
.app-settings-card form { display: grid; gap: 11px; }
.app-settings-card label { display: grid; gap: 6px; color: #d8cddc; font-size: 11px; font-weight: 800; }
.app-settings-card input { width: 100%; }
.app-settings-card button { justify-self: start; min-height: 39px; padding: 0 14px; border: 1px solid rgba(215,68,255,.48); border-radius: 9px; color: #fff; background: linear-gradient(135deg,#a42bff,#dc42e8); font-size: 11px; font-weight: 800; }
.app-settings-card button:hover { filter: brightness(1.08); }
.app-toggle-list { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--app-line); border-radius: 11px; }
.app-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; background: rgba(255,255,255,.025); }
.app-toggle-row + .app-toggle-row { border-top: 1px solid var(--app-line-soft); }
.app-toggle-row span { display: grid; gap: 3px; }
.app-toggle-row strong { color: #eee7f0; font-size: 11px; }
.app-toggle-row small { color: var(--app-muted); font-size: 10px; }
.app-toggle-row input { width: 38px; height: 20px; accent-color: var(--app-accent); }
.app-billing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.app-billing-card { padding: 19px; border: 1px solid var(--app-line); border-radius: 15px; background: rgba(255,255,255,.028); }
.app-billing-card.featured { border-color: rgba(215,68,255,.38); background: linear-gradient(145deg, rgba(215,68,255,.12), rgba(255,255,255,.025)); }
.app-billing-card h2 { margin: 0 0 6px; font-size: 16px; }
.app-billing-card strong { display: block; margin: 10px 0; color: #fff; font-size: 30px; letter-spacing: -.06em; }
.app-billing-card strong small { color: var(--app-muted); font-size: 12px; font-weight: 700; letter-spacing: 0; }
.app-billing-card p { margin: 5px 0; color: var(--app-muted); font-size: 11px; }
.app-billing-divider { height: 1px; margin: 16px 0 12px; background: rgba(255,255,255,.16); }
.app-billing-card .button, .app-billing-card form { margin-top: 14px; }
.app-history-list { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--app-line); border-radius: 13px; background: var(--app-line-soft); }
.app-history-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 14px; background: #120f17; }
.app-history-row strong { color: #eee6ef; font-size: 11px; }
.app-history-row span { color: var(--app-muted); font-size: 10px; }
.app-history-row .is-positive { color: #86e6bd; }

@media (max-width: 900px) {
  .app-kpi-grid, .app-project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-project-grid > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 650px) {
  .app-page-head { display: block; margin-bottom: 23px; }
  .app-context-back { min-height: 40px; margin-bottom: 3px; }
  .app-page-head h1 { font-size: 34px; }
  .app-info-title { font-size: 30px; }
  .app-page-actions { margin-top: 15px; }
  .app-kpi-grid, .app-creation-grid, .app-project-grid, .app-settings-grid, .app-billing-grid { grid-template-columns: 1fr; }
  .app-project-grid > :last-child, .app-settings-card.full { grid-column: auto; }
  .app-kpi-card { min-height: 110px; }
  .app-section-head { margin-top: 27px; }
  .app-project-preview { height: 210px; }
  .app-history-row { grid-template-columns: minmax(0, 1fr) auto; }
  .app-history-row span:last-child { grid-column: 1 / -1; }
  .app-create-page { max-width: none !important; }
  .app-create-page .app-page-head { margin-bottom: 22px; }
  .app-create-page .app-page-head h1 { font-size: clamp(30px, 9vw, 38px); }
  .app-create-page .app-page-head p { max-width: 34ch; font-size: 14px; line-height: 1.48; }
  .app-create-page .app-creation-grid { grid-template-columns: 1fr; gap: 12px; }
  .app-create-page .app-creation-card { min-height: 112px; padding: 17px; }
  .app-create-page .app-creation-card small { max-width: none; }
  .app-create-page > .notice { margin-top: 20px !important; }
}

/* Cabinet controls and copy use the same comfortable reading scale as the public page. */
.app-shell { font-size: 15px; }
.app-bell-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-shell .app-nav-item { font-size: 14px; }
.app-shell .app-sidebar-user strong { font-size: 14px; }
.app-shell .app-sidebar-user small { font-size: 12px; }
.app-shell .app-logout { font-size: 13px; }
.app-shell .app-page-head p { font-size: 16px; }
.app-shell .app-kpi-label { font-size: 13px; }
.app-shell .app-kpi-meta { font-size: 12px; }
.app-shell .app-section-head h2 { font-size: 20px; }
.app-shell .app-creation-card strong { font-size: 16px; }
.app-shell .app-creation-card small { font-size: 13px; }
.app-shell .app-project-copy strong { font-size: 15px; }
.app-shell .app-project-copy small { font-size: 12px; }
.app-shell .app-list-meta { font-size: 13px; }
.app-shell .app-notification-copy strong { font-size: 15px; }
.app-shell .app-notification-copy p { font-size: 13px; }
.app-shell .app-settings-card > p { font-size: 13px; }
.app-shell .app-settings-card label { font-size: 13px; }
.app-shell .app-toggle-row strong { font-size: 13px; }
.app-shell .app-toggle-row small { font-size: 12px; }
.app-shell .app-billing-card p { font-size: 13px; }
.app-shell .app-history-row strong { font-size: 13px; }
.app-shell .app-history-row span { font-size: 12px; }

/* The cabinet copy is intentionally two pixels larger for easier reading. */
.app-shell { font-size: 17px; }
.app-shell .app-nav-label { font-size: 13px; }
.app-shell .app-nav-item { font-size: 16px; }
.app-shell .app-nav-badge { font-size: 12px; }
.app-shell .app-sidebar-user strong,
.app-shell .app-user-popover-head strong { font-size: 14px; }
.app-shell .app-sidebar-user small,
.app-shell .app-user-popover-head small { font-size: 12px; }
.app-shell .app-logout { font-size: 15px; }
.app-shell .app-page-head p { font-size: 18px; }
.app-shell .app-kpi-label { font-size: 15px; }
.app-shell .app-kpi-meta { font-size: 14px; }
.app-shell .app-section-head h2 { font-size: 22px; }
.app-shell .app-creation-card strong { font-size: 18px; }
.app-shell .app-creation-card small { font-size: 15px; }
.app-shell .app-project-copy strong { font-size: 17px; }
.app-shell .app-project-copy small { font-size: 14px; }
.app-shell .app-list-meta { font-size: 15px; }
.app-shell .app-notification-copy strong { font-size: 17px; }
.app-shell .app-notification-copy p { font-size: 15px; }
.app-shell .app-settings-card > p { font-size: 15px; }
.app-shell .app-settings-card label { font-size: 15px; }
.app-shell .app-toggle-row strong { font-size: 15px; }
.app-shell .app-toggle-row small { font-size: 14px; }
.app-shell .app-billing-card p { font-size: 15px; }
.app-shell .app-history-row strong { font-size: 15px; }
.app-shell .app-history-row span { font-size: 14px; }
.app-shell .app-user-trigger-copy strong { font-size: 13px; }
.app-shell .app-user-trigger-copy small { font-size: 11px; }
.app-shell .app-popover-head { font-size: 15px; }
.app-shell .app-popover-head a,
.app-shell .app-popover-head button { font-size: 13px; }
.app-shell .app-popover-row strong { font-size: 14px; }
.app-shell .app-popover-row small { font-size: 12px; }
.app-shell .app-popover-empty { font-size: 14px; }
.app-shell .app-popover-footer { font-size: 13px; }
.app-shell .app-user-popover > a,
.app-shell .app-user-popover > form button { font-size: 14px; }
.app-shell .app-create-option strong { font-size: 14px; }

/* Project actions: compact, legible vertical ellipsis instead of a loose text glyph. */
.app-project-menu > summary {
  width: 32px;
  height: 32px;
  border-color: rgba(215,68,255,.24);
  border-radius: 10px;
  color: #eadcf0;
  background: rgba(16,12,22,.8);
  font-family: inherit;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}
.app-project-menu > summary:focus-visible { outline: 2px solid rgba(215,68,255,.72); outline-offset: 2px; }
.app-shell .app-create-option small { font-size: 12px; }
.app-shell .app-footer { font-size: 13px; }

@media (max-width: 760px) {
  .app-shell .app-bottom-nav a { font-size: 11px; }
}

/* Administrators keep their own four-action bar across the site, cabinet,
   and admin panel. It is rendered by the shared shell so navigation does not
   disappear when the administrator leaves /admin. */
.admin-mobile-nav { display: none; }
@media (max-width: 820px) {
  body:has(.admin-mobile-nav) { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .admin-mobile-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 80; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); min-height: 76px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(215,68,255,.28); background: linear-gradient(180deg, rgba(38,19,49,.94), rgba(14,11,20,.99)); box-shadow: 0 -12px 34px rgba(0,0,0,.36), 0 -1px 14px rgba(215,68,255,.1); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .admin-mobile-nav a { display: grid; place-items: center; align-content: center; gap: 5px; min-width: 0; min-height: 58px; padding: 5px 3px; border: 1px solid transparent; border-radius: 12px; color: #a99cad; font-size: 11px; line-height: 1.05; font-weight: 800; text-align: center; text-decoration: none; transition: color .2s ease, border-color .2s ease, background .2s ease; }
  .admin-mobile-nav a:hover { color: #fff; background: rgba(255,255,255,.045); }
  .admin-mobile-nav a.is-active { border-color: rgba(215,68,255,.34); color: #fff; background: rgba(215,68,255,.13); }
  .admin-mobile-nav .admin-mobile-icon-wrap { position: relative; display: grid; place-items: center; width: 36px; height: 36px; color: #bdafd0; border-radius: 10px; background: rgba(255,255,255,.06); }
  .admin-mobile-nav a.is-active .admin-mobile-icon-wrap { color: #fff; background: linear-gradient(135deg, #a72cff, #d744ff); }
  .admin-mobile-nav svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .admin-mobile-nav .admin-mobile-count { position: absolute; top: -6px; right: -7px; display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 4px; border: 2px solid #0d0b12; border-radius: 999px; color: #fff; background: #e04dff; font-size: 10px; line-height: 1; font-weight: 900; }
}
@media (prefers-reduced-motion: reduce) {
  .admin-mobile-nav a { transition: none; }
}

/* Slightly enlarge the account pill while keeping its compact topbar footprint. */
.app-user-trigger {
  min-height: 46px;
  padding: 6px 11px 6px 7px;
}
.app-user-trigger .app-avatar-small {
  flex-basis: 32px;
  width: 32px;
  height: 32px;
}

/* Four clear mobile actions: the profile remains available in the user popover. */
@media (max-width: 760px) {
  body:has(.app-shell) { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .app-bottom-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); min-height: 76px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); border-top-color: rgba(215,68,255,.28); background: linear-gradient(180deg, rgba(38,19,49,.9), rgba(14,11,20,.98)); box-shadow: 0 -12px 34px rgba(0,0,0,.34), 0 -1px 14px rgba(215,68,255,.1), inset 0 1px 0 rgba(215,68,255,.1); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .app-bottom-nav a { min-height: 58px; gap: 5px; border-radius: 12px; font-size: 12px; line-height: 1.05; }
  .app-bottom-icon-wrap { position: relative; display: grid; place-items: center; width: 34px; height: 34px; color: #b8aabe; }
  .app-bottom-icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .app-bottom-nav a.is-active .app-bottom-icon-wrap { color: #e785ff; }
  .app-bottom-nav .app-bottom-create-icon { width: 34px; height: 34px; border-radius: 10px; color: #fff; background: linear-gradient(135deg,#a42bff,#dc42e8); font-size: 25px; line-height: 1; box-shadow: 0 7px 18px rgba(190,43,232,.22); }
  .app-bottom-nav b { top: -4px; right: -6px; min-width: 17px; height: 17px; font-size: 9px; }
  .app-news-item { padding: 13px; }
  .app-notification-item { padding: 13px 54px 56px 13px; }
  .app-notification-delete-form { top: 10px; right: 10px; }
  .app-news-head { display: grid; gap: 3px; }
  .app-news-head time { font-size: 10px; }
  .app-news-preview { font-size: 14px; }
  .app-news-strip form { margin-left: 43px; }
  .app-news-modal { padding: 12px; }
  .app-news-dialog { max-height: min(calc(100dvh - 24px - env(safe-area-inset-bottom)), 760px); padding: 24px 18px calc(34px + env(safe-area-inset-bottom)); border-radius: 16px; }
  .app-news-dialog > p { font-size: 15px; }
}
/* Account deletion is explicit, visually separated and safe on mobile. */
.app-settings-card .app-danger-confirm { display: flex; align-items: flex-start; gap: 10px; color: #d8cddc; font-size: 12px; font-weight: 700; }
.app-settings-card .app-danger-confirm input { flex: 0 0 auto; width: 18px; height: 18px; min-height: 18px; padding: 0; margin: 1px 0 0; accent-color: var(--app-accent); }
.app-danger-card { border-color: rgba(245, 168, 199, .24); background: linear-gradient(145deg, rgba(166, 36, 111, .08), rgba(255, 255, 255, .018)); }
.app-danger-card h2 { color: #ffd8e7; }
.app-danger-card > p { max-width: 720px; }
.app-settings-card .app-danger-button { border-color: rgba(245, 168, 199, .55); color: #fff; background: linear-gradient(135deg, #8d245c, #d04491); }
.app-settings-card .app-danger-button:hover { filter: brightness(1.1); }
.app-settings-card .password-toggle { justify-self: auto; }

@media (max-width: 600px) {
  .app-news-gallery { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .app-news-image, .app-news-gallery.is-single .app-news-image { height: 220px; max-height: 220px; }
  .app-news-dialog .app-news-image { height: 220px; max-height: 220px; }
  .app-news-dialog .app-news-image-tile { aspect-ratio: auto; border: 0; border-radius: 0; background: transparent; }
  .app-news-dialog .app-news-image-tile .app-news-image { height: auto; max-height: none; border: 0; border-radius: 0; object-fit: contain; background: transparent; }
  .app-news-body { font-size: 14px; line-height: 1.65; }
}

/* Give the cabinet brand a little more breathing room above the credit balance. */
.app-sidebar {
  padding-top: 34px;
}
.app-logo-title {
  font-size: 19px;
}
@media (max-width: 1050px) and (min-width: 761px) {
  .app-sidebar { padding-top: 32px; }
  .app-logo-title { font-size: 17px; }
}
@media (max-width: 760px) {
  .app-mobile-brand-stack {
    gap: 7px;
    padding-top: 3px;
  }
  .app-mobile-brand { font-size: 17px; }
}

/* Keep the live credit balance directly under the logo on desktop and mobile. */
.app-sidebar-credit-badge {
  justify-self: start;
  margin: -17px 12px 0;
  min-height: 32px;
}
.app-mobile-brand-stack {
  display: none;
}
@media (max-width: 760px) {
  .app-sidebar-credit-badge { display: none; }
  .app-mobile-brand-stack {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }
  .app-mobile-brand { display: inline-flex; min-width: 0; white-space: nowrap; }
  .app-mobile-credit-badge {
    display: inline-flex;
    width: max-content;
    min-height: 27px;
    padding-inline: 9px;
    font-size: 10px;
  }
  .app-topbar-title { align-items: flex-start; }
}

/* Keep the smallest cabinet copy readable without changing the established hierarchy. */
.app-shell .app-button-secondary,
.app-shell .app-filter-bar input,
.app-shell .app-filter-bar select { font-size: 13px; }
.app-shell .app-notification-copy time,
.app-shell .app-news-head time { font-size: 12px; }
.app-shell .app-news-open-hint { font-size: 12px; }
.app-shell .app-news-strip form button { font-size: 11px; }
.app-shell .app-popover-row small,
.app-shell .app-popover-empty,
.app-shell .app-empty-state p { font-size: 13px; }

/* Cabinet filters and settings keep the same premium dark controls as the creation flow. */
.app-shell .app-filter-bar select,
.app-shell .app-settings-card select { color-scheme: dark; appearance: none; -webkit-appearance: none; padding-right: 38px; border-color: rgba(255,255,255,.14); background-color: #121017; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23e99cff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-position: right 12px center; background-repeat: no-repeat; background-size: 16px; }
.app-shell .app-filter-bar select:hover,
.app-shell .app-settings-card select:hover { border-color: rgba(218,92,255,.48); }
.app-shell .app-filter-bar select:focus,
.app-shell .app-settings-card select:focus { border-color: rgba(218,92,255,.72); box-shadow: 0 0 0 3px rgba(185,75,255,.11), 0 8px 24px rgba(71,18,92,.12); }
.app-shell .app-filter-bar select option,
.app-shell .app-settings-card select option { color: #f3eef7; background: #121017; }
.app-shell .app-filter-bar select:focus,
.app-shell .app-filter-bar select:focus-visible,
.app-shell .app-settings-card select:focus,
.app-shell .app-settings-card select:focus-visible { border-color: rgba(218,92,255,.82) !important; outline: 2px solid rgba(218,92,255,.64) !important; outline-offset: 1px !important; box-shadow: 0 0 0 3px rgba(185,75,255,.14), 0 8px 24px rgba(71,18,92,.12) !important; }
.app-shell .app-filter-bar select option:checked,
.app-shell .app-settings-card select option:checked { color: #fff; background: #5b1d75; }

/* Shared page-heading scale and mobile overflow guardrails. */
.app-shell main,
.app-shell .section,
.app-shell .app-page-head,
.app-shell .app-page-head > div,
.app-shell .app-info-copy,
.app-shell .app-page-actions { min-width: 0; }
.app-shell .app-page-head h1,
.app-shell .app-info-title,
.app-shell .app-page-title {
  font-family: inherit;
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.04;
  letter-spacing: -.06em;
  overflow-wrap: anywhere;
}
.app-shell .app-page-head p,
.app-shell .app-info-copy p { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  body:has(.app-shell) { overflow-x: hidden; }
  .app-shell main { width: 100%; max-width: 100%; }
  .app-shell .app-page-head h1,
  .app-shell .app-info-title,
  .app-shell .app-page-title {
    font-size: clamp(30px, 9vw, 42px);
    line-height: 1.06;
  }
  .app-shell .app-page-actions { align-items: stretch; }
  .app-shell .app-page-actions > *,
  .app-shell .app-page-actions .button,
  .app-shell .app-page-actions button { width: 100%; max-width: 100%; }
  .app-shell img { max-width: 100%; }
}

/* Projects index: keep the cabinet grid bounded, aligned and preview-safe. */
.app-projects-page {
  width: 100%;
  max-width: 1180px !important;
  margin-inline: auto !important;
}
.app-notifications-page {
  box-sizing: border-box;
  width: 100% !important;
  max-width: 1180px !important;
  padding-inline: 0 !important;
  margin-inline: auto !important;
}
.app-notifications-page .app-page-head {
  width: 100%;
  max-width: none;
  margin-bottom: clamp(28px, 3vw, 38px);
}
.app-notifications-page .app-page-head > div:first-child,
.app-notifications-page .app-page-actions,
.app-notifications-page .app-filter-bar,
.app-notifications-page .app-notification-list,
.app-notifications-page .app-notification-item { min-width: 0; }
.app-notifications-page .app-filter-bar {
  width: 100%;
  margin-bottom: clamp(18px, 2vw, 24px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.app-notifications-page .app-notification-list {
  width: 100%;
  gap: 18px;
}
.app-notifications-page .app-notification-item {
  padding: 20px 68px 20px 20px;
  border-radius: 16px;
}
.app-notifications-page .app-notification-meta {
  margin-bottom: 16px;
  font-size: 13px;
}
.app-notifications-page .app-notification-thumb {
  flex-basis: 76px;
  width: 76px;
  height: 76px;
  border-radius: 15px;
}
.app-notifications-page .app-notification-icon {
  flex-basis: 44px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
}
.app-notifications-page .app-notification-copy strong {
  font-size: 18px;
  line-height: 1.28;
}
.app-notifications-page .app-notification-preview {
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.5;
  -webkit-line-clamp: 3;
}
.app-notifications-page .app-notification-actions {
  margin-top: 16px;
  padding-top: 14px;
}
.app-notifications-page .app-notification-open-link { font-size: 14px; }
.app-notifications-page .app-notification-actions .app-notification-stats { font-size: 13px; }

/* Match the projects page measure at every non-phone width. */
@media (max-width: 760px) {
  .app-notifications-page {
    max-width: none !important;
    padding-inline: 0 !important;
  }
  .app-notifications-page .app-page-head { margin-bottom: 20px; }
  .app-notifications-page .app-filter-bar { margin-bottom: 18px; }
  .app-notifications-page .app-notification-list { gap: 14px; }
  .app-notifications-page .app-notification-item { padding: 16px 54px 16px 16px; }
  .app-notifications-page .app-notification-meta { gap: 8px; margin-bottom: 12px; font-size: 11px; }
  .app-notifications-page .app-notification-icon { flex-basis: 30px; width: 30px; height: 30px; border-radius: 9px; }
  .app-notifications-page .app-notification-copy strong { font-size: 20px; }
  .app-notifications-page .app-notification-preview { margin-top: 16px; font-size: 16px; }
  .app-notifications-page .app-notification-actions { margin-top: 16px; padding-top: 12px; }
  .app-notifications-page .app-notification-open-link,
  .app-notifications-page .app-notification-actions .app-notification-stats { font-size: 15px; }
}
.app-projects-page .app-page-head > div:first-child,
.app-projects-page .app-page-actions,
.app-project-grid > *,
.app-project-copy { min-width: 0; }
.app-projects-page .app-page-actions { flex: 0 0 auto; }
.app-project-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}
.app-project-card { min-height: 100%; }
.app-project-preview {
  height: auto;
  min-height: 0;
  aspect-ratio: 16 / 10;
  padding: 10px;
}
.app-project-preview img {
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
}
.app-project-copy strong,
.app-project-copy small {
  white-space: normal;
  overflow-wrap: anywhere;
}
.app-project-copy strong {
  display: -webkit-box;
  min-height: 2.6em;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.app-project-copy small {
  display: -webkit-box;
  min-height: 2.8em;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.app-filter-bar > * { min-width: 0; }

@media (max-width: 1050px) and (min-width: 901px) {
  .app-project-grid { gap: 14px; }
}

@media (max-width: 900px) {
  .app-project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .app-project-grid > :last-child { grid-column: auto; }
}

@media (max-width: 650px) {
  body:has(.app-shell) main { padding-inline: 20px; }
  body:has(.app-shell) .section { padding-top: 24px; padding-bottom: 40px; }
  .app-projects-page { max-width: none !important; }
  .app-projects-page .app-page-head { margin-bottom: 20px; }
  .app-projects-page .app-page-head h1 {
    font-size: clamp(30px, 9vw, 36px);
    line-height: 1.06;
  }
  .app-projects-page .app-page-head p {
    max-width: 34ch;
    font-size: 14px !important;
    line-height: 1.48;
  }
  .app-projects-page .app-page-actions {
    width: 100%;
    margin-top: 14px;
  }
  .app-projects-page .app-page-actions .button {
    width: 100%;
    min-height: 46px;
  }
  .app-projects-page .app-filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 18px;
    padding: 10px;
  }
  .app-projects-page .app-filter-bar input,
  .app-projects-page .app-filter-bar select,
  .app-projects-page .app-filter-submit {
    width: 100%;
    min-width: 0;
  }
  .app-projects-page .app-filter-submit { min-height: 48px; }
  .app-projects-page .app-list-meta {
    margin-bottom: 12px;
    font-size: 14px !important;
  }
  .app-project-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .app-project-preview {
    aspect-ratio: 16 / 10;
    padding: 10px;
  }
  .app-project-copy { gap: 5px; padding: 13px 14px 15px; }
  .app-project-copy strong {
    min-height: 2.6em;
    font-size: 17px !important;
  }
  .app-project-copy small {
    min-height: 2.8em;
    font-size: 14px !important;
  }
}

/* Approved bell placement: inline before the news label on every card. */
.app-news-meta-icon,
.app-notification-meta-icon {
  display: grid;
  flex: 0 0 30px;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(215,68,255,.38);
  border-radius: 9px;
  color: #f5a8ff;
  background: rgba(215,68,255,.16);
}

@media (max-width: 760px) {
  .app-dashboard-page .app-news-main:not(.has-image),
  .app-notifications-page .app-notification-open:not(.has-image) {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

@media (min-width: 761px) {
  .app-dashboard-page .app-news-main:not(.has-image),
  .app-notifications-page .app-notification-open:not(.has-image) {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

/* Account pages: use the available desktop canvas while keeping a readable
   measure and predictable left alignment at tablet and phone widths. */
.app-settings-page,
.app-billing-page {
  box-sizing: border-box;
  width: min(100%, 1320px) !important;
  max-width: 1320px !important;
  margin-inline: auto !important;
  padding-inline: clamp(0px, 1.2vw, 20px);
}
.app-settings-page .app-page-head,
.app-billing-page .app-page-head {
  align-items: flex-start;
  width: 100%;
  max-width: none;
  margin-bottom: clamp(28px, 3vw, 42px);
}
.app-settings-page .app-page-head > div,
.app-billing-page .app-page-head > div {
  min-width: 0;
  max-width: 1040px;
}
.app-settings-page .app-page-head p,
.app-billing-page .app-page-head p {
  max-width: 760px;
  overflow-wrap: anywhere;
}
.app-settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 1.6vw, 26px);
}
.app-settings-card {
  min-width: 0;
  padding: clamp(20px, 2vw, 32px);
  border-radius: 18px;
}
.app-settings-card form {
  width: 100%;
  max-width: 720px;
}
.app-settings-card > p,
.app-settings-card .app-toggle-list,
.app-settings-card .app-danger-confirm {
  max-width: 900px;
}
.app-billing-page .app-kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 1.6vw, 26px);
}
.app-billing-page .app-current-package-grid { grid-template-columns: minmax(0, 1fr); }
.app-billing-page .app-kpi-card {
  min-width: 0;
  min-height: 150px;
  padding: clamp(22px, 2vw, 32px);
  border-radius: 18px;
}
.app-current-package-card { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(0, 2fr); align-items: center; gap: 18px; }
.app-dashboard-page .app-kpi-grid > .app-kpi-card,
.app-dashboard-page .app-creation-card,
.app-billing-page .app-current-package-card,
.app-billing-page .app-billing-card.is-current {
  box-shadow: inset 3px 0 #d744ff;
}
.app-current-package-identity { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 6px; }
.app-current-package-card .app-kpi-value { margin-top: 0; }
.app-current-package-name { color: #fff; background: none; -webkit-text-fill-color: currentColor; }
.app-current-package-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.app-current-package-stats div { min-width: 0; padding: 12px 14px; border: 1px solid rgba(215, 68, 255, .2); border-radius: 12px; background: rgba(255,255,255,.025); }
.app-current-package-stats span { display: block; color: var(--app-muted); font-size: 11px; line-height: 1.3; }
.app-current-package-stats strong { display: block; margin-top: 6px; color: #fff; font-size: 22px; font-weight: 900; letter-spacing: -.04em; line-height: 1; }
.app-billing-page .app-billing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 1.6vw, 26px);
}
.app-billing-page .app-billing-card {
  position: relative;
  min-width: 0;
  min-height: 100%;
  padding: clamp(20px, 2vw, 30px);
  border-radius: 18px;
}
.app-billing-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.app-billing-card-head h2 { min-width: 0; }
.app-tariff-card-head h2 { background: linear-gradient(110deg, #f05cff 0%, #d52bc6 52%, #8c2de2 100%); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.app-tariff-credits b { color: #fff; font-size: 14px; font-weight: 900; }
.app-credit-package-card { border-color: rgba(215, 68, 255, .28); }
.app-credit-package-card-head h2 { background: linear-gradient(110deg, #f05cff 0%, #d52bc6 52%, #8c2de2 100%); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.app-credit-package-credits b { color: #fff; font-size: 14px; font-weight: 900; }
.app-billing-page .app-tariff-card { border-color: rgba(215, 68, 255, .28); }
.app-billing-card.is-current {
  border-color: rgba(232, 105, 255, .72);
  background: linear-gradient(145deg, rgba(215, 68, 255, .18), rgba(255, 255, 255, .035));
  box-shadow: 0 0 0 1px rgba(215, 68, 255, .28), 0 16px 42px rgba(142, 42, 190, .18);
}
.app-billing-current-badge {
  flex: 0 0 auto;
  margin-top: -2px;
  padding: 5px 9px;
  border: 1px solid rgba(232, 105, 255, .72);
  border-radius: 999px;
  color: #f4b7ff;
  background: rgba(215, 68, 255, .14);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.2;
  white-space: nowrap;
}
.app-tariff-lifetime { color: #d9a5e8 !important; font-weight: 700; }
.app-billing-plan-note {
  max-width: 980px;
  margin-top: clamp(18px, 2vw, 26px);
  padding: 16px 18px;
  border: 1px solid rgba(215, 68, 255, .24);
  border-radius: 14px;
  background: rgba(215, 68, 255, .055);
}
.app-billing-plan-note p { display: flex; gap: 10px; margin: 0; color: var(--app-muted); line-height: 1.55; }
.app-billing-plan-note p + p { margin-top: 8px; }
.app-billing-plan-note p::before { flex: 0 0 auto; content: '◆'; color: #e69bff; font-size: 11px; line-height: 1.55; }
.app-billing-extra-note { margin-top: clamp(18px, 2vw, 26px); }
.app-billing-page .app-billing-card p {
  overflow-wrap: anywhere;
}
.app-billing-page > .notice {
  max-width: none;
  margin-top: clamp(24px, 3vw, 38px);
}
.app-billing-page .app-history-list {
  width: 100%;
}
.app-history-row strong,
.app-history-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) and (min-width: 761px) {
  .app-settings-page,
  .app-billing-page {
    padding-inline: 0;
  }
  .app-billing-page .app-billing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) and (min-width: 761px) {
  .app-settings-page .app-settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-settings-page,
  .app-billing-page,
  .app-plans-page {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
    padding-inline: 0 !important;
  }
  .app-settings-page .app-settings-grid,
  .app-billing-page .app-kpi-grid,
  .app-billing-page .app-billing-grid {
    grid-template-columns: 1fr;
  }
  .app-settings-page .app-page-head,
  .app-billing-page .app-page-head {
    margin-bottom: 24px;
  }
  .app-settings-page .app-page-head p,
  .app-billing-page .app-page-head p {
    max-width: 42ch;
    font-size: 15px;
    line-height: 1.5;
  }
  .app-settings-card,
  .app-billing-page .app-billing-card,
  .app-billing-page .app-kpi-card {
    padding: 18px 16px;
    border-radius: 15px;
  }
  .app-billing-page .app-kpi-card {
    min-height: 116px;
  }
  .app-billing-page .app-history-list {
    border-radius: 12px;
  }
  .app-billing-page .app-history-row {
    gap: 8px;
    padding: 12px;
  }
  .app-current-package-card { grid-template-columns: 1fr; gap: 12px; }
  .app-current-package-identity { gap: 4px; }
  .app-current-package-card .app-kpi-value { margin-top: 8px; }
  .app-current-package-stats { gap: 8px; }
  .app-current-package-stats div { padding: 10px; }
  .app-current-package-stats strong { font-size: 19px; }
  .app-billing-card-head { align-items: center; }
  .app-billing-current-badge { font-size: 9px; }
}

@media (max-width: 420px) {
  .app-billing-page .app-billing-card,
  .app-billing-page .app-kpi-card { padding-inline: 14px; }
  .app-current-package-stats { gap: 6px; }
  .app-current-package-stats div { padding: 9px 8px; }
  .app-current-package-stats span { font-size: 10px; overflow-wrap: anywhere; }
}

@media (max-width: 360px) {
  .app-current-package-stats { grid-template-columns: 1fr; }
  .app-current-package-stats div { padding: 10px 12px; }
}

/* Billing help action sits directly below the page title on every viewport. */
.app-billing-page > .app-page-actions {
  align-items: flex-start;
  justify-content: flex-start;
  margin: 0 0 clamp(18px, 2vw, 26px);
}
.app-billing-page > .app-page-actions .button {
  width: auto;
  max-width: 100%;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .app-billing-page > .app-page-actions { margin-bottom: 20px; }
  .app-billing-page > .app-page-actions .button { width: auto; max-width: 100%; }
}
@media (max-width: 360px) {
  .app-billing-page > .app-page-actions .button { white-space: normal; text-align: center; }
}

/* Authenticated cabinet header: rounded on desktop, compact and square on mobile. */
@media (min-width: 761px) {
  .app-topbar {
    width: min(var(--max), calc(100% - 40px));
    min-height: 74px;
    margin: 20px auto 0;
    padding: 13px 22px;
    border: 1px solid rgba(229, 24, 216, .48);
    border-radius: 48px;
    background: rgba(18, 17, 21, .94);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .38), 0 0 34px rgba(229, 24, 216, .09);
  }
}
@media (max-width: 760px) {
  .app-topbar {
    width: 100%;
    margin: 0;
    border-radius: 16px;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 12px;
  }
  /* Keep the full-width cabinet header and the same 20px content gutter on
     the profile, billing/plans, and support surfaces. */
  body:has(.app-shell) .app-topbar,
  body:has(.app-settings-page) .app-topbar,
  body:has(.app-billing-page) .app-topbar,
  body:has(.app-plans-page) .app-topbar,
  body:has(.support-page) .app-topbar {
    width: 100% !important;
    min-height: 62px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border-radius: 16px !important;
  }
  body:has(.app-settings-page) main,
  body:has(.app-billing-page) main,
  body:has(.app-plans-page) main,
  body:has(.support-page) main {
    padding-inline: 20px !important;
  }
  body:has(.support-page) .support-page {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
    padding-inline: 0 !important;
    padding-top: 28px !important;
  }
  body:has(.support-page) .support-page-head {
    margin-bottom: 20px !important;
  }
  /* Keep the mobile cabinet edge contract explicit: content starts 20px from
     the viewport, including the billing/plans surfaces and avatar popover. */
  body:has(.app-shell) main { padding-inline: 20px !important; }
  .app-user-popover { padding: 10px; }
  .app-user-popover-head { padding-inline: 12px; }
  .app-user-popover > a,
  .app-user-popover > form button {
    width: 100% !important;
    padding-inline: 12px;
  }
  .app-user-popover > form button { display: flex !important; }
  .app-mobile-credit-badge { display: none !important; }
  .app-mobile-menu-toggle {
    display: flex;
    flex: 0 0 36px;
    margin: 0;
  }
  .app-topbar-title {
    display: flex;
    flex: 0 1 auto;
    min-width: 0;
    margin: 0 auto 0 0;
    justify-content: flex-start;
  }
  .app-mobile-brand-stack {
    display: flex;
    align-items: center;
    gap: 0;
    min-width: 0;
    margin: 0;
    padding: 0;
  }
  .app-mobile-brand { margin: 0; padding: 0; }
}

/* Some mobile browsers report a tablet-sized CSS viewport. Keep the
   authenticated cabinet header identical there as well. */
@media (max-width: 1050px) and (min-width: 761px) {
  .app-shell .app-topbar {
    width: 100% !important;
    min-height: 62px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border-radius: 16px !important;
  }
}

/* Settings page: compact account cards use the site's existing Manrope UI font. */
.app-settings-page .app-page-back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 27px; color: #e785ff; font-family: inherit; font-size: 12px; font-weight: 800; text-transform: none; }
.app-settings-page .app-page-head .eyebrow:not(.app-page-back-link) { margin-bottom: 8px; }
.app-settings-page .app-page-head h1 { margin-bottom: 8px; }
.app-settings-page .app-page-head p { margin-top: 0; }
.app-settings-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.app-settings-card-icon { display: grid; flex: 0 0 36px; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(215,68,255,.42); border-radius: 11px; color: #eaa2ff; background: linear-gradient(145deg, rgba(215,68,255,.27), rgba(215,68,255,.08)); }
.app-settings-card-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.app-settings-card-head h2 { margin: 0; font-family: inherit; font-size: 17px; line-height: 1.15; }
.app-settings-card-head p { margin: 3px 0 0; color: var(--app-muted); font-size: 11px; line-height: 1.3; }
.app-settings-card form { gap: 12px; }
.app-settings-card label { gap: 6px; font-family: inherit; }
.app-settings-card input:not([type="checkbox"]) { box-sizing: border-box; min-height: 44px; border-radius: 11px; font-family: inherit; }
.app-settings-page .app-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.app-settings-page .app-toggle-row input[type="checkbox"] { flex: 0 0 auto; width: 20px; height: 20px; min-height: 20px; padding: 0; border-radius: 6px; }
.app-settings-card button { min-height: 44px; padding-inline: 16px; border-radius: 11px; font-family: inherit; }
.app-settings-card form > button { width: 100%; margin-top: 1px; }
.app-settings-hint { color: var(--app-muted); font-size: 11px; line-height: 1.4; }
.app-settings-subscription-note { margin: 12px 0 0; color: var(--app-muted); font-size: 11px; line-height: 1.4; }
.app-settings-page .app-toggle-list { border-color: rgba(215,68,255,.52); border-radius: 13px; background: rgba(215,68,255,.05); }
.app-settings-page .app-toggle-row { min-height: 59px; box-sizing: border-box; padding: 11px 12px; border-color: rgba(215,68,255,.22); background: rgba(215,68,255,.07); }
.app-settings-page .app-toggle-row strong { font-family: inherit; font-size: 12px; }
.app-settings-page .app-toggle-row small { font-family: inherit; font-size: 10px; }

/* Profile and newsletter share one outlined account surface; generation status is not a profile setting. */
.app-settings-page .app-settings-profile-card,
.app-settings-page .app-settings-security-card { border-color: rgba(215,68,255,.30); box-shadow: 0 0 0 1px rgba(215,68,255,.05); }
.app-settings-page .app-settings-card form > label { color: #dca1ee; }
.app-settings-page .app-settings-card input:not([type="checkbox"]) { border-color: rgba(215,68,255,.34); }
.app-settings-page .app-settings-card input:not([type="checkbox"])::placeholder { color: #8e8793; font-size: 11px; opacity: 1; }
.app-settings-page .app-settings-profile-newsletter { margin-top: 4px; padding: 14px; border: 1px solid rgba(215,68,255,.30); border-radius: 14px; background: rgba(215,68,255,.045); }
.app-settings-profile-newsletter-head { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.app-settings-profile-newsletter-head .app-settings-card-icon { flex-basis: 30px; width: 30px; height: 30px; border-radius: 9px; }
.app-settings-profile-newsletter-head .app-settings-card-icon svg { width: 16px; height: 16px; }
.app-settings-profile-newsletter-head h3 { margin: 0; color: #eaa2ff; font-family: inherit; font-size: 13px; line-height: 1.2; }
.app-settings-profile-newsletter-head p { margin: 3px 0 0; color: var(--app-muted); font-size: 10px; line-height: 1.3; }
.app-settings-profile-newsletter .app-toggle-row { min-height: 48px; padding: 10px 0 0; border-top: 1px solid rgba(215,68,255,.18); background: transparent; }
.app-settings-profile-newsletter .app-toggle-row strong { color: #f0c0ff; font-size: 12px; }
.app-settings-profile-newsletter .app-toggle-row small { color: #8e8793; font-size: 10px; }
.app-settings-profile-newsletter .app-settings-subscription-note { margin-top: 8px; color: #dca1ee; }

@media (max-width: 760px) {
  .app-settings-page { width: 100% !important; max-width: 430px !important; margin: 18px auto 24px !important; padding: 27px 20px 32px !important; border: 1px solid rgba(255,255,255,.12); border-radius: 24px; background: linear-gradient(180deg, rgba(17,13,23,.86), rgba(11,9,15,.92)); box-sizing: border-box; }
  .app-settings-page .app-page-head { margin-bottom: 22px; }
  .app-settings-page .app-page-back-link { margin-bottom: 28px; font-size: 12px; }
  .app-settings-page .app-page-head h1 { font-size: 32px; }
  .app-settings-page .app-page-head p { max-width: 31ch; font-size: 13px; line-height: 1.4; }
  .app-settings-page .app-settings-grid { gap: 12px; }
  .app-settings-page .app-settings-card { padding: 16px; border-radius: 16px; }
  .app-settings-card-head { gap: 11px; margin-bottom: 17px; }
  .app-settings-card-icon { flex-basis: 36px; width: 36px; height: 36px; }
  .app-settings-card-head h2 { font-size: 17px; }
  .app-settings-card form { gap: 11px; }
  .app-settings-card label { font-size: 11px; }
  .app-settings-card input { min-height: 44px; font-size: 13px; }
  .app-settings-card button { font-size: 12px; }
  .app-settings-subscription-note { margin-top: 12px; }
}

/* Mobile settings surface: the cards own the frame, the page stays open and airy. */
@media (max-width: 760px) {
  .app-settings-page {
    width: 100% !important;
    max-width: 430px !important;
    margin: 18px auto 24px !important;
    padding: 27px 0 32px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-sizing: border-box;
  }

  .app-settings-page .app-settings-card {
    position: relative;
    overflow: visible;
    padding: 16px;
    border: 1px solid transparent;
    border-radius: 16px;
    background:
      linear-gradient(180deg, rgba(23,17,30,.94), rgba(17,12,24,.97)) padding-box,
      linear-gradient(135deg, rgba(215,68,255,.56), rgba(215,68,255,.20) 50%, rgba(229,24,216,.46)) border-box;
  }

  .app-settings-page .app-settings-card::before,
  .app-settings-page .app-settings-card::after {
    content: "";
    position: absolute;
    z-index: 0;
    width: 62px;
    height: 72px;
    pointer-events: none;
    filter: blur(24px);
    opacity: .22;
    border-radius: 50%;
    background: rgba(215,68,255,.55);
  }

  .app-settings-page .app-settings-card::before { top: -18px; left: -18px; }
  .app-settings-page .app-settings-card::after { right: -18px; bottom: -18px; background: rgba(229,24,216,.48); }
  .app-settings-page .app-settings-card > * { position: relative; z-index: 1; }

  .app-settings-page .app-toggle-row input[type="checkbox"] {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    padding: 0;
  }
}

/* Desktop settings layout follows the approved two-column account reference. */
@media (min-width: 761px) {
  .app-settings-page {
    width: min(100%, 1040px) !important;
    max-width: 1040px !important;
    padding-inline: 0;
  }

  .app-settings-page .app-page-head { margin-bottom: 34px; }
  .app-settings-page .app-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
  }
  .app-settings-page .app-settings-card { padding: 26px; border-radius: 18px; }
  .app-settings-page .app-danger-card { grid-column: 1 / -1; }
}

/* Client cabinet desktop header: keep the section title on the left. */
@media (min-width: 761px) {
  .app-shell-user .app-topbar { justify-content: flex-start; }
  .app-shell-user .app-topbar-title { margin-right: auto; }
}

/* News cards: image counts sit below the image, while compact copy stays to one sentence. */
.app-news-visual,
.app-notification-visual {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 7px;
  min-width: 0;
}
.app-news-visual { width: 100%; }
.app-news-visual .app-news-image-count,
.app-notification-visual .app-notification-image-count {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  max-width: 100%;
  overflow: hidden;
  padding: 5px 9px;
  border: 1px solid rgba(215,68,255,.38);
  border-radius: 999px;
  color: #e985ff;
  background: rgba(215,68,255,.10);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-dashboard-page .app-news-copy > strong,
.app-notification-copy > strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}
.app-dashboard-page .app-news-preview,
.app-notification-preview {
  -webkit-line-clamp: 1;
}
.app-notification-visual {
  flex: 0 0 76px;
  width: 76px;
}
.app-notification-visual .app-notification-thumb {
  display: block;
  width: 76px;
  height: 76px;
}

@media (max-width: 760px) {
  .app-notification-visual { flex-basis: 76px; width: 76px; }
  .app-notification-visual .app-notification-image-count { font-size: 9px; padding-inline: 7px; }
}

/* Desktop all-news cards mirror the cabinet's image-led news presentation. */
@media (min-width: 761px) {
  .app-notifications-page .app-notification-item {
    padding: 24px 68px 24px 24px;
    border-radius: 18px;
  }

  .app-notifications-page .app-notification-meta {
    margin-bottom: 16px;
    font-size: 12px;
  }

  .app-notifications-page .app-notification-open {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    align-items: start;
    gap: 20px;
  }

  .app-notifications-page .app-notification-visual {
    flex: 0 0 132px;
    width: 132px;
    justify-items: center;
  }

  .app-notifications-page .app-notification-thumb {
    width: 132px;
    height: 140px;
    border-radius: 15px;
  }

  .app-notifications-page .app-notification-copy {
    display: grid;
    align-content: start;
    gap: 9px;
    min-width: 0;
  }

  .app-notifications-page .app-notification-copy strong {
    font-size: 20px;
    line-height: 1.28;
  }

  .app-notifications-page .app-notification-preview {
    margin-top: 16px;
    font-size: 15px;
    line-height: 1.5;
    -webkit-line-clamp: 3;
  }

  .app-notifications-page .app-notification-actions {
    margin-top: 16px;
    padding-top: 14px;
  }

  .app-notifications-page .app-notification-open-link {
    font-size: 14px;
  }

  .app-notifications-page .app-notification-actions .app-notification-stats {
    font-size: 13px;
  }
}

/* All-news copy follows the cabinet: title, preview and open action stay together. */
@media (min-width: 761px) {
  .app-notifications-page .app-notification-open {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
  }

  .app-notifications-page .app-notification-open:not(.has-image) {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
  }

  .app-notifications-page .app-notification-open.has-image {
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 20px;
  }

  .app-notifications-page .app-notification-open.has-image .app-notification-visual {
    flex: 0 0 132px;
    width: 132px;
    justify-items: center;
  }

  .app-notifications-page .app-notification-open.has-image .app-notification-thumb {
    width: 132px;
    height: 140px;
    border-radius: 15px;
  }

  .app-notifications-page .app-notification-copy {
    display: grid;
    align-content: start;
    gap: 9px;
    min-width: 0;
  }

  .app-notifications-page .app-notification-copy .app-notification-meta {
    margin: 0;
    font-size: 12px;
  }

  .app-notifications-page .app-notification-copy strong {
    font-size: 20px;
    line-height: 1.28;
  }

  .app-notifications-page .app-notification-copy .app-notification-preview {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    -webkit-line-clamp: 3;
  }

  .app-notifications-page .app-notification-copy .app-notification-open-link {
    display: block;
    width: fit-content;
    min-height: 0;
    margin-top: 1px;
    font-size: 14px;
  }
}

@media (max-width: 760px) {
  .app-notifications-page .app-notification-open.has-image {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
  }

  .app-notifications-page .app-notification-open.has-image .app-notification-copy {
    display: grid;
    grid-column: 2;
    grid-row: 1;
    align-content: start;
    gap: 5px;
    min-width: 0;
  }

  .app-notifications-page .app-notification-open.has-image .app-notification-meta {
    grid-column: auto;
    grid-row: auto;
    margin: 0;
  }

  .app-notifications-page .app-notification-open.has-image .app-notification-visual {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    flex-basis: 92px;
    width: 92px;
  }

  .app-notifications-page .app-notification-open.has-image .app-notification-copy > strong {
    grid-column: auto;
    grid-row: auto;
    font-size: 18px;
    -webkit-line-clamp: 1;
  }

  .app-notifications-page .app-notification-open.has-image .app-notification-copy > .app-notification-preview {
    grid-column: auto;
    grid-row: auto;
    font-size: 15px;
    margin-top: 0;
    -webkit-line-clamp: 1;
  }

  .app-notifications-page .app-notification-open.has-image .app-notification-copy > .app-notification-open-link {
    grid-column: auto;
    grid-row: auto;
    min-height: 0;
    margin-top: 1px;
    font-size: 15px;
  }

  .app-notifications-page .app-notification-open:not(.has-image) {
    display: block;
  }

  .app-notifications-page .app-notification-open:not(.has-image) .app-notification-copy {
    display: grid;
    gap: 5px;
    min-width: 0;
  }

  .app-notifications-page .app-notification-open:not(.has-image) .app-notification-meta {
    margin: 0;
  }

  .app-notifications-page .app-notification-open:not(.has-image) .app-notification-copy strong,
  .app-notifications-page .app-notification-open:not(.has-image) .app-notification-preview {
    -webkit-line-clamp: 1;
  }
}

@media (max-width: 380px) {
  .app-notifications-page .app-notification-open.has-image {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
  }

  .app-notifications-page .app-notification-open.has-image .app-notification-visual {
    flex-basis: 76px;
    width: 76px;
  }

  .app-notifications-page .app-notification-open.has-image .app-notification-thumb {
    width: 76px;
    height: 82px;
  }

  .app-notifications-page .app-notification-open.has-image .app-notification-copy > strong {
    font-size: 17px;
  }
}

/* Expanded news media: standalone images on the dialog background at desktop sizes. */
@media (min-width: 761px) {
  .app-news-dialog {
    width: min(900px, calc(100vw - 96px));
    max-height: min(88vh, 840px);
  }

  .app-news-dialog .app-news-image-tile {
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .app-news-dialog .app-news-gallery {
    gap: 18px;
  }

  .app-news-dialog .app-news-image {
    height: clamp(240px, 34vh, 360px);
    max-height: none;
    border: 0;
    border-radius: 0;
    background: transparent;
    object-fit: contain;
  }

  .app-news-dialog .app-news-gallery.is-single .app-news-image {
    height: clamp(300px, 48vh, 520px);
    max-height: none;
  }
}

@media (min-width: 1400px) {
  .app-news-dialog {
    width: min(1040px, calc(100vw - 120px));
    max-height: min(90vh, 900px);
  }

  .app-news-dialog .app-news-gallery {
    gap: 24px;
  }

  .app-news-dialog .app-news-image {
    height: clamp(280px, 40vh, 460px);
  }

  .app-news-dialog .app-news-gallery.is-single .app-news-image {
    height: clamp(360px, 54vh, 620px);
  }
}

/* Keep the expanded article compact: a closer dialog and tighter image spacing. */
@media (min-width: 761px) {
  .app-news-dialog {
    width: min(820px, calc(100vw - 112px));
  }

  .app-news-dialog .app-news-gallery {
    gap: 12px;
  }
}

@media (min-width: 1400px) {
  .app-news-dialog {
    width: min(940px, calc(100vw - 144px));
  }

  .app-news-dialog .app-news-gallery {
    gap: 16px;
  }
}

/* News modal gallery: one focused image with accessible previous/next controls. */
.app-news-gallery[data-news-gallery] {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 8px;
  width: 100%;
}
.app-news-gallery[data-news-gallery] .app-news-gallery-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}
.app-news-gallery[data-news-gallery] .app-news-image-tile {
  display: flex;
  flex: 0 1 auto;
  width: auto;
  max-width: calc((100% - 20px) / 2);
  min-width: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.app-news-gallery[data-news-gallery] .app-news-image {
  display: block;
  width: auto;
  height: clamp(300px, 40vh, 460px);
  max-width: 100%;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
}
.app-news-gallery[data-news-gallery] .app-news-gallery-arrow {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0 0 3px;
  border: 1px solid rgba(215,68,255,.44);
  border-radius: 50%;
  color: #fff;
  background: rgba(45,27,53,.86);
  font-size: 29px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.app-news-gallery[data-news-gallery] .app-news-gallery-arrow:hover,
.app-news-gallery[data-news-gallery] .app-news-gallery-arrow:focus-visible {
  border-color: rgba(235,142,255,.9);
  background: rgba(105,42,119,.9);
  outline: none;
  transform: scale(1.04);
}
.app-news-gallery[data-news-gallery] .app-news-gallery-prev { grid-column: 1; grid-row: 1; justify-self: center; }
.app-news-gallery[data-news-gallery] .app-news-gallery-next { grid-column: 3; grid-row: 1; justify-self: center; }
.app-news-gallery[data-news-gallery] .app-news-gallery-counter {
  grid-column: 2;
  grid-row: 2;
  color: #b9a9c0;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
}
.app-news-gallery[data-news-gallery] [data-news-gallery-slide][hidden] { display: none; }

@media (min-width: 761px) {
  .app-news-dialog h2 {
    font-size: clamp(21px, 2.1vw, 28px);
  }
  .app-news-dialog .app-news-gallery[data-news-gallery] {
    margin-top: 18px;
  }
}

@media (max-width: 760px) {
  .app-news-gallery[data-news-gallery] {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    column-gap: 6px;
  }
  .app-news-gallery[data-news-gallery] .app-news-gallery-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    gap: 0;
  }
  .app-news-gallery[data-news-gallery] .app-news-image-tile { display: block; width: 100%; max-width: none; }
  .app-news-gallery[data-news-gallery] .app-news-image { width: 100%; height: auto; max-width: 100%; max-height: min(62dvh, 520px); }
  .app-news-gallery[data-news-gallery] .app-news-gallery-arrow {
    width: 38px;
    height: 38px;
    font-size: 26px;
  }
  .app-news-dialog h2 { font-size: 22px; }
  .app-news-dialog .app-news-image-tile .app-news-image {
    height: auto;
    max-height: min(62dvh, 520px);
  }
}

@media (max-width: 760px) {
  /* A news item without media must not reserve an empty icon/media column. */
  .app-dashboard-page .app-news-main:not(.has-image),
  .app-notifications-page .app-notification-open:not(.has-image) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

@media (max-width: 760px) {
  /* Keep the image-count badge readable when it sits below a narrow mobile thumbnail. */
  .app-dashboard-page .app-news-image-count,
  .app-notifications-page .app-notification-image-count {
    width: max-content;
    max-width: calc(100vw - 40px);
    padding-inline: 10px;
    box-sizing: border-box;
  }

  /* The two notification tabs keep their own outlines; remove the surrounding frame. */
  .app-notifications-page .app-filter-bar {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
}

/* Keep legacy admin pages aligned with the client's mobile shell. */
@media (max-width: 760px) {
  body:has(.master-wrap.master-create-flow.master-admin-flow) .topbar,
  body:has(.app-create-page) .topbar,
  body:has(.app-projects-page) .topbar,
  body:has(.app-notifications-page) .topbar,
  body:has(.text-image-page) .topbar,
  body:has(.video-admin-page) .topbar,
  body:has(.project-page) .topbar {
    width: 100%;
    min-height: 62px;
    margin: 0;
    padding: 0 12px;
    border-radius: 16px;
  }

  /* Legacy admin pages still need the same 20px content gutter as the app shell. */
  body:has(.app-create-page) main,
  body:has(.app-projects-page) main,
  body:has(.app-notifications-page) main {
    padding-inline: 20px;
  }
}

/* Keep the all-news timestamp compact on phones. The shared typography token
   has a stronger selector, so this scoped rule must win the cascade. */
@media (max-width: 760px) {
  body.app-authenticated-page .app-notifications-page .app-notification-meta time {
    flex: 0 0 auto;
    color: #a99bac;
    font-size: var(--font-size-news-meta-mobile) !important;
    line-height: 1.2;
    white-space: nowrap;
  }
}

/* Keep the notification delete control in the lower-right corner. */
.app-notifications-page .app-notification-delete-form {
  top: auto;
  right: 13px;
  bottom: 14px;
}
.app-notifications-page .app-notification-stats {
  right: 60px;
  bottom: 14px;
}
@media (max-width: 760px) {
  .app-notifications-page .app-notification-delete {
    width: 36px;
    height: 36px;
  }
}

@media (min-width: 761px) {
  .app-notifications-page .app-notification-delete-form {
    top: 13px;
    right: 13px;
    bottom: auto;
  }
}

/* Shared project breadcrumbs used by product, advertising, text-image and
 * video flows. Keep the current branch-specific content untouched. */
.app-project-breadcrumb {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 8px;
  color: #9f96a8;
  font-size: 13px;
  line-height: 1.3;
}
.app-project-breadcrumb a {
  color: #e982ff;
  text-decoration: none;
}
.app-project-breadcrumb a:hover { color: #ffd5ff; }
.app-project-breadcrumb > span { color: #6f6175; }
.app-project-breadcrumb strong {
  min-width: 0;
  overflow: hidden;
  color: #f5eef7;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .app-project-breadcrumb {
    gap: 4px;
    font-size: 10px;
    line-height: 1.25;
  }
  .ad-editor-topbar .app-project-breadcrumb { overflow: hidden; }
  .ad-editor-topbar .app-project-breadcrumb > * { min-width: 0; }
}
