:root {
  --bg: #07111b;
  --bg-elev: #0b1724;
  --surface: #0f1d2d;
  --surface-2: #13263a;
  --surface-3: #182d44;
  --line: #24384f;
  --line-strong: #33506c;
  --text: #eef6ff;
  --muted: #95abc4;
  --primary: #19c37d;
  --primary-2: #2596ff;
  --shadow: 0 22px 48px rgba(0, 0, 0, 0.36);
  --danger-bg: #3a171d;
  --danger-line: #6f2934;
  --danger-text: #ffb8b2;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  background:
    radial-gradient(circle at 15% 0%, rgba(25, 195, 125, 0.14), transparent 30%),
    radial-gradient(circle at 90% 0%, rgba(37, 150, 255, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(10, 21, 33, 0.98), rgba(7, 17, 27, 1)),
    var(--bg);
  background-attachment: fixed;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
}

body.auth-only #app-shell,
body.auth-only .filters-wrap,
body.auth-only .search-panel,
body.auth-only .more-wrap,
body.auth-only #gallery {
  display: none !important;
}

body.auth-only .container {
  min-height: 100vh;
}

body.app-ready #auth-screen {
  display: none !important;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  display: block;
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.34));
  flex: 0 0 auto;
}

.brand-title {
  color: #ffffff;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
}

.container {
  padding: 20px;
}

.ghost-btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-screen {
  min-height: calc(100vh - 40px);
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) minmax(360px, 440px);
  gap: 28px;
  align-items: center;
}

.auth-hero {
  padding: 42px;
  border-radius: 30px;
  color: #f8fbff;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 30%),
    linear-gradient(145deg, #08131f, #10324a 54%, #0d6b67);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.28);
}

.auth-kicker {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.auth-hero h2 {
  margin: 18px 0 14px;
  font-size: 42px;
  line-height: 0.98;
}

.auth-hero p {
  margin: 0;
  color: rgba(248, 251, 255, 0.82);
  font-size: 17px;
  max-width: 42ch;
}

.auth-points {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.auth-point {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-point strong {
  font-size: 15px;
}

.auth-point span {
  color: rgba(248, 251, 255, 0.76);
  font-size: 14px;
  line-height: 1.45;
}

.auth-card {
  padding: 26px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(15, 29, 45, 0.98), rgba(11, 23, 36, 0.95));
  border: 1px solid rgba(36, 56, 79, 0.92);
  box-shadow: 0 26px 56px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
}

.auth-card-head {
  display: grid;
  gap: 16px;
}

.auth-eyebrow {
  color: var(--primary-2);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.auth-card h3 {
  margin: 8px 0 0;
  font-size: 30px;
}

.auth-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-tab {
  min-height: 46px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
}

.auth-tab.active {
  background: linear-gradient(110deg, var(--primary), var(--primary-2));
  color: #fff;
  border-color: transparent;
}

.auth-panels {
  margin-top: 20px;
}

.auth-panel {
  padding: 18px;
  border-radius: 22px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-field {
  display: grid;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
}

.auth-field span {
  font-weight: 700;
}

.auth-field input {
  min-height: 48px;
  border-radius: 14px;
}

.auth-submit {
  min-height: 48px;
  margin-top: 4px;
}

.auth-link {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--primary-2);
  font-weight: 700;
  text-align: left;
  box-shadow: none;
}

.page-head {
  margin-bottom: 22px;
  padding: 22px 24px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(15, 29, 45, 0.94), rgba(11, 23, 36, 0.92));
  border: 1px solid var(--line);
}

.page-head h1 {
  margin: 8px 0 10px;
  font-size: 34px;
}

.page-head p {
  margin: 0;
  max-width: 72ch;
  color: var(--muted);
  line-height: 1.5;
}

.mobile-nav-bar,
.mobile-nav-backdrop,
.filters-toggle {
  display: none;
}

.mobile-nav-bar {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(15, 29, 45, 0.96), rgba(8, 19, 31, 0.94));
  border: 1px solid rgba(36, 56, 79, 0.92);
  box-shadow: var(--shadow);
}

.mobile-nav-brand {
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.mobile-nav-brand .brand-title {
  font-size: 20px;
}

.mobile-nav-toggle {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(19, 38, 58, 0.86);
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
}

.mobile-nav-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
  margin: 0 auto;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.app-shell-layout.sidebar-open .mobile-nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.app-shell-layout.sidebar-open .mobile-nav-toggle span:nth-child(2) {
  opacity: 0;
}

.app-shell-layout.sidebar-open .mobile-nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.favorite-btn {
  position: absolute;
  top: 10px;
  right: 46px;
  z-index: 3;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(6, 12, 18, 0.82);
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.favorite-btn:hover:not(:disabled) {
  transform: scale(1.04);
  background: rgba(26, 39, 56, 0.92);
}

.favorite-btn.active {
  background: rgba(255, 72, 118, 0.2);
  color: #ff7a9f;
  border-color: rgba(255, 122, 159, 0.45);
}

.favorite-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.ideas-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 22px 24px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 29, 45, 0.94), rgba(11, 23, 36, 0.92));
}

.ideas-head h1 {
  margin: 8px 0 10px;
  font-size: 34px;
}

.ideas-head p {
  margin: 0;
  max-width: 76ch;
  color: var(--muted);
  line-height: 1.5;
}

.ideas-primary-btn,
.ideas-danger-btn,
.idea-add-card-btn,
.idea-link-btn,
.idea-icon-btn {
  border: none;
  cursor: pointer;
}

.ideas-primary-btn {
  min-width: 180px;
}

.ideas-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 320px);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.idea-column {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  min-height: 520px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 29, 45, 0.96), rgba(11, 23, 36, 0.92));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}

.idea-column-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.idea-column-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.idea-column-head span {
  color: var(--muted);
  font-size: 13px;
}

.idea-column-actions {
  display: flex;
  gap: 6px;
}

.idea-icon-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
}

.idea-icon-btn.danger {
  background: rgba(111, 41, 52, 0.22);
  color: var(--danger-text);
}

.idea-card-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 120px;
  padding: 4px;
  border-radius: 16px;
  transition: background 0.16s ease, outline-color 0.16s ease;
}

.idea-card-list.drag-over {
  background: rgba(37, 150, 255, 0.08);
  outline: 1px dashed rgba(37, 150, 255, 0.5);
}

.idea-card-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(51, 80, 108, 0.72);
  background: rgba(19, 38, 58, 0.98);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.16);
}

.idea-card-item.dragging {
  opacity: 0.45;
}

.idea-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.idea-card-top strong {
  font-size: 15px;
  line-height: 1.35;
}

.idea-card-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.idea-card-item p.muted {
  color: #7890ab;
}

.idea-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #b5c8dc;
  font-size: 12px;
}

.idea-add-card-btn,
.idea-link-btn {
  background: var(--surface-2);
  color: var(--text);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
}

.idea-add-card-btn {
  width: 100%;
  border: 1px dashed var(--line-strong);
  background: rgba(19, 38, 58, 0.72);
}

.ideas-modal-card {
  width: min(560px, calc(100vw - 32px));
}

.ideas-modal-wide {
  width: min(980px, calc(100vw - 32px));
}

.ideas-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 20px;
}

.ideas-form {
  display: grid;
  gap: 14px;
}

.ideas-form textarea,
.idea-comment-form textarea {
  width: 100%;
  resize: vertical;
}

.ideas-form-actions {
  display: flex;
  gap: 10px;
}

.ideas-danger-btn {
  background: linear-gradient(180deg, #aa3a4a, #862738);
}

.ideas-comments-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  min-height: 100%;
  padding: 16px;
  border-radius: 20px;
  background: rgba(19, 38, 58, 0.72);
  border: 1px solid var(--line);
}

.ideas-comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ideas-comments-head h4 {
  margin: 0;
  font-size: 18px;
}

.ideas-comments-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.ideas-comments-list {
  display: grid;
  align-content: start;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.idea-comment {
  padding: 12px 13px;
  border-radius: 14px;
  background: rgba(7, 17, 27, 0.54);
  border: 1px solid rgba(36, 56, 79, 0.92);
}

.idea-comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.idea-comment-head strong {
  font-size: 13px;
}

.idea-comment-head span {
  color: var(--muted);
  font-size: 12px;
}

.idea-comment p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.idea-comment-form {
  display: grid;
  gap: 12px;
}

.profile-analysis-head {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
  padding: 22px 24px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 29, 45, 0.94), rgba(11, 23, 36, 0.92));
}

.profile-analysis-head h1 {
  margin: 8px 0 10px;
  font-size: 34px;
}

.profile-analysis-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.profile-analysis-form {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 150px;
  gap: 10px;
}

.profile-analysis-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.profile-detail-wrap {
  min-width: 0;
}

.profile-entity-list-wrap,
.profile-detail-card,
.profile-detail-empty {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 29, 45, 0.96), rgba(11, 23, 36, 0.92));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}

.profile-detail-empty {
  color: var(--muted);
}

.profile-entity-list-head h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.profile-entity-list {
  display: grid;
  gap: 12px;
}

.profile-entity-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(51, 80, 108, 0.72);
  background: rgba(19, 38, 58, 0.98);
}

.profile-entity-card.active {
  border-color: rgba(37, 150, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(37, 150, 255, 0.16);
}

.profile-entity-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-entity-avatar,
.profile-detail-avatar {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid rgba(51, 80, 108, 0.72);
}

.profile-entity-main {
  min-width: 0;
  flex: 1;
}

.profile-entity-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.profile-entity-name-row strong {
  font-size: 15px;
}

.profile-entity-handle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-platform-badge,
.profile-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.profile-platform-badge {
  background: rgba(7, 17, 27, 0.66);
  color: #d6e8fb;
}

.profile-status-pill.status-success {
  background: rgba(25, 195, 125, 0.18);
  color: #7ef0bf;
}

.profile-status-pill.status-processing {
  background: rgba(37, 150, 255, 0.18);
  color: #8ac7ff;
}

.profile-status-pill.status-error {
  background: rgba(170, 58, 74, 0.22);
  color: #ffbcc8;
}

.profile-entity-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.profile-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.profile-mobile-back {
  display: none;
}

.profile-detail-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-detail-identity h2 {
  margin: 6px 0 8px;
  font-size: 28px;
}

.profile-detail-identity a {
  color: var(--primary-2);
  text-decoration: none;
}

.profile-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.profile-metric-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(19, 38, 58, 0.82);
  border: 1px solid rgba(36, 56, 79, 0.92);
}

.profile-metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.profile-metric-card strong {
  font-size: 24px;
}

.profile-posts-section {
  display: grid;
  gap: 12px;
}

.profile-posts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-posts-head h3 {
  margin: 0;
  font-size: 20px;
}

.profile-posts-head span {
  color: var(--muted);
  font-size: 13px;
}

.profile-posts-table-wrap {
  overflow-x: auto;
}

.profile-posts-table {
  width: 100%;
  border-collapse: collapse;
}

.profile-posts-table th,
.profile-posts-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(36, 56, 79, 0.92);
  text-align: left;
  font-size: 13px;
}

.profile-posts-table th {
  color: var(--muted);
  font-weight: 700;
}

.profile-posts-table td a {
  color: var(--text);
  text-decoration: none;
}

.auth-link:hover {
  filter: none;
  transform: none;
  text-decoration: underline;
}

.auth-error {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger-text);
  font-size: 13px;
  line-height: 1.45;
}

.search-panel,
.filters-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.search-panel {
  padding: 12px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(250px, 2fr) repeat(2, minmax(130px, 1fr));
  gap: 10px;
}

input,
select,
button {
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
}

textarea {
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
}

input::placeholder {
  color: #7f98b6;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(37, 150, 255, 0.2);
  border-color: var(--primary-2);
}

button {
  background: linear-gradient(110deg, var(--primary), var(--primary-2));
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.12s ease, filter 0.12s ease;
}

button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.gallery {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.26);
}

.thumb-wrap {
  position: relative;
  aspect-ratio: 9 / 16;
}

.thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--surface-2);
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: rgba(6, 12, 18, 0.82);
}

.quick-link {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  color: #fff;
  background: rgba(6, 12, 18, 0.82);
}

.overlay-top {
  position: absolute;
  top: 42px;
  left: 10px;
  right: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.overlay-bottom {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: grid;
  gap: 8px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 10px;
  color: #fff;
  background: rgba(5, 10, 18, 0.68);
  backdrop-filter: blur(4px);
  font-size: 12px;
  line-height: 1.2;
}

.tab.title {
  font-weight: 700;
  padding: 8px 10px;
}

.open-btn {
  display: block;
  width: 100%;
  text-align: center;
  border: none;
  text-decoration: none;
  background: linear-gradient(110deg, var(--primary), var(--primary-2));
  color: #fff;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
}

.more-wrap {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.more-wrap button {
  min-width: 240px;
}

.filters-wrap {
  margin-top: 14px;
  padding: 12px;
  position: sticky;
  top: 20px;
  z-index: 20;
}

.filters-wrap h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.filters-head h3 {
  margin: 0;
}

.filters-toggle {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
}

.filters-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 8px;
}

#btn-reset-filters {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
}

.empty {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  color: var(--muted);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 12, 18, 0.52);
  display: grid;
  place-items: center;
  z-index: 9999;
  backdrop-filter: blur(3px);
}

.loading-overlay[hidden] {
  display: none !important;
}

.loading-card {
  min-width: 240px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid var(--line);
  border-top-color: var(--primary-2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
}

.modal[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 16, 0.62);
  backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  width: min(960px, calc(100% - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 14px;
}

.modal-card h3 {
  margin: 0 26px 12px 0;
}

.modal-player {
  width: min(780px, calc(100% - 24px));
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 20px;
  line-height: 1;
  padding: 0;
}

.player-frame-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #08131f;
}

.player-frame {
  width: 100%;
  aspect-ratio: 9 / 16;
  border: 0;
}

.analysis-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
}

.analysis-metrics {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.analysis-metric {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--surface-2);
}

.analysis-right-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.analysis-right-head h4 {
  margin: 0;
  font-size: 16px;
}

.analysis-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.analysis-transcript {
  margin: 0;
  min-height: 280px;
  max-height: 58vh;
  overflow: auto;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 13px;
  color: #d8e9fb;
}

.app-shell-layout {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  min-height: calc(100vh - 40px);
}

.sidebar {
  position: sticky;
  top: 20px;
  min-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 18px 18px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(15, 29, 45, 0.96), rgba(8, 19, 31, 0.94));
  border: 1px solid rgba(36, 56, 79, 0.92);
  box-shadow: var(--shadow);
}

.sidebar-top {
  display: grid;
  gap: 26px;
}

.sidebar-brand {
  display: grid;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.sidebar-brand p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.sidebar-nav,
.sidebar-bottom {
  display: grid;
  gap: 8px;
}

.sidebar-link,
.sidebar-action {
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  background: rgba(19, 38, 58, 0.7);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease;
}

.sidebar-link:hover,
.sidebar-action:hover {
  border-color: var(--line-strong);
  background: rgba(24, 45, 68, 0.92);
  transform: translateY(-1px);
}

.sidebar-link.active,
.sidebar-action.active {
  background: linear-gradient(110deg, rgba(25, 195, 125, 0.22), rgba(37, 150, 255, 0.22));
  border-color: rgba(73, 147, 224, 0.48);
}

.sidebar-action {
  width: 100%;
  justify-content: center;
  cursor: pointer;
}

.content-area {
  min-width: 0;
}

.placeholder-card,
.profile-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.placeholder-card {
  min-height: calc(100vh - 40px);
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 12px;
  padding: 36px;
}

.placeholder-card h1 {
  margin: 0;
  font-size: 34px;
}

.placeholder-card p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.profile-card {
  padding: 24px;
}

.profile-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.profile-head h1 {
  margin: 6px 0 0;
  font-size: 32px;
}

.profile-form {
  display: grid;
  gap: 14px;
}

.profile-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.profile-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  padding-top: 8px;
}

.profile-status[data-kind="success"] {
  color: var(--primary);
}

.profile-status[data-kind="error"] {
  color: var(--danger-text);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .auth-screen {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-hero,
  .auth-card {
    max-width: 720px;
  }

  .controls {
    grid-template-columns: 1fr 1fr;
  }

  .filters-controls {
    grid-template-columns: 1fr 1fr;
  }

  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .profile-head {
    flex-direction: column;
  }

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

  .sidebar {
    position: static;
    min-height: auto;
  }

  .placeholder-card {
    min-height: 320px;
  }

  .ideas-head {
    flex-direction: column;
    align-items: stretch;
  }

  .ideas-card-grid {
    grid-template-columns: 1fr;
  }

  .profile-analysis-form,
  .profile-analysis-layout,
  .profile-metrics-grid {
    grid-template-columns: 1fr;
  }

  .profile-detail-head,
  .profile-posts-head,
  .profile-entity-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .controls,
  .filters-controls {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    padding: 24px;
  }

  .auth-hero h2 {
    font-size: 30px;
  }

  .auth-card {
    padding: 18px;
  }

  .auth-panel {
    padding: 14px;
  }

  .brand-logo {
    width: 28px;
    height: 28px;
  }

  .brand-title {
    font-size: 22px;
  }

  .container {
    padding: 14px;
  }

  .sidebar,
  .placeholder-card,
  .profile-card {
    padding: 18px;
  }

  .ideas-board {
    grid-auto-columns: minmax(260px, 86vw);
  }

  .ideas-modal-card,
  .ideas-modal-wide {
    width: calc(100vw - 20px);
  }

  .ideas-form-actions {
    flex-direction: column;
  }

  .profile-detail-identity {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .container {
    padding: 12px;
  }

  .mobile-nav-bar,
  .filters-toggle {
    display: inline-flex;
  }

  .mobile-nav-bar {
    display: flex;
    position: sticky;
    top: 12px;
    z-index: 1001;
  }

  .app-shell-layout {
    display: block;
    min-height: auto;
  }

  .app-shell-layout > .sidebar {
    position: fixed;
    top: 12px;
    right: 12px;
    bottom: 12px;
    left: auto;
    width: min(320px, calc(100vw - 24px));
    min-height: auto;
    z-index: 1003;
    overflow: auto;
    transform: translateX(calc(100% + 24px));
    transition: transform 0.22s ease;
  }

  .app-shell-layout.sidebar-open > .sidebar {
    transform: translateX(0);
  }

  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 10, 16, 0.62);
    backdrop-filter: blur(3px);
    z-index: 1002;
  }

  .app-shell-layout.sidebar-open .mobile-nav-backdrop {
    display: block;
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

  .search-panel,
  .filters-wrap,
  .page-head,
  .placeholder-card,
  .profile-card {
    border-radius: 18px;
  }

  .search-panel {
    padding: 10px;
  }

  .controls {
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 8px;
  }

  .controls button {
    grid-column: 1 / -1;
  }

  .filters-wrap {
    top: 70px;
    padding: 10px;
  }

  .filters-wrap.filters-collapsed .filters-controls {
    display: none;
  }

  .filters-head {
    margin-bottom: 0;
  }

  .filters-wrap:not(.filters-collapsed) .filters-head {
    margin-bottom: 10px;
  }

  .filters-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #gallery,
  #favorites-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #gallery .card,
  #favorites-gallery .card {
    border-radius: 14px;
  }

  #gallery .overlay-top,
  #favorites-gallery .overlay-top {
    top: 40px;
    gap: 4px;
  }

  #gallery .tab,
  #favorites-gallery .tab {
    padding: 5px 7px;
    font-size: 11px;
  }

  #gallery .open-btn,
  #favorites-gallery .open-btn {
    padding: 7px 8px;
    font-size: 12px;
  }

  #gallery .quick-link,
  #favorites-gallery .quick-link,
  #gallery .favorite-btn,
  #favorites-gallery .favorite-btn {
    width: 28px;
    height: 28px;
  }

  .profile-analysis-layout {
    display: block;
  }

  .profile-entity-list-wrap,
  .profile-detail-wrap {
    width: 100%;
  }

  .profile-entity-list-wrap.mobile-hidden {
    display: none;
  }

  .profile-detail-wrap {
    display: none;
  }

  .profile-detail-wrap.mobile-open {
    display: block;
  }

  .profile-detail-empty {
    display: none;
  }

  .profile-detail-wrap.mobile-open .profile-detail-empty,
  .profile-detail-wrap.mobile-open .profile-detail-card {
    display: block;
  }

  .profile-mobile-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin-bottom: 14px;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--line);
  }

  .profile-detail-head {
    margin-bottom: 14px;
  }

  .profile-posts-table th:nth-child(3),
  .profile-posts-table th:nth-child(4),
  .profile-posts-table th:nth-child(5),
  .profile-posts-table td:nth-child(3),
  .profile-posts-table td:nth-child(4),
  .profile-posts-table td:nth-child(5) {
    white-space: nowrap;
  }
}
