:root {
  --page: #07080d;
  --ink: #171419;
  --muted: #766f77;
  --soft: #a69da5;
  --line: #ebe3e7;
  --card: #fffafa;
  --primary: #e60023;
  --primary-2: #b8001b;
  --dark: #171419;
  --dark-2: #2b252b;
  --ring: rgba(230, 0, 35, 0.16);
  --shadow-sm: 0 10px 30px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 28px 80px rgba(16, 24, 40, 0.16);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 24px;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.08), transparent 28%),
    radial-gradient(circle at 84% 14%, rgba(148, 163, 184, 0.12), transparent 24%),
    radial-gradient(circle at 72% 88%, rgba(255, 255, 255, 0.05), transparent 32%),
    linear-gradient(135deg, #050509 0%, #111216 48%, #17181d 100%);
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

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

.app-shell {
  position: relative;
  width: min(1180px, calc(100vw - 48px));
  height: min(760px, calc(100dvh - 48px));
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.92fr);
  overflow: hidden;
  border: 1px solid rgba(255, 250, 250, 0.16);
  border-radius: 36px;
  background: rgba(255, 250, 250, 0.05);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(26px);
}

.hero-panel {
  position: relative;
  min-height: 0;
  padding: clamp(28px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: #ffffff;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 250, 250, 0.08), transparent 22%),
    radial-gradient(circle at 88% 16%, rgba(148, 163, 184, 0.16), transparent 28%),
    linear-gradient(145deg, #060609 0%, #141318 52%, #1c1d22 100%);
}

.hero-panel::before {
  position: absolute;
  width: 520px;
  height: 520px;
  right: -170px;
  top: -150px;
  content: "";
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 250, 250, 0.1), rgba(148, 163, 184, 0.12) 38%, rgba(5, 5, 9, 0) 70%);
}

.hero-panel::after {
  position: absolute;
  inset: auto 0 0;
  height: 44%;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(16, 24, 40, 0.5));
}

.brand-bar,
.hero-content,
.security-card,
.stats-card {
  position: relative;
  z-index: 1;
}

.brand-bar,
.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand,
.dashboard-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  color: #ffffff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), #ff5a76);
  box-shadow: 0 14px 34px rgba(230, 0, 35, 0.3);
}

.logo-mark {
  color: #e60023;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(230, 0, 35, 0.22);
}

.logo-mark img {
  width: 30px;
  height: 30px;
  display: block;
  object-fit: contain;
}

.nav-link,
.form-badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-link {
  height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

.eyebrow {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow.dark {
  color: var(--primary);
}

.hero-content {
  max-width: 620px;
  margin: auto 0;
}

.hero-content h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(44px, 5.4vw, 76px);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

.art-title {
  position: relative;
  width: fit-content;
  padding-bottom: 10px;
  color: transparent;
  background: linear-gradient(135deg, #ffffff 0%, #ffe0e6 34%, #ff5a76 62%, #ffffff 100%);
  background-clip: text;
  -webkit-background-clip: text;
  text-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

.art-title::after {
  position: absolute;
  left: 4px;
  right: 8px;
  bottom: 0;
  height: 5px;
  content: "";
  border-radius: 999px;
  background: linear-gradient(90deg, #ffffff, #ff5a76, transparent);
  box-shadow: 0 10px 26px rgba(230, 0, 35, 0.34);
}

.hero-text {
  max-width: 480px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 17px;
  line-height: 1.8;
}

.security-card {
  width: min(360px, 86%);
  margin: 0 0 20px auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
}

.security-top,
.security-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 700;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #12b76a;
  box-shadow: 0 0 0 6px rgba(18, 183, 106, 0.16), 0 0 28px rgba(18, 183, 106, 0.7);
}

.security-meter {
  height: 8px;
  margin: 18px 0 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.security-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffffff, #ff5a76);
  transition: width 0.6s ease;
}

.security-meta strong {
  color: #ffffff;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.stats-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
}

.stats-card div {
  padding: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.stats-card strong,
.stats-card span {
  display: block;
}

.stats-card strong {
  margin-bottom: 7px;
  color: #ffffff;
  font-size: 22px;
}

.stats-card span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.form-panel {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: clamp(32px, 5vw, 68px);
  background:
    radial-gradient(circle at 82% 10%, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(180deg, #15161b 0%, #0f1014 100%);
}

.form-panel::after {
  position: absolute;
  right: -86px;
  bottom: -92px;
  width: 260px;
  height: 260px;
  content: "";
  border-radius: 50%;
  background: radial-gradient(circle, rgba(148, 163, 184, 0.12), rgba(148, 163, 184, 0) 68%);
  pointer-events: none;
}

.form-panel::before {
  display: none;
}

.form-card {
  width: min(100%, 420px);
  position: relative;
  z-index: 1;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.form-card::before {
  position: absolute;
  top: -28px;
  right: -34px;
  width: 92px;
  height: 92px;
  content: "";
  border: 1px solid rgba(230, 0, 35, 0.12);
  border-radius: 28px;
  transform: rotate(14deg);
  background: rgba(230, 0, 35, 0.035);
  pointer-events: none;
}

.form-badge {
  height: 32px;
  margin-bottom: 22px;
  padding: 0 13px;
  color: var(--primary);
  background: rgba(230, 0, 35, 0.08);
}

.form-header {
  margin-bottom: 30px;
}

.form-header h2 {
  margin: 0 0 10px;
  font-size: clamp(34px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.login-art-title {
  width: fit-content;
  color: transparent;
  background: linear-gradient(135deg, #ffffff 0%, #f3f4f6 34%, #ff7a90 100%);
  background-clip: text;
  -webkit-background-clip: text;
  text-shadow: 0 18px 42px rgba(230, 0, 35, 0.12);
}

.login-art-title::after {
  display: block;
  width: 72%;
  height: 4px;
  margin-top: 10px;
  content: "";
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), rgba(230, 0, 35, 0));
}

.form-header p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.login-form,
.scrape-form {
  display: grid;
}

.login-form {
  gap: 14px;
}

.login-form label,
.label-row label,
.scrape-form label {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 800;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.label-row a {
  color: var(--primary);
  font-weight: 800;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}

.input-wrap input,
.scrape-form input,
.scrape-form select {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  outline: none;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.06));
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.advanced-input {
  position: relative;
}

.advanced-input input {
  height: 58px;
  padding-left: 58px;
  border-color: rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.07)),
    radial-gradient(circle at 100% 0, rgba(255, 255, 255, 0.06), transparent 32%);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  z-index: 1;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: -0.02em;
  pointer-events: none;
  transform: translateY(-50%);
  background: linear-gradient(135deg, var(--primary), #ff6b83);
  box-shadow: 0 10px 22px rgba(230, 0, 35, 0.22);
}

.input-wrap input:focus,
.scrape-form input:focus,
.scrape-form select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 5px var(--ring);
}

.input-wrap input::placeholder,
.scrape-form input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}

.remember input,
.option-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}

.login-button,
.run-button,
.register-button {
  height: 54px;
  border: 0;
  border-radius: 16px;
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 16px 36px rgba(230, 0, 35, 0.24);
}

.login-button:hover,
.run-button:hover {
  box-shadow: 0 20px 46px rgba(230, 0, 35, 0.3);
}

.register-button {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.06));
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16);
}

.register-button:hover {
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.login-creative-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.055));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
}

.login-creative-card::after {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 8px;
  height: 8px;
  content: "";
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 7px rgba(230, 0, 35, 0.08);
}

.pin-stack {
  width: 58px;
  height: 58px;
  position: relative;
  flex: 0 0 auto;
}

.pin-stack span {
  position: absolute;
  width: 34px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff, #d1d5db);
  box-shadow: 0 12px 24px rgba(16, 24, 40, 0.16);
}

.pin-stack span:nth-child(1) {
  left: 0;
  top: 10px;
  transform: rotate(-12deg);
}

.pin-stack span:nth-child(2) {
  left: 13px;
  top: 4px;
  background: linear-gradient(145deg, var(--primary), #ff7a90);
  transform: rotate(6deg);
}

.pin-stack span:nth-child(3) {
  left: 26px;
  top: 12px;
  background: linear-gradient(145deg, #ffffff, #eef2f7);
  transform: rotate(14deg);
}

.login-creative-card span,
.login-creative-card strong {
  display: block;
}

.login-creative-card strong {
  margin-bottom: 6px;
  color: #ffffff;
  font-size: 16px;
  letter-spacing: -0.04em;
}

.login-creative-card > div:last-child span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  line-height: 1.6;
}

.tool-panel {
  display: none;
}

.app-shell.is-auth-checking {
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  margin: 0;
  grid-template-columns: 1fr;
  border: 0;
  border-radius: 0;
  background: #f8fafc;
  box-shadow: none;
  backdrop-filter: none;
}

.app-shell.is-auth-checking .hero-panel,
.app-shell.is-auth-checking .login-view {
  display: none;
}

.app-shell.is-auth-checking .tool-panel {
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  background: #f8fafc;
}

body:has(.app-shell.is-auth-checking) {
  padding: 0;
  overflow: hidden;
  display: block;
  background: #f8fafc;
}

.is-logged-in {
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  margin: 0;
  grid-template-columns: 1fr;
  border: 0;
  border-radius: 0;
  background: #f8fafc;
  box-shadow: none;
  backdrop-filter: none;
}

body:has(.is-logged-in) {
  padding: 0;
  overflow: hidden;
  display: block;
  background: #f8fafc;
}

.is-logged-in .hero-panel,
.is-logged-in .login-view {
  display: none;
}

.is-logged-in .tool-panel {
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  background: #f8fafc;
}

.app-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #fbf8f9 100%);
}

.app-navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--dark);
}

.app-navbar-brand strong {
  font-size: 18px;
  letter-spacing: -0.035em;
}

.dashboard-layout {
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.sidebar-menu {
  width: 260px;
  min-height: 0;
  contain: layout paint;
  padding: 24px 18px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-right: 1px solid var(--line);
  background: #ffffff;
  transition: width 0.18s cubic-bezier(0.4, 0, 0.2, 1), padding 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  align-self: flex-end;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dark-2);
  cursor: pointer;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  background: #ffffff;
  transition: transform 0.22s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.sidebar-toggle:hover {
  transform: translateX(-1px);
}

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

.sidebar-menu nav a {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-radius: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
  transition: color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.sidebar-menu nav a span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  color: var(--primary);
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  background: rgba(230, 0, 35, 0.08);
}

.sidebar-menu nav a strong {
  font: inherit;
  white-space: nowrap;
  transition: opacity 0.16s ease, transform 0.2s ease;
}

.is-sidebar-collapsed .sidebar-menu {
  width: 92px;
  padding: 24px 12px;
}

.is-sidebar-collapsed .sidebar-menu nav a {
  width: 48px;
  justify-content: center;
  justify-self: center;
  gap: 0;
  padding: 0;
}

.is-sidebar-collapsed .sidebar-menu nav a strong {
  width: 0;
  display: block;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: none;
}

.is-sidebar-collapsed .sidebar-toggle {
  align-self: center;
}

.sidebar-menu nav a:hover,
.sidebar-menu nav a.active {
  color: var(--dark);
  background: #f8f2f4;
  box-shadow: inset 3px 0 0 var(--primary);
}

.dashboard-main {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: clamp(20px, 2.7vw, 34px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: auto;
}

.dashboard-view {
  display: none;
}

.dashboard-view.active {
  display: block;
}

.workspace-grid.dashboard-view.active {
  display: grid;
}

.dashboard-main > .dashboard-view:not(.active) {
  display: none;
}

.dashboard-topbar {
  min-height: 64px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 30px rgba(16, 24, 40, 0.04);
}

.dashboard-brand {
  color: var(--dark);
}

.dashboard-brand strong,
.dashboard-brand small {
  display: block;
}

.dashboard-brand strong {
  font-size: 15px;
}

.dashboard-brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.top-nav {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid #edf0f3;
  border-radius: 999px;
  background: #f2f4f7;
}

.top-nav a {
  padding: 9px 18px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.top-nav a.active,
.top-nav a:hover {
  color: var(--dark);
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.08);
}

.logout-button {
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dark-2);
  cursor: pointer;
  font-weight: 800;
  background: #ffffff;
}

.user-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.user-name {
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-width: 68px;
  max-width: 132px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  color: var(--dark);
  background: transparent;
  box-shadow: none;
}

.user-name > strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--dark);
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: none;
}

.user-name > span {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
}

.user-dropdown {
  display: none;
}

.user-menu .logout-button {
  height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(23, 20, 25, 0.1);
  border-radius: 999px;
  color: #4b454d;
  font-weight: 850;
  background: linear-gradient(180deg, #ffffff 0%, #f7f2f4 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 8px 18px rgba(16, 24, 40, 0.06);
}

.user-menu .logout-button:hover {
  color: #ffffff;
  border-color: #171419;
  background: linear-gradient(135deg, #171419 0%, #2a252b 100%);
  box-shadow: 0 12px 26px rgba(16, 24, 40, 0.16);
}

.user-menu .logout-button:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(16, 24, 40, 0.12);
}

.dashboard-hero {
  position: relative;
  overflow: visible;
  padding: clamp(28px, 4vw, 48px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.52fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: end;
  border-radius: 28px;
  color: #ffffff;
  background:
    radial-gradient(circle at 88% 16%, rgba(230, 0, 35, 0.46), transparent 32%),
    linear-gradient(135deg, #101828 0%, #182230 55%, #344054 100%);
  box-shadow: var(--shadow-sm);
}

.dashboard-hero::after {
  position: absolute;
  right: 38px;
  bottom: -70px;
  width: 280px;
  height: 280px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 38px;
  transform: rotate(18deg);
  background: rgba(255, 255, 255, 0.06);
}

.hero-copy,
.hero-actions {
  position: relative;
  z-index: 1;
}

.dashboard-hero h2 {
  max-width: 720px;
  margin: 0 0 12px;
  font-size: clamp(34px, 4.2vw, 60px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.dashboard-hero .eyebrow {
  line-height: 1.4;
}

.dashboard-hero p:not(.eyebrow) {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.8;
}

.hero-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.hero-actions article {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
}

.hero-actions span,
.hero-actions strong {
  display: block;
}

.hero-actions span {
  margin-bottom: 6px;
  color: #ffffff;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.hero-actions strong {
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(480px, 1.25fr) minmax(330px, 0.75fr);
  gap: 20px;
  align-items: stretch;
  flex: 1;
}

.task-board {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.04);
}

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

.task-board-head strong,
.task-board-head span {
  display: block;
}

.task-board-head strong {
  margin-bottom: 5px;
  color: var(--dark);
  font-size: 20px;
  letter-spacing: -0.04em;
}

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

.task-board-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.task-board-actions button {
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(230, 0, 35, 0.12);
  border-radius: 999px;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  background: rgba(230, 0, 35, 0.08);
  pointer-events: auto;
}

.task-board-actions button:hover {
  border-color: rgba(230, 0, 35, 0.22);
  background: rgba(230, 0, 35, 0.12);
}

.task-board.is-collapsed .task-list {
  display: none;
}

.task-board.is-collapsed {
  padding-bottom: 10px;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 128px 190px 72px 116px;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #f0e9ed;
  border-radius: 16px;
  background: #fffafa;
}

.task-row.empty {
  display: block;
  padding: 16px;
  border: 1px dashed #c9c1c7;
  color: #5f5960;
  text-align: center;
  background: #f8f2f4;
}

.task-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.task-row .task-result {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row strong {
  overflow: hidden;
  color: var(--dark);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row em {
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #027a48;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  background: #ecfdf3;
}

.task-row.running em {
  color: #b54708;
  background: #fffaeb;
}

.task-row.failed em {
  color: #b42318;
  background: #fef3f2;
}

.task-row.disabled em {
  color: #667085;
  background: #f2f4f7;
}

.task-actions {
  display: inline-flex;
  justify-content: flex-end;
  gap: 6px;
  position: relative;
  z-index: 2;
}

.task-actions button {
  height: 30px;
  padding: 0 10px;
  border: 1px solid #eadde3;
  border-radius: 999px;
  color: #5f5960;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  background: #ffffff;
  pointer-events: auto;
}

.task-actions button:hover {
  color: var(--primary);
  border-color: rgba(230, 0, 35, 0.28);
  background: #fff2f4;
}

.tool-card,
.status-card,
.mini-grid article,
.activity-card,
.tips-card {
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.04);
}

.tool-card,
.activity-card {
  min-width: 0;
  padding: clamp(22px, 2.8vw, 34px);
  border-radius: 26px;
}

.section-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
}

.section-title > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 950;
  background: rgba(230, 0, 35, 0.08);
}

.section-title h3 {
  margin: 0 0 7px;
  color: var(--dark);
  font-size: 24px;
  letter-spacing: -0.04em;
}

.section-title p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.scrape-form {
  gap: 12px;
}

.task-form-panel {
  padding: 18px;
  border: 1px solid #e5d8de;
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0, rgba(230, 0, 35, 0.045), transparent 32%),
    #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 10px 26px rgba(16, 24, 40, 0.045);
}

.task-form-panel label {
  color: #2b252b;
  font-size: 13px;
  font-weight: 900;
}

.task-form-panel input,
.task-form-panel select {
  color: #171419;
  border-color: #d8cbd2;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 18px rgba(16, 24, 40, 0.045);
}

.task-form-panel input::placeholder {
  color: #8f8790;
}

.task-form-panel input:focus,
.task-form-panel select:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 5px rgba(230, 0, 35, 0.12), 0 10px 24px rgba(16, 24, 40, 0.07);
}

.task-form-panel select {
  background-color: #ffffff;
  background-image: linear-gradient(45deg, transparent 50%, #2b252b 50%), linear-gradient(135deg, #2b252b 50%, transparent 50%);
}

.task-form-row {
  display: grid;
  gap: 12px;
}

.task-form-row.main {
  grid-template-columns: 0.42fr 1fr;
}

.task-form-row > div,
.form-grid > div {
  display: grid;
  gap: 8px;
}

.quick-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed #d8cbd2;
  border-radius: 18px;
  background: #ffffff;
}

.quick-presets button {
  height: 38px;
  padding: 0 14px;
  border: 1px solid #e8b5be;
  border-radius: 999px;
  color: var(--primary-2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  background: #fff2f4;
}

.quick-presets button:hover {
  border-color: rgba(230, 0, 35, 0.28);
  background: rgba(230, 0, 35, 0.1);
}

.scrape-form select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #667085 50%), linear-gradient(135deg, #667085 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.form-grid {
  display: grid;
  grid-template-columns: 0.7fr 0.8fr 1.3fr;
  gap: 12px;
}

.form-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 4px 0 8px;
  color: var(--muted);
  font-size: 14px;
}

.option-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.schedule-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  padding: 12px;
  border: 1px solid #eadde3;
  border-radius: 16px;
  background: #fff8fa;
}

.schedule-row > div {
  display: grid;
  gap: 8px;
}

.schedule-row span {
  padding-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.insight-column {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 16px;
  min-height: 0;
}

.status-card {
  padding: 22px;
  border-radius: 24px;
}

.status-pill {
  height: 30px;
  gap: 8px;
  padding: 0 12px;
  color: #027a48;
  background: #ecfdf3;
}

.status-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #12b76a;
}

.status-card h3 {
  margin: 18px 0 7px;
  color: var(--dark);
  font-size: 24px;
  letter-spacing: -0.04em;
}

.status-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.mini-grid article {
  padding: 18px;
  border-radius: 22px;
}

.mini-grid strong,
.mini-grid span {
  display: block;
}

.mini-grid strong {
  margin-bottom: 7px;
  color: var(--dark);
  font-size: 22px;
  letter-spacing: -0.03em;
}

.mini-grid span {
  color: var(--muted);
  font-size: 13px;
}

.activity-card {
  display: grid;
  grid-template-rows: auto 1fr;
}

.task-output {
  min-height: 180px;
  max-height: 260px;
  padding: 16px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid #182230;
  border-radius: 16px;
  color: #d0d5dd;
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
  line-height: 1.7;
  background: #101828;
}

.tips-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 16px;
  border-radius: 18px;
  color: var(--muted);
  font-size: 13px;
}

.tips-card strong {
  color: var(--dark);
}

.media-library,
.settings-view {
  flex: 1;
  min-height: 0;
}

.library-surface {
  min-height: 100%;
  margin-top: 18px;
  padding: clamp(20px, 2.6vw, 32px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 100% 0, rgba(230, 0, 35, 0.06), transparent 26%),
    linear-gradient(180deg, #f8fafc 0%, #f2f4f7 100%);
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.04);
}

.library-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(152, 162, 179, 0.22);
}

.library-panel-head strong,
.library-panel-head span {
  display: block;
}

.library-panel-head strong {
  margin-bottom: 6px;
  color: var(--dark);
  font-size: 20px;
  letter-spacing: -0.04em;
}

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

.library-panel-head > span {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(230, 0, 35, 0.08);
}

.library-titlebar {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(24px, 4vw, 52px);
  padding: clamp(28px, 4vw, 48px);
  overflow: visible;
  border-radius: 28px;
  color: #ffffff;
  background:
    radial-gradient(circle at 88% 16%, rgba(230, 0, 35, 0.46), transparent 32%),
    linear-gradient(135deg, #101828 0%, #182230 55%, #344054 100%);
  box-shadow: var(--shadow-sm);
}

.library-titlebar::after {
  position: absolute;
  right: 38px;
  bottom: -70px;
  width: 280px;
  height: 280px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 38px;
  transform: rotate(18deg);
  background: rgba(255, 255, 255, 0.06);
}

.library-titlebar > * {
  position: relative;
  z-index: 1;
}

.library-titlebar h2 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: clamp(34px, 4.2vw, 60px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.library-titlebar p {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.8;
}

.library-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.library-date-menu {
  position: relative;
}

.trend-sort-menu {
  position: relative;
}

.library-date-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: 220px;
  max-height: min(460px, 62vh);
  padding: 10px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0, rgba(230, 0, 35, 0.18), transparent 34%),
    rgba(16, 24, 40, 0.97);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(18px);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.32) transparent;
}

.library-date-options[hidden] {
  display: none;
}

.trend-sort-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: 148px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(16, 24, 40, 0.97);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.trend-sort-options[hidden] {
  display: none;
}

.library-titlebar .trend-sort-options button {
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 0 10px;
  border-color: transparent;
  color: rgba(255, 255, 255, 0.84);
  background: transparent;
}

.library-titlebar .trend-sort-options button[aria-pressed="true"],
.library-titlebar .trend-sort-options button:hover {
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  background: rgba(230, 0, 35, 0.26);
}

.date-options-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px 10px;
  color: #ffffff;
}

.date-options-head strong {
  font-size: 13px;
  font-weight: 950;
}

.date-options-head span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 850;
}

.date-options-group {
  position: sticky;
  top: -10px;
  z-index: 1;
  margin: 8px -2px 6px;
  padding: 8px 10px 6px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(16, 24, 40, 0.95);
}

.date-options-empty {
  padding: 14px 8px 8px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.library-date-options .date-option {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 0 10px;
  border-color: transparent;
  color: rgba(255, 255, 255, 0.86);
  background: transparent;
}

.library-date-options .date-option span {
  flex: 1;
  text-align: left;
}

.library-date-options .date-option em {
  min-width: 28px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
  background: rgba(255, 255, 255, 0.1);
}

.library-date-options .date-option.all {
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.library-date-options .date-option.active,
.library-date-options .date-option:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.16);
}

.library-date-options .date-option.active em,
.library-date-options .date-option:hover em {
  color: #ffffff;
  background: rgba(230, 0, 35, 0.5);
}

.library-titlebar button {
  height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 850;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
}

.library-titlebar button:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.16);
}

.library-titlebar .sort-toggle {
  min-width: 72px;
  padding: 0 14px;
}

.library-titlebar .trend-sort-toggle {
  min-width: 108px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.library-titlebar .trend-sort-toggle::after {
  content: "\25BE";
  font-size: 10px;
  transform: translateY(1px);
  transition: transform 0.18s ease;
}

.library-titlebar .trend-sort-toggle[aria-expanded="true"]::after {
  transform: translateY(1px) rotate(180deg);
}

.library-titlebar .sort-toggle[aria-pressed="true"] {
  border-color: rgba(230, 0, 35, 0.45);
  background: rgba(230, 0, 35, 0.22);
}

.library-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(28px, 4vw, 48px);
  overflow: hidden;
  border-radius: 28px;
  color: #ffffff;
  background:
    radial-gradient(circle at 86% 16%, rgba(230, 0, 35, 0.42), transparent 30%),
    linear-gradient(135deg, #101828 0%, #1d2939 62%, #344054 100%);
  box-shadow: var(--shadow-sm);
}

.library-header h2 {
  max-width: 720px;
  margin: 0 0 12px;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.library-header p:not(.eyebrow) {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.8;
}

.settings-subheader {
  margin-top: 22px;
  padding: clamp(22px, 3vw, 34px);
}

.settings-subheader h2 {
  font-size: clamp(30px, 4vw, 48px);
}

.library-badge {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.1);
}

.library-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(2, 0.9fr);
  gap: 16px;
  margin-top: 20px;
}

.library-toolbar {
  margin-top: 14px;
}

.library-toolbar span {
  display: block;
}

.library-toolbar span {
  color: var(--muted);
  font-size: 13px;
}

.library-filter-stack {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.filter-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.filter-row > span {
  height: 36px;
  min-width: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid #e5d8de;
  border-radius: 999px;
  color: var(--primary-2);
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  background: #fff2f4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.style-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.top-filter {
  margin-bottom: 2px;
}

.style-filter button {
  height: 36px;
  padding: 0 13px;
  border: 1px solid #e5d8de;
  border-radius: 999px;
  color: #5f5960;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  background: #ffffff;
}

.style-filter button.active,
.style-filter button:hover {
  border-color: rgba(230, 0, 35, 0.22);
  color: var(--primary-2);
  background: #fff2f4;
}

.style-filter .filter-reclassify-button {
  border-color: rgba(22, 119, 255, 0.26);
  color: #1456a3;
  background: #f3f8ff;
}

.style-filter .filter-reclassify-button:hover {
  border-color: rgba(22, 119, 255, 0.42);
  color: #0f4a8a;
  background: #e8f2ff;
}

.style-filter .trash-filter-button {
  border-color: #d0d5dd;
  color: #475467;
  background: #f8fafc;
}

.style-filter .trash-filter-button.active,
.style-filter .trash-filter-button:hover {
  border-color: rgba(52, 64, 84, 0.28);
  color: #101828;
  background: #eef2f6;
}

.style-filter .hot-filter-button {
  border-color: #d0d5dd;
  color: #475467;
  background: #ffffff;
}

.style-filter .hot-filter-button.active,
.style-filter .hot-filter-button:hover {
  border-color: rgba(52, 64, 84, 0.28);
  color: #101828;
  background: #eef2f6;
}

.ai-commerce-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #edf0f3;
}

.ai-commerce-filter-row strong,
.ai-commerce-filter-row span {
  display: block;
}

.ai-commerce-filter-row strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
}

.ai-commerce-filter-row > div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.ai-commerce-filter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-commerce-filter-actions .run-button {
  width: auto;
  min-width: 96px;
}

.ai-commerce-filter-actions > span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  background: #f2f4f7;
}

.ai-commerce-filter-actions > span[data-state="enabled"] {
  color: #047857;
  background: #ecfdf3;
}

.ai-commerce-filter-actions > span[data-state="disabled"] {
  color: #667085;
  background: #f2f4f7;
}

.style-filter-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.style-filter .style-delete-button {
  width: 28px;
  height: 28px;
  padding: 0;
  border-color: #f0c9d0;
  color: #9f1d32;
  background: #fff7f8;
}

.style-category-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.style-category-form select {
  height: 38px;
  padding: 0 36px 0 12px;
  border: 1px solid #e5d8de;
  border-radius: 999px;
  color: #5f5960;
  font-size: 13px;
  font-weight: 850;
  background: #ffffff;
}

.style-category-form:not(.is-managing) input,
.style-category-form:not(.is-managing) select,
.style-category-form:not(.is-managing) .style-submit-button,
.style-category-form:not(.is-managing) .style-cancel-button {
  display: none;
}

.style-category-form input {
  width: min(260px, 100%);
  height: 38px;
  padding: 0 13px;
  border: 1px solid #e5d8de;
  border-radius: 999px;
  outline: none;
}

.style-category-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(230, 0, 35, 0.1);
}

.style-category-form button {
  height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
  background: var(--primary);
}

.style-category-form .style-manage-toggle {
  position: relative;
  min-width: 112px;
  padding: 0 18px 0 38px;
  overflow: hidden;
  color: #ffffff;
  border: 1px solid rgba(230, 0, 35, 0.28);
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 255, 255, 0.34), transparent 26%),
    linear-gradient(135deg, #e60023 0%, #c9002a 48%, #8f1530 100%);
  box-shadow:
    0 12px 26px rgba(230, 0, 35, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.style-category-form .style-manage-toggle::before {
  position: absolute;
  left: 15px;
  top: 50%;
  width: 16px;
  height: 16px;
  content: "+";
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--primary-2);
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.92);
}

.style-category-form .style-manage-toggle:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
  box-shadow:
    0 16px 34px rgba(230, 0, 35, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.style-category-form .style-manage-toggle:active {
  transform: translateY(0);
  box-shadow:
    0 8px 18px rgba(230, 0, 35, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.style-category-form.is-managing .style-manage-toggle {
  display: none;
}

.style-category-form .style-cancel-button {
  color: #5f5960;
  border: 1px solid #e5d8de;
  background: #ffffff;
}

.style-category-form span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.likes-progress {
  margin-top: 14px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(230, 0, 35, 0.12);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0, rgba(230, 0, 35, 0.1), transparent 34%),
    linear-gradient(135deg, #fffafa 0%, #fff2f4 100%);
  box-shadow: 0 12px 30px rgba(230, 0, 35, 0.08);
}

.likes-progress[hidden] {
  display: none;
}

.likes-progress-top,
.likes-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.likes-progress-top strong {
  color: var(--dark);
  font-size: 15px;
  font-weight: 950;
}

.likes-progress-top span {
  color: var(--primary-2);
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.likes-progress-track {
  height: 12px;
  margin: 12px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(230, 0, 35, 0.1);
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.08);
}

.likes-progress-track span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #ff5a76, var(--primary-2));
  box-shadow: 0 8px 18px rgba(230, 0, 35, 0.26);
  transition: width 0.18s ease;
}

.likes-progress-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, 216px);
  justify-content: center;
  gap: 18px;
  margin-top: 20px;
  contain: layout paint;
}

.trash-training-panel {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #d0d5dd;
  border-radius: 16px;
  background: #f8fafc;
}

.trash-training-panel strong,
.trash-training-panel span {
  display: block;
}

.trash-training-panel strong {
  color: #101828;
  font-size: 15px;
  font-weight: 950;
}

.trash-training-panel span {
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.hot-training-panel {
  align-items: flex-start;
  border-color: rgba(245, 158, 11, 0.28);
  background: #fffbeb;
}

.hot-training-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  max-width: 720px;
}

.hot-url-form {
  display: flex;
  gap: 8px;
}

.hot-url-form input,
.hot-album-name-input {
  width: min(320px, 42vw);
  height: 40px;
  padding: 0 12px;
  border: 1px solid #f2c46d;
  border-radius: 12px;
  color: #101828;
  font-size: 13px;
  font-weight: 750;
  background: #ffffff;
}

.hot-album-name-input {
  width: 112px;
}

.hot-url-form input:focus,
.hot-album-name-input:focus {
  border-color: #d97706;
  outline: 3px solid rgba(245, 158, 11, 0.18);
}

.hot-upload-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  cursor: pointer;
}

.hot-upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.hot-upload-button.is-disabled {
  pointer-events: none;
  opacity: 0.62;
}

.hot-training-status {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  color: #92400e;
  font-size: 12px;
  font-weight: 900;
}

.hot-panel-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hot-panel-back {
  height: 32px;
  padding: 0 12px;
  color: #344054;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  background: #ffffff;
  box-shadow: none;
}

.hot-panel-back:hover,
.hot-panel-back:focus-visible {
  color: #101828;
  border-color: #98a2b3;
  outline: none;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
}

.hot-album-card {
  width: 216px;
  min-height: 246px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  cursor: pointer;
  text-align: left;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.hot-album-card:hover,
.hot-album-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(230, 0, 35, 0.2);
  outline: none;
  box-shadow: 0 18px 40px rgba(16, 24, 40, 0.1);
}

.hot-album-preview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  aspect-ratio: 1 / 1.2;
  overflow: hidden;
  border-radius: 14px;
  background: #f2f4f7;
}

.hot-album-preview img,
.hot-album-preview span {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #eef2f6;
}

.hot-album-meta {
  padding: 12px 4px 2px;
}

.hot-album-meta strong,
.hot-album-meta span {
  display: block;
}

.hot-album-meta strong {
  color: #101828;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.2;
}

.hot-album-meta span {
  margin-top: 5px;
  color: #667085;
  font-size: 12px;
  font-weight: 850;
}

.gallery-item {
  position: relative;
  width: 216px;
  padding: 0;
  border: 1px solid var(--line);
  min-width: 0;
  overflow: hidden;
  contain: layout paint style;
  content-visibility: auto;
  contain-intrinsic-size: auto 440px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.gallery-item.is-removing {
  pointer-events: none;
  opacity: 0;
  transform: scale(0.98);
}

.image-download-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  color: #ffffff;
  text-decoration: none;
  opacity: 1;
  transform: translateY(0) scale(1);
  background: rgba(16, 24, 40, 0.62);
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.26);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.image-download-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gallery-item:hover .image-download-button,
.image-download-button:focus-visible {
  opacity: 1;
  transform: translateY(0) scale(1.03);
}

.image-download-button:hover {
  color: #ffffff;
  opacity: 1;
  transform: translateY(0) scale(1.08);
  border-color: rgba(255, 255, 255, 0.95);
  background: rgba(230, 0, 35, 0.86);
}

.gallery-preview {
  position: relative;
  width: 100%;
  display: block;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px 16px 0 0;
  cursor: zoom-in;
  background: transparent;
}

.gallery-media {
  position: relative;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  background: #f2f4f7;
}

.gallery-official-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 5;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 999px;
  color: #ffffff;
  text-decoration: none;
  background: rgba(6, 95, 70, 0.78);
  box-shadow: 0 12px 24px rgba(16, 24, 40, 0.2);
  backdrop-filter: blur(10px);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.gallery-official-badge svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gallery-official-badge.is-instagram {
  background:
    radial-gradient(circle at 32% 102%, #feda75 0 18%, transparent 34%),
    radial-gradient(circle at 12% 92%, #fa7e1e 0 22%, transparent 42%),
    linear-gradient(135deg, #833ab4 0%, #c13584 42%, #e1306c 68%, #fd1d1d 100%);
}

.gallery-official-badge.is-instagram svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

.gallery-official-badge.is-shein {
  width: 48px;
  color: #111827;
  border-color: rgba(17, 24, 39, 0.14);
  background: rgba(255, 255, 255, 0.92);
}

.gallery-official-wordmark {
  color: currentColor;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
}

.gallery-official-badge:hover,
.gallery-official-badge:focus-visible {
  transform: translateY(-1px) scale(1.06);
  border-color: rgba(255, 255, 255, 0.96);
  outline: none;
  background: rgba(4, 120, 87, 0.92);
}

.gallery-official-badge.is-instagram:hover,
.gallery-official-badge.is-instagram:focus-visible {
  background:
    radial-gradient(circle at 32% 102%, #feda75 0 18%, transparent 34%),
    radial-gradient(circle at 12% 92%, #fa7e1e 0 22%, transparent 42%),
    linear-gradient(135deg, #6f2da8 0%, #b52f7e 42%, #d92b63 68%, #ed1818 100%);
}

.gallery-official-badge.is-shein:hover,
.gallery-official-badge.is-shein:focus-visible {
  border-color: rgba(17, 24, 39, 0.22);
  background: #ffffff;
}

.gallery-top-actions {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: calc(100% - 52px);
}

.gallery-action-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
  background: rgba(16, 24, 40, 0.54);
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.18);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.gallery-action-button:hover,
.gallery-action-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.96);
  outline: none;
  background: rgba(230, 0, 35, 0.78);
}

.gallery-action-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.move-trash-button {
  width: 32px;
  min-height: 32px;
  padding: 0;
}

.move-hot-button {
  width: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  background: rgba(217, 119, 6, 0.78);
}

.move-trash-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.delete-trash-button:hover,
.delete-trash-button:focus-visible,
.delete-hot-button:hover,
.delete-hot-button:focus-visible {
  background: rgba(16, 24, 40, 0.78);
}

.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.12);
}

.gallery-item.is-like-updated {
  border-color: rgba(230, 0, 35, 0.32);
  box-shadow: 0 18px 44px rgba(230, 0, 35, 0.16);
}

.gallery-skeleton {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.skeleton-image,
.skeleton-line {
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(90deg, #f4eef1 0%, #fff7f9 48%, #f4eef1 100%);
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.skeleton-image {
  height: 246px;
}

.skeleton-line {
  width: 62%;
  height: 14px;
}

.skeleton-line.wide {
  width: 88%;
}

@keyframes skeleton-shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

.gallery-item.is-saved {
  border-color: rgba(55, 162, 104, 0.3);
  background: linear-gradient(180deg, #f7fff9 0%, #ffffff 42%, #f2fbf5 100%);
  box-shadow:
    0 0 0 1px rgba(55, 162, 104, 0.18),
    0 14px 34px rgba(55, 162, 104, 0.1);
}

.gallery-item.is-saved:hover {
  box-shadow:
    0 0 0 1px rgba(55, 162, 104, 0.22),
    0 18px 44px rgba(55, 162, 104, 0.14);
}

.gallery-item.is-like-updated .metric-card.likes {
  animation: likePulse 0.9s ease;
}

@keyframes likePulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.is-sidebar-animating .gallery-item {
  pointer-events: none;
  transition: none;
}

.is-gallery-scrolling .gallery-item,
.is-gallery-scrolling .gallery-action-button,
.is-gallery-scrolling .image-download-button,
.is-sidebar-animating .gallery-item,
.is-sidebar-animating .gallery-action-button,
.is-sidebar-animating .image-download-button {
  transition: none;
}

.is-gallery-scrolling .gallery-item:hover,
.is-sidebar-animating .gallery-item:hover {
  transform: none;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.04);
}

.gallery-preview img,
.gallery-preview video {
  width: 100%;
  aspect-ratio: 4 / 5;
  display: block;
  object-fit: cover;
  background: #f2f4f7;
}

.gallery-preview video {
  position: absolute;
  inset: 0;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.gallery-preview video.is-playing {
  opacity: 1;
}

.gallery-item.is-video .gallery-preview {
  position: relative;
}

.gallery-item.is-video .gallery-preview::after {
  content: "视频";
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 950;
  background: rgba(16, 24, 40, 0.68);
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.18);
}

.gallery-item.is-video .gallery-preview::after {
  content: "";
  z-index: 3;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.84);
  background: rgba(16, 24, 40, 0.68);
  box-shadow: 0 12px 24px rgba(16, 24, 40, 0.22);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.gallery-item.is-video .gallery-preview::before {
  content: "";
  position: absolute;
  right: 22px;
  bottom: 21px;
  z-index: 4;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid #ffffff;
  filter: drop-shadow(0 1px 1px rgba(16, 24, 40, 0.18));
  pointer-events: none;
}

.gallery-name {
  display: block;
  padding: 12px 14px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
  padding: 12px 12px 4px;
}

.gallery-stats[data-metric-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-trend-chart {
  margin: 8px 12px 12px;
  padding: 10px 11px 9px;
  border: 1px solid rgba(230, 0, 35, 0.1);
  border-radius: 16px;
  cursor: pointer;
  background: linear-gradient(180deg, #fff7f8 0%, #ffffff 100%);
}

.mini-trend-chart:hover,
.mini-trend-chart:focus-visible {
  border-color: rgba(230, 0, 35, 0.28);
  outline: none;
  box-shadow: 0 0 0 4px rgba(230, 0, 35, 0.08);
}

.mini-trend-head,
.mini-trend-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mini-trend-head span,
.mini-trend-foot span,
.mini-trend-empty span {
  color: #8f3949;
  font-size: 10px;
  font-weight: 950;
}

.mini-trend-head strong,
.mini-trend-empty strong {
  color: #067647;
  font-size: 13px;
  font-weight: 950;
}

.mini-trend-chart svg {
  display: block;
  width: 100%;
  height: 58px;
  margin: 5px 0 2px;
}

.mini-trend-area {
  fill: rgba(18, 183, 106, 0.12);
}

.mini-trend-line {
  fill: none;
  stroke: #12b76a;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini-trend-chart.is-pending {
  border-color: rgba(102, 112, 133, 0.14);
  background: linear-gradient(180deg, #f9fafb 0%, #ffffff 100%);
}

.mini-trend-chart.is-pending .mini-trend-area {
  fill: rgba(102, 112, 133, 0.1);
}

.mini-trend-chart.is-pending .mini-trend-line {
  stroke: #98a2b3;
}

.mini-trend-chart.is-pending .mini-trend-head span,
.mini-trend-chart.is-pending .mini-trend-summary,
.mini-trend-chart.is-pending .mini-trend-summary span:first-child {
  color: #667085;
}

.mini-trend-chart.is-pending .mini-trend-head strong {
  color: #344054;
}

.mini-trend-chart.is-stable {
  border-color: rgba(15, 118, 110, 0.16);
  background: linear-gradient(180deg, #f2fffc 0%, #ffffff 100%);
}

.mini-trend-chart.is-stable .mini-trend-area {
  fill: rgba(15, 118, 110, 0.08);
}

.mini-trend-chart.is-stable .mini-trend-line {
  stroke: #0f766e;
}

.mini-trend-chart.is-stable .mini-trend-head strong {
  color: #0f766e;
}

.mini-trend-foot span {
  color: #667085;
  font-size: 9px;
}

.mini-trend-summary {
  margin-top: 6px;
  color: #344054;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.45;
}

.mini-trend-summary span {
  display: block;
  white-space: nowrap;
}

.mini-trend-summary span:first-child {
  color: #1d2939;
}

.mini-trend-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
}

.mini-trend-empty strong {
  color: #98a2b3;
  font-size: 12px;
}

.metric-card {
  position: relative;
  min-width: 0;
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 58px;
  padding: 10px 6px 9px;
  overflow: hidden;
  border: 1px solid rgba(230, 0, 35, 0.1);
  border-radius: 16px;
  text-align: center;
  background:
    radial-gradient(circle at 92% 10%, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(145deg, #fff7f8 0%, #ffe8ed 100%);
}

.metric-card::before {
  width: 22px;
  height: 22px;
  position: absolute;
  right: -6px;
  top: -6px;
  content: "";
  border-radius: 999px;
  background: rgba(230, 0, 35, 0.12);
}

.gallery-stats[data-metric-count="4"] .metric-card {
  min-height: 50px;
  padding: 8px 6px 7px;
  gap: 4px;
}

.metric-card.visit {
  border-color: rgba(122, 84, 214, 0.12);
  background:
    radial-gradient(circle at 92% 10%, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(145deg, #f7f3ff 0%, #eee7ff 100%);
}

.metric-card.visit::before {
  background: rgba(122, 84, 214, 0.14);
}

.metric-card.comments {
  border-color: rgba(17, 139, 124, 0.14);
  background:
    radial-gradient(circle at 92% 10%, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(145deg, #f0fffb 0%, #dcf7f0 100%);
}

.metric-card.comments::before {
  background: rgba(17, 139, 124, 0.14);
}

.metric-card.repository-save {
  cursor: pointer;
  border-color: rgba(23, 20, 25, 0.12);
  background:
    radial-gradient(circle at 92% 10%, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(145deg, #f8fafc 0%, #edf1f7 100%);
}

.metric-card.repository-save::before {
  background: rgba(23, 20, 25, 0.12);
}

.metric-card.repository-save strong {
  color: #171419;
  font-size: 15px;
}

.metric-card.repository-save em {
  color: #667085;
}

.metric-card.repository-save:disabled {
  cursor: default;
  opacity: 0.72;
}

.metric-card.repository-save.is-saved {
  border-color: rgba(55, 162, 104, 0.34);
  background:
    radial-gradient(circle at 92% 10%, rgba(255, 255, 255, 0.86), transparent 34%),
    linear-gradient(145deg, #effdf4 0%, #dff6e8 100%);
  box-shadow:
    0 0 0 1px rgba(55, 162, 104, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 8px 18px rgba(55, 162, 104, 0.1);
}

.metric-card.repository-save.is-saved::before {
  background: rgba(55, 162, 104, 0.2);
}

.metric-card.repository-save.is-saved strong {
  color: #24824f;
}

.metric-card.repository-save.is-saved em {
  color: #4b9b6b;
}

.gallery-stats strong,
.gallery-stats em {
  display: block;
  position: relative;
  z-index: 1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-stats strong {
  color: var(--primary-2);
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.03em;
}

.metric-card.likes strong {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  font-size: clamp(13px, 1.4vw, 16px);
  letter-spacing: 0;
}

.metric-card.comments strong {
  color: #0f766e;
  font-size: clamp(13px, 1.4vw, 16px);
  letter-spacing: 0;
}

.metric-card.comments em {
  color: #227a70;
}

.gallery-stats em {
  color: #8f3949;
  font-size: 9px;
  font-style: normal;
  font-weight: 950;
  letter-spacing: 0.06em;
}

.metric-card.visit strong {
  color: #5b35b1;
  font-size: 15px;
}

.metric-card.visit em {
  color: #6f5aa5;
}

.gallery-empty {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed #cfd4dc;
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
  background: #ffffff;
}

.gallery-load-sentinel {
  grid-column: 1 / -1;
  min-height: 72px;
  display: grid;
  place-items: center;
}

.gallery-load-more {
  min-width: 180px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  color: #344054;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.06);
}

.gallery-load-more:hover,
.gallery-load-more:focus-visible {
  color: #101828;
  border-color: #98a2b3;
  outline: none;
  box-shadow: 0 16px 32px rgba(16, 24, 40, 0.1);
}

.gallery-load-more:disabled {
  cursor: wait;
  opacity: 0.68;
}

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

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

.trend-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
}

.trend-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(8px);
}

.trend-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(680px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 24px;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.34);
}

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

.trend-modal-head span,
.trend-modal-head strong {
  display: block;
}

.trend-modal-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.trend-modal-head strong {
  margin-top: 4px;
  color: var(--dark);
  font-size: 22px;
  font-weight: 950;
}

.trend-modal-head a {
  padding: 10px 14px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 950;
  text-decoration: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.trend-detail-chart {
  display: block;
  width: 100%;
  height: 320px;
  margin: 4px 0 18px;
  border: 1px solid rgba(230, 0, 35, 0.1);
  border-radius: 22px;
  background:
    linear-gradient(90deg, rgba(230, 0, 35, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(230, 0, 35, 0.04) 1px, transparent 1px),
    #fff7f8;
  background-size: 48px 48px;
}

.trend-detail-area {
  fill: rgba(18, 183, 106, 0.12);
}

.trend-detail-line {
  fill: none;
  stroke: #12b76a;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-detail-points circle {
  fill: #ffffff;
  stroke: #12b76a;
  stroke-width: 3;
}

.trend-axis,
.trend-grid-line {
  stroke: rgba(143, 57, 73, 0.24);
  stroke-width: 1.5;
}

.trend-axis {
  stroke: rgba(52, 64, 84, 0.42);
}

.trend-axis-label {
  fill: #667085;
  font-size: 12px;
  font-weight: 800;
}

.trend-axis-title {
  fill: #8f3949;
  font-size: 13px;
  font-weight: 950;
}

.trend-detail-empty {
  padding: 24px;
  border-radius: 18px;
  color: var(--muted);
  font-weight: 850;
  text-align: center;
  background: #f8fafc;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 42px);
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  cursor: zoom-out;
  background: rgba(16, 24, 40, 0.72);
  backdrop-filter: blur(10px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100vw - 48px));
  height: min(88dvh, 860px);
  max-height: calc(100dvh - 48px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(420px, 30vw, 480px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 26px;
  background: #101828;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.34);
}

.modal-media-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  background: #0b1220;
}

.modal-info {
  position: relative;
  z-index: 1;
  align-self: start;
  justify-self: stretch;
  width: auto;
  min-width: 0;
  padding: 18px 16px;
  color: rgba(255, 255, 255, 0.88);
}

.modal-media-frame {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.modal-media-frame img,
.modal-media-frame video {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  display: block;
  object-fit: contain;
  background: #0b1220;
}

#modalImage[hidden],
#modalVideo[hidden] {
  display: none !important;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  background: rgba(16, 24, 40, 0.72);
  backdrop-filter: blur(12px);
}

.modal-time {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
  white-space: normal;
}

.modal-caption {
  width: 100%;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 780;
  line-height: 1.45;
  white-space: normal;
}

.modal-official-link {
  width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.12);
}

.modal-official-link:hover {
  background: rgba(255, 255, 255, 0.18);
}

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

.modal-comments-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  background: #ffffff;
}

.modal-comments-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
  justify-content: start;
  column-gap: 14px;
  row-gap: 4px;
  min-height: 72px;
  padding: 18px 74px 14px 22px;
  border-bottom: 1px solid #eaecf0;
}

.modal-comments-head strong {
  color: #101828;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.35;
  white-space: nowrap;
}

.modal-comments-head span {
  min-width: 0;
  max-width: none;
  justify-self: start;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.modal-comments-head span.is-translating::after {
  content: " · 翻译中";
  color: #16a34a;
}

.modal-comments-list {
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  padding: 12px 18px 20px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.modal-comments-list::-webkit-scrollbar {
  width: 10px;
}

.modal-comments-list::-webkit-scrollbar-track {
  background: #f2f4f7;
}

.modal-comments-list::-webkit-scrollbar-thumb {
  border: 2px solid #f2f4f7;
  border-radius: 999px;
  background: #cbd5e1;
}

.modal-comment-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  padding: 15px 4px;
  border-bottom: 1px solid #f2f4f7;
}

.modal-comment-avatar {
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 50%;
  background: #eef2f6;
}

.modal-comment-avatar img,
.modal-comment-avatar span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #475467;
  font-size: 13px;
  font-weight: 950;
  object-fit: cover;
}

.modal-comment-body {
  min-width: 0;
}

.modal-comment-author {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 5px;
}

.modal-comment-author strong {
  color: #101828;
  font-size: 13px;
  font-weight: 950;
}

.modal-comment-author em {
  color: #98a2b3;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.modal-comment-item p {
  margin: 0 0 9px;
  color: #1d2939;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-comment-translation {
  margin: -2px 0 9px;
  color: #159947;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-comment-translation.is-pending {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #16a34a;
}

.modal-comment-translation.is-pending::before {
  content: "";
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border: 2px solid rgba(22, 163, 74, 0.22);
  border-top-color: #16a34a;
  border-radius: 50%;
  animation: commentTranslationSpin 0.75s linear infinite;
}

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

.modal-comment-replies {
  margin: -4px 0 0 48px;
  padding-left: 14px;
  border-left: 2px solid #e7f5ec;
}

.modal-comment-item.is-reply {
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-bottom-color: #f6f7f9;
}

.modal-comment-item.is-reply .modal-comment-avatar {
  width: 28px;
  height: 28px;
}

.modal-comment-item.is-reply .modal-comment-author strong {
  font-size: 12px;
}

.modal-comment-item.is-reply p {
  font-size: 12px;
  font-weight: 700;
}

.modal-comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: #667085;
  font-size: 11px;
  font-weight: 850;
}

.modal-comment-meta strong,
.modal-comment-meta em {
  font-style: normal;
  color: #344054;
}

.modal-comments-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 20px;
  color: #667085;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.modal-comments-empty.is-loading {
  align-content: center;
  gap: 12px;
}

.modal-comments-empty.is-loading strong {
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

.modal-comments-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #e4e7ec;
  border-top-color: #e60023;
  border-radius: 50%;
  animation: modalCommentsSpin 0.8s linear infinite;
}

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

.modal-comments-empty small {
  display: block;
  margin-top: 6px;
  color: #98a2b3;
  font-size: 11px;
  font-weight: 750;
}

@media (max-width: 1180px) {
  .modal-dialog {
    width: min(1180px, calc(100vw - 32px));
    grid-template-columns: minmax(0, 1fr) minmax(340px, 380px);
  }
}

@media (max-width: 860px) {
  .modal-dialog {
    width: min(720px, calc(100vw - 20px));
    height: min(92dvh, 900px);
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(180px, 34dvh);
  }

  .modal-media-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .modal-comments-panel {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 0;
  }

  .modal-info {
    width: 100%;
    padding: 12px 14px 8px;
  }

  .modal-media-frame img,
  .modal-media-frame video {
    min-height: 0;
    max-height: none;
  }
}

.library-card,
.empty-library,
.settings-list article {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.04);
}

.library-card {
  min-height: 190px;
  padding: 24px;
}

.library-card.feature {
  background:
    radial-gradient(circle at 100% 0, rgba(230, 0, 35, 0.08), transparent 34%),
    #ffffff;
}

.library-card span {
  display: inline-flex;
  margin-bottom: 28px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.library-card strong {
  display: block;
  margin-bottom: 10px;
  color: var(--dark);
  font-size: 23px;
  letter-spacing: -0.04em;
}

.library-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.empty-library {
  margin-top: 20px;
  padding: 42px 24px;
  display: grid;
  place-items: center;
  text-align: center;
}

.empty-library[hidden] {
  display: none;
}

.empty-visual {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 24px;
  color: #ffffff;
  font-size: 28px;
  font-weight: 950;
  background: linear-gradient(135deg, var(--primary), #ff5a76);
  box-shadow: 0 18px 44px rgba(230, 0, 35, 0.22);
}

.empty-library h3 {
  margin: 0 0 8px;
  color: var(--dark);
  font-size: 24px;
  letter-spacing: -0.04em;
}

.empty-library p {
  max-width: 540px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.settings-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.settings-list article {
  padding: 24px;
}

.settings-list strong,
.settings-list span {
  display: block;
}

.settings-list strong {
  margin-bottom: 12px;
  color: var(--dark);
  font-size: 19px;
  letter-spacing: -0.03em;
}

.settings-list span {
  color: var(--muted);
}

.user-management-card {
  margin-top: 20px;
  padding: clamp(22px, 2.8vw, 34px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.04);
}

.user-management-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(152, 162, 179, 0.22);
}

.user-management-head strong,
.user-management-head span {
  display: block;
}

.user-management-head strong {
  margin-bottom: 6px;
  color: var(--dark);
  font-size: 21px;
  letter-spacing: -0.04em;
}

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

.admin-badge {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--primary) !important;
  font-weight: 900;
  background: rgba(230, 0, 35, 0.08);
}

.user-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.user-create-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(230, 0, 35, 0.14);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(230, 0, 35, 0.04), rgba(248, 250, 252, 0.72));
}

.user-create-form[hidden] {
  display: none;
}

.user-create-form label,
.user-create-form span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.user-create-form input {
  width: 100%;
  height: 42px;
  margin-top: 7px;
  padding: 0 12px;
  border: 1px solid rgba(152, 162, 179, 0.28);
  border-radius: 13px;
  outline: none;
  color: var(--dark);
  background: #ffffff;
}

.user-create-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

.user-create-form button {
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 13px;
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.user-create-form > span {
  grid-column: 1 / -1;
  min-height: 16px;
  color: var(--primary);
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(152, 162, 179, 0.22);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.user-menu-permissions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 420px;
}

.user-menu-permissions label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #e5d8de;
  border-radius: 999px;
  color: #5f5960;
  font-size: 12px;
  font-weight: 850;
  background: #ffffff;
}

.user-menu-permissions input {
  accent-color: var(--primary);
}

.user-password-tools {
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(120px, 180px) auto;
  align-items: center;
  gap: 8px;
}

.user-password-tools input {
  height: 34px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid #e5d8de;
  border-radius: 10px;
  color: var(--dark);
  font-size: 13px;
  font-weight: 800;
  background: #ffffff;
}

.user-password-tools button {
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  border-radius: 10px;
  color: var(--dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  background: #ffffff;
}

.user-password-value {
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

.user-row strong,
.user-row span {
  display: block;
}

.user-row strong {
  color: var(--dark);
  font-size: 17px;
  letter-spacing: -0.03em;
}

.user-row span,
.user-row small {
  color: var(--muted);
  font-size: 13px;
}

.user-row em {
  padding: 7px 11px;
  border-radius: 999px;
  color: #475467;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  background: #f2f4f7;
}

.user-row.is-admin em {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.user-delete-button {
  height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(230, 0, 35, 0.2);
  border-radius: 999px;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  background: #fff2f4;
}

.user-delete-button:hover {
  color: #ffffff;
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.user-row.empty {
  display: block;
  color: var(--muted);
}

.ai-config-card {
  margin-top: 20px;
  padding: clamp(22px, 2.8vw, 34px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.04);
}

.ai-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.oss-option-row {
  margin-top: 16px;
}

.ai-config-grid > div {
  display: grid;
  gap: 8px;
}

.ai-config-grid label {
  color: #2b252b;
  font-size: 13px;
  font-weight: 900;
}

.ai-config-grid input,
.ai-config-grid select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #d8cbd2;
  border-radius: 15px;
  color: #171419;
  outline: none;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.045);
}

.ai-config-grid input:focus,
.ai-config-grid select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 5px rgba(230, 0, 35, 0.12), 0 10px 24px rgba(16, 24, 40, 0.07);
}

.ai-config-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.ai-config-actions .run-button,
.ai-config-actions .test-ai-button {
  width: auto;
  min-width: 120px;
}

.test-ai-button {
  height: 54px;
  padding: 0 22px;
  border: 1px solid #e8b5be;
  border-radius: 16px;
  color: var(--primary-2);
  cursor: pointer;
  font-weight: 950;
  background: #fff2f4;
  box-shadow: 0 10px 26px rgba(230, 0, 35, 0.08);
}

.test-ai-button:hover {
  border-color: rgba(230, 0, 35, 0.28);
  background: rgba(230, 0, 35, 0.1);
}

.ai-config-actions span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.system-settings-card .ai-panel-head {
  margin-bottom: 18px;
}

.system-settings-card .ai-classify-actions {
  margin-top: 18px;
}

.system-settings-card .run-button {
  width: auto;
  min-width: 120px;
}

.danger-settings-card {
  border-color: rgba(230, 0, 35, 0.16);
  background: linear-gradient(135deg, #fffafa 0%, #fff4f6 100%);
}

.admin-only-panel[hidden] {
  display: none;
}

.secondary-danger {
  background: linear-gradient(135deg, #344054, #101828);
  box-shadow: 0 12px 26px rgba(16, 24, 40, 0.16);
}

.secondary-danger:hover,
.secondary-danger:focus-visible {
  background: linear-gradient(135deg, #475467, #101828);
}

.danger-button {
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 950;
  background: linear-gradient(135deg, #e60023, #9f1d32);
  box-shadow: 0 12px 26px rgba(230, 0, 35, 0.22);
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.ai-mascot-widget {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 80;
  display: grid;
  justify-items: end;
  gap: 14px;
  pointer-events: none;
}

.ai-mascot-widget[hidden],
.app-shell:not(.is-logged-in) ~ .ai-mascot-widget,
.app-shell.is-auth-checking ~ .ai-mascot-widget {
  display: none !important;
}

.ai-mascot-button,
.ai-mascot-panel {
  pointer-events: auto;
}

.ai-mascot-button {
  position: relative;
  width: 86px;
  height: 86px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #ffffff;
  background: transparent;
  box-shadow: none;
}

.ai-mascot-button::before,
.ai-mascot-button::after {
  display: none;
}

.ai-mascot-button::before {
  left: 25px;
  transform: rotate(10deg);
}

.ai-mascot-button::after {
  right: 25px;
  transform: rotate(-10deg);
}

.qilin-aura {
  position: absolute;
  inset: 7px;
  z-index: 0;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 50%, rgba(230, 0, 35, 0.22), rgba(230, 0, 35, 0.08) 48%, transparent 70%);
  filter: blur(2px);
}

.qilin-head {
  position: absolute;
  inset: 12px 10px 8px;
  z-index: 3;
  overflow: hidden;
  border-radius: 32px 32px 30px 30px;
  background:
    radial-gradient(circle at 31% 23%, rgba(255, 255, 255, 0.58) 0 9px, transparent 10px),
    radial-gradient(circle at 50% 82%, #ffd7de 0 15px, transparent 16px),
    linear-gradient(145deg, #ff7184 0%, #e60023 50%, #921631 100%);
  box-shadow: 0 18px 42px rgba(121, 15, 42, 0.34), inset 0 7px 12px rgba(255, 255, 255, 0.24), inset 0 -12px 18px rgba(75, 10, 29, 0.18);
}

.qilin-head::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 11px;
  width: 20px;
  height: 6px;
  transform: translateX(-50%);
  border-radius: 0 0 999px 999px;
  border-bottom: 3px solid rgba(106, 14, 39, 0.7);
}

.qilin-forehead {
  position: absolute;
  top: 9px;
  left: 50%;
  width: 18px;
  height: 28px;
  transform: translateX(-50%);
  border-radius: 999px 999px 12px 12px;
  background: linear-gradient(180deg, #fff4f6, #ff9dad 58%, #b91439);
  opacity: 0.92;
}

.ai-mascot-face {
  position: absolute;
  left: 50%;
  bottom: 13px;
  z-index: 4;
  width: 25px;
  height: 16px;
  transform: translateX(-50%);
  border-radius: 999px 999px 14px 14px;
  background: linear-gradient(180deg, #ffe4e9, #ffc1cb);
}

.qilin-horn {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 2;
  width: 18px;
  height: 30px;
  transform: translateX(-50%);
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, #fff2f5 0%, #ff8fa0 45%, #be123c 100%);
  box-shadow: 0 6px 14px rgba(126, 16, 45, 0.18), inset 0 -5px 0 rgba(115, 13, 39, 0.12);
}

.qilin-ear {
  position: absolute;
  top: 24px;
  z-index: 1;
  width: 27px;
  height: 34px;
  border-radius: 20px 20px 7px 20px;
  background: linear-gradient(145deg, #ffb3bf 0%, #e60023 58%, #971631 100%);
  box-shadow: inset 5px 4px 0 rgba(255, 234, 237, 0.32);
}

.qilin-ear.left {
  left: 2px;
  transform: rotate(-28deg);
}

.qilin-ear.right {
  right: 2px;
  transform: rotate(28deg) scaleX(-1);
}

.qilin-eye {
  position: absolute;
  top: 29px;
  z-index: 5;
  width: 8px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 28%, #ffffff 0 2px, transparent 2.5px), #231017;
}

.qilin-eye.left {
  left: 20px;
}

.qilin-eye.right {
  right: 20px;
}

.ai-mascot-dot {
  position: absolute;
  right: 5px;
  top: 8px;
  z-index: 5;
  width: 14px;
  height: 14px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: #12b76a;
}

.ai-mascot-panel {
  width: min(360px, calc(100vw - 32px));
  height: calc(100vh - 108px);
  min-height: 640px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid rgba(230, 0, 35, 0.16);
  border-radius: 30px;
  background: linear-gradient(180deg, #fff7f8 0%, #ffffff 42%);
  box-shadow: 0 30px 80px rgba(16, 24, 40, 0.24);
}

.ai-mascot-panel[hidden] {
  display: none;
}

.ai-mascot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(230, 0, 35, 0.1);
}

.ai-mascot-head strong,
.ai-mascot-head span {
  display: block;
}

.ai-mascot-head strong {
  color: #171419;
  font-size: 18px;
  font-weight: 950;
}

.ai-mascot-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ai-mascot-head button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  color: #7a2638;
  cursor: pointer;
  font-size: 22px;
  background: #ffe8ed;
}

.ai-mascot-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  overflow-y: auto;
}

.ai-mascot-message {
  max-width: 86%;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 18px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.5;
  font-size: 13px;
  font-weight: 750;
}

.ai-mascot-image-link {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 8px 0 2px;
  overflow: hidden;
  border-radius: 16px;
  background: #f7e6ea;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.12);
}

.ai-mascot-image-link img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.ai-mascot-message.assistant {
  align-self: flex-start;
  color: #34252b;
  background: #fff0f3;
}

.ai-mascot-message.user {
  align-self: flex-end;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.ai-mascot-image-grid {
  align-self: flex-start;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.ai-mascot-image-card {
  min-width: 0;
  padding: 9px;
  border-radius: 18px;
  background: #fff0f3;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
}

.ai-mascot-image-card strong,
.ai-mascot-image-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-mascot-image-card strong {
  color: #2b252b;
  font-size: 12px;
  font-weight: 950;
}

.ai-mascot-image-card span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ai-mascot-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid rgba(230, 0, 35, 0.1);
  background: #ffffff;
}

.ai-mascot-form textarea {
  width: 100%;
  resize: none;
  padding: 12px 13px;
  border: 1px solid #ead3d9;
  border-radius: 18px;
  outline: none;
  color: #171419;
  font: inherit;
  font-size: 13px;
}

.ai-mascot-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(230, 0, 35, 0.1);
}

.ai-mascot-form button {
  align-self: end;
  height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 950;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.ai-classify-panel {
  margin-top: 16px;
}

.ai-panel-head strong,
.ai-panel-head span {
  display: block;
}

.ai-panel-head strong {
  margin-bottom: 7px;
  color: var(--dark);
  font-size: 20px;
  letter-spacing: -0.03em;
}

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

.ai-classify-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.ai-classify-actions .run-button {
  width: auto;
  min-width: 120px;
}

.ai-switch {
  height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid #e5d8de;
  border-radius: 999px;
  color: var(--dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  background: #fffafa;
}

.ai-switch input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.ai-classify-actions > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 980px) {
  body {
    padding: 14px;
    overflow: auto;
  }

  .app-shell {
    width: min(720px, calc(100vw - 28px));
    height: auto;
    min-height: calc(100dvh - 28px);
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .form-panel {
    min-height: min(520px, 58dvh);
  }

  .hero-panel {
    gap: 42px;
  }

  .security-card {
    display: none;
  }

  .is-logged-in {
    width: 100vw;
    height: 100dvh;
    min-height: 100dvh;
  }

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

  .is-logged-in .tool-panel {
    grid-template-rows: 64px minmax(0, 1fr);
  }

  .dashboard-layout,
  .is-sidebar-collapsed .dashboard-layout {
    flex-direction: column;
  }

  .sidebar-menu {
    width: 100%;
    min-height: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-menu nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
  }

  .is-sidebar-collapsed .sidebar-menu {
    width: 100%;
    padding: 12px;
  }

  .is-sidebar-collapsed .sidebar-menu nav a strong {
    display: inline;
    opacity: 1;
    transform: none;
  }

  .sidebar-menu nav a {
    justify-content: center;
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    grid-template-columns: repeat(3, 1fr);
  }

  .library-grid,
  .image-gallery,
  .settings-list,
  .user-create-form {
    grid-template-columns: 1fr;
  }

  .user-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .user-menu-permissions {
    justify-content: flex-start;
    max-width: none;
  }

  .user-password-tools {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .ai-config-grid {
    grid-template-columns: 1fr;
  }

  .insight-column {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
  }

  .activity-card,
  .tips-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  body {
    padding: 0;
    overflow: auto;
    background:
      radial-gradient(circle at 50% 0, rgba(148, 163, 184, 0.12), transparent 30%),
      linear-gradient(180deg, #050509 0%, #111216 58%, #17181d 100%);
  }

  .app-shell,
  .is-logged-in {
    width: 100%;
    height: auto;
    min-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .is-logged-in {
    height: 100dvh;
    min-height: 100dvh;
  }

  .hero-panel {
    min-height: 28dvh;
    padding: 22px;
    border-radius: 0 0 26px 26px;
  }

  .form-panel {
    min-height: auto;
    padding: 18px 18px 28px;
  }

  .form-panel::before {
    display: none;
  }

  .form-card {
    width: 100%;
    padding: 22px;
    border-radius: 24px;
  }

  .form-card::before,
  .form-panel::after {
    display: none;
  }

  .hero-content h1 {
    font-size: clamp(34px, 11vw, 48px);
  }

  .hero-text,
  .stats-card,
  .nav-link,
  .form-badge {
    display: none;
  }

  .form-header {
    margin-bottom: 18px;
  }

  .form-header h2 {
    font-size: clamp(28px, 9vw, 38px);
  }

  .input-wrap input,
  .scrape-form input,
  .scrape-form select,
  .login-button,
  .register-button {
    height: 48px;
  }

  .auth-actions {
    gap: 10px;
  }

  .login-creative-card {
    grid-template-columns: 1fr;
    margin-top: 16px;
  }

  .pin-stack {
    display: none;
  }

  .dashboard-main {
    padding: 12px;
    gap: 12px;
  }

  .sidebar-brand {
    display: none;
  }

  .sidebar-toggle {
    display: none;
  }

  .dashboard-topbar {
    min-height: 58px;
    border-radius: 18px;
  }

  .dashboard-brand small {
    display: none;
  }

  .dashboard-topbar {
    flex-wrap: wrap;
  }

  .top-nav {
    order: 3;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .top-nav a {
    padding: 9px 10px;
    text-align: center;
  }

  .dashboard-hero {
    padding: 24px;
    border-radius: 22px;
  }

  .hero-actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .hero-actions article {
    padding: 14px;
  }

  .library-header {
    display: block;
    padding: 24px;
    border-radius: 22px;
  }

  .library-badge {
    margin-top: 18px;
  }

  .library-toolbar {
    margin-top: 12px;
  }

  .library-titlebar {
    display: grid;
  }

  .library-panel-head {
    display: grid;
  }

  .library-titlebar button {
    width: 100%;
  }

  .library-surface {
    padding: 18px;
    border-radius: 22px;
  }

  .image-gallery {
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    justify-content: center;
    gap: 12px;
  }

  .gallery-item {
    width: 100%;
  }

  .gallery-stats {
    gap: 6px;
    padding: 10px 10px 4px;
  }

  .metric-card {
    min-height: 54px;
    border-radius: 14px;
  }

  .gallery-stats strong,
  .metric-card.visit strong,
  .metric-card.repository-save strong {
    font-size: 14px;
  }

  .gallery-stats em {
    font-size: 8px;
    letter-spacing: 0.04em;
  }

  .dashboard-hero h2 {
    font-size: clamp(30px, 10vw, 42px);
  }

  .dashboard-hero p:not(.eyebrow) {
    font-size: 14px;
  }

  .tool-card,
  .activity-card,
  .status-card {
    padding: 18px;
    border-radius: 20px;
  }

  .section-title h3 {
    font-size: 20px;
  }

  .form-grid,
  .insight-column,
  .mini-grid,
  .library-grid,
  .settings-list {
    grid-template-columns: 1fr;
  }

  .task-output {
    min-height: 140px;
    max-height: 220px;
  }
}

@media (max-height: 720px) and (min-width: 981px) {
  .app-shell {
    height: calc(100dvh - 32px);
    margin: 16px auto;
  }

  .hero-panel,
  .form-panel {
    min-height: 0;
  }

  .hero-content h1 {
    font-size: clamp(40px, 5vw, 64px);
  }

  .security-card {
    display: none;
  }
}

/* Local enterprise UI refresh. Keep this block local-only until the server UI is approved. */
:root {
  --page: #f5f7fb;
  --ink: #101828;
  --muted: #667085;
  --soft: #98a2b3;
  --line: #e4e7ec;
  --card: #ffffff;
  --primary: #e60023;
  --primary-2: #c9002a;
  --dark: #101828;
  --dark-2: #344054;
  --ring: rgba(230, 0, 35, 0.14);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 24px 70px rgba(16, 24, 40, 0.16);
  --enterprise-blue: #2563eb;
  --enterprise-green: #059669;
  --enterprise-violet: #7c3aed;
}

html {
  background: #f5f7fb;
}

body:has(.is-logged-in),
body:has(.app-shell.is-auth-checking) {
  background: #f5f7fb;
}

button:hover {
  transform: none;
}

.is-logged-in,
.app-shell.is-auth-checking {
  background: #f5f7fb;
}

.is-logged-in .tool-panel,
.app-shell.is-auth-checking .tool-panel {
  grid-template-rows: 64px minmax(0, 1fr);
  background: #f5f7fb;
}

.app-navbar {
  height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid #e4e7ec;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
  backdrop-filter: blur(14px);
}

.app-navbar-brand {
  gap: 10px;
  color: #101828;
}

.app-navbar-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(230, 0, 35, 0.12);
}

.app-navbar-brand strong {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
}

.user-menu {
  gap: 12px;
}

.user-name {
  min-width: 84px;
  align-items: flex-end;
}

.user-name > strong {
  color: #101828;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0;
}

.user-name > span {
  color: #e60023;
  font-size: 11px;
  font-weight: 900;
}

.user-menu .logout-button,
.logout-button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  color: #344054;
  background: #ffffff;
  box-shadow: none;
}

.user-menu .logout-button:hover,
.logout-button:hover {
  color: #101828;
  border-color: #98a2b3;
  background: #f9fafb;
  box-shadow: none;
}

.dashboard-layout {
  background: #f5f7fb;
}

.sidebar-menu {
  width: 232px;
  padding: 18px 14px;
  border-right: 1px solid #e4e7ec;
  background: #ffffff;
  box-shadow: 1px 0 0 rgba(16, 24, 40, 0.02);
}

.is-sidebar-collapsed .sidebar-menu {
  width: 78px;
  padding: 18px 10px;
}

.sidebar-toggle {
  width: 34px;
  height: 34px;
  border-color: #d0d5dd;
  border-radius: 10px;
  color: #475467;
  font-size: 22px;
  background: #ffffff;
  box-shadow: none;
}

.sidebar-toggle:hover {
  color: #101828;
  border-color: #98a2b3;
  background: #f9fafb;
  transform: none;
}

.sidebar-menu nav {
  gap: 4px;
}

.sidebar-menu nav a {
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  color: #475467;
  font-size: 14px;
  font-weight: 800;
  box-shadow: none;
}

.sidebar-menu nav a span {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  color: #667085;
  background: #f2f4f7;
}

.sidebar-menu nav a:hover {
  color: #101828;
  background: #f9fafb;
  box-shadow: none;
}

.sidebar-menu nav a.active {
  color: #e60023;
  background: #fff1f3;
  box-shadow: inset 3px 0 0 #e60023;
}

.sidebar-menu nav a.active span {
  color: #e60023;
  background: #ffe4e8;
}

.dashboard-main {
  padding: 20px 24px 28px;
  gap: 16px;
  background: #f5f7fb;
}

.dashboard-main::-webkit-scrollbar,
.library-date-options::-webkit-scrollbar,
.trend-sort-options::-webkit-scrollbar,
.task-output::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.dashboard-main::-webkit-scrollbar-thumb,
.library-date-options::-webkit-scrollbar-thumb,
.trend-sort-options::-webkit-scrollbar-thumb,
.task-output::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(102, 112, 133, 0.42);
  background-clip: padding-box;
}

.library-titlebar,
.dashboard-hero {
  min-height: auto;
  padding: 18px 22px;
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  color: #101828;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.library-titlebar::after,
.dashboard-hero::after {
  display: none;
}

.library-titlebar h2,
.dashboard-hero h2 {
  margin: 0;
  color: #101828;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0;
}

.library-titlebar p,
.dashboard-hero p:not(.eyebrow) {
  margin-top: 6px;
  color: #667085;
  line-height: 1.55;
}

.library-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.library-titlebar button,
.task-board-actions button,
.task-actions button,
.style-category-form button,
.quick-presets button,
.gallery-load-more,
.run-button,
.hot-upload-button {
  height: 36px;
  padding: 0 13px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  color: #344054;
  font-size: 13px;
  font-weight: 850;
  background: #ffffff;
  box-shadow: none;
  backdrop-filter: none;
}

.library-titlebar button:hover,
.task-board-actions button:hover,
.task-actions button:hover,
.style-category-form button:hover,
.quick-presets button:hover,
.gallery-load-more:hover {
  color: #101828;
  border-color: #98a2b3;
  background: #f9fafb;
  box-shadow: none;
}

.library-titlebar #refreshLibrary,
.library-titlebar #refreshRepository,
.style-category-form .style-manage-toggle,
.run-button {
  color: #ffffff;
  border-color: #e60023;
  background: #e60023;
}

.library-titlebar #refreshLibrary:hover,
.library-titlebar #refreshRepository:hover,
.style-category-form .style-manage-toggle:hover,
.run-button:hover {
  color: #ffffff;
  border-color: #c9002a;
  background: #c9002a;
  box-shadow: 0 8px 18px rgba(230, 0, 35, 0.16);
}

.style-category-form .style-manage-toggle {
  min-width: 104px;
  padding-left: 34px;
  overflow: hidden;
}

.style-category-form .style-manage-toggle::before {
  left: 12px;
  color: #e60023;
  background: #ffffff;
}

.library-date-options,
.trend-sort-options {
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 20px 48px rgba(16, 24, 40, 0.16);
  backdrop-filter: none;
}

.library-date-options .date-option,
.trend-sort-options button {
  color: #344054;
  border-radius: 8px;
  background: transparent;
}

.library-date-options .date-option em {
  color: #667085;
  background: #f2f4f7;
}

.library-date-options .date-option.all,
.library-date-options .date-option.active,
.library-date-options .date-option:hover,
.trend-sort-options button[aria-pressed="true"],
.trend-sort-options button:hover {
  color: #101828;
  border-color: transparent;
  background: #f2f4f7;
}

.library-surface,
.task-board,
.tool-card,
.activity-card,
.status-card,
.mini-grid article,
.tips-card {
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.library-surface {
  min-height: 100%;
  margin-top: 14px;
  padding: 18px;
  background: #ffffff;
}

.library-panel-head {
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid #eaecf0;
}

.library-panel-head strong {
  margin-bottom: 3px;
  color: #101828;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
}

.library-panel-head span {
  color: #667085;
}

.library-panel-head > span {
  height: 28px;
  border: 1px solid #dbe4ff;
  border-radius: 999px;
  color: #1d4ed8;
  font-size: 12px;
  letter-spacing: 0;
  background: #eff6ff;
}

.library-toolbar {
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid #eaecf0;
  border-radius: 10px;
  background: #f9fafb;
}

.library-toolbar span {
  color: #667085;
  font-size: 12px;
  font-weight: 750;
}

.library-filter-stack {
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #eaecf0;
  border-radius: 12px;
  background: #fcfcfd;
}

.filter-row {
  align-items: center;
  gap: 8px;
}

.filter-row > span {
  min-width: 48px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  color: #475467;
  font-size: 12px;
  font-weight: 900;
  background: #f2f4f7;
  box-shadow: none;
}

.style-filter {
  gap: 8px;
}

.style-filter button,
.style-category-form select,
.style-category-form input {
  height: 30px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  background: #ffffff;
  box-shadow: none;
}

.style-filter button {
  padding: 0 10px;
}

.style-filter button.active,
.style-filter button:hover,
.style-filter .hot-filter-button.active,
.style-filter .hot-filter-button:hover,
.style-filter .trash-filter-button.active,
.style-filter .trash-filter-button:hover {
  border-color: rgba(230, 0, 35, 0.22);
  color: #c9002a;
  background: #fff1f3;
}

.style-filter .filter-reclassify-button,
.style-filter .filter-reclassify-button:hover {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
}

.style-category-form {
  margin-top: 10px;
}

.style-category-form .style-cancel-button {
  color: #344054;
  border-color: #d0d5dd;
  background: #ffffff;
}

.likes-progress {
  margin-top: 12px;
  padding: 13px;
  border: 1px solid #fecdd3;
  border-radius: 12px;
  background: #fff7f8;
  box-shadow: none;
}

.likes-progress-top strong {
  color: #101828;
  font-size: 14px;
}

.likes-progress-top span {
  color: #c9002a;
  font-size: 16px;
  letter-spacing: 0;
}

.likes-progress-track {
  height: 8px;
  background: #ffe4e8;
  box-shadow: none;
}

.likes-progress-track span {
  background: #e60023;
  box-shadow: none;
}

.image-gallery {
  grid-template-columns: repeat(auto-fill, minmax(206px, 1fr));
  justify-content: stretch;
  align-items: start;
  gap: 16px;
  margin-top: 16px;
}

.gallery-item {
  width: 100%;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.gallery-item:hover {
  transform: none;
  border-color: #cfd4dc;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.10);
}

.gallery-media,
.gallery-preview {
  border-radius: 12px 12px 0 0;
  background: #f2f4f7;
}

.gallery-preview img,
.gallery-preview video {
  background: #f2f4f7;
}

.gallery-top-actions {
  top: 8px;
  left: 8px;
  gap: 5px;
}

.gallery-action-button,
.image-download-button,
.gallery-official-badge {
  border-color: rgba(255, 255, 255, 0.86);
  background: rgba(16, 24, 40, 0.58);
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.18);
}

.gallery-action-button {
  min-height: 28px;
  border-radius: 8px;
  font-size: 11px;
}

.move-trash-button,
.move-hot-button {
  width: 30px;
  min-height: 30px;
}

.image-download-button,
.gallery-official-badge {
  width: 34px;
  height: 34px;
}

.image-download-button:hover,
.gallery-action-button:hover,
.gallery-action-button:focus-visible {
  transform: none;
  background: rgba(230, 0, 35, 0.86);
}

.gallery-official-badge {
  left: 8px;
  bottom: 8px;
  background: rgba(5, 150, 105, 0.86);
}

.gallery-official-badge:hover,
.gallery-official-badge:focus-visible {
  transform: none;
  background: rgba(4, 120, 87, 0.94);
}

.gallery-stats {
  gap: 8px;
  padding: 10px 10px 4px;
}

.metric-card {
  min-height: 52px;
  padding: 8px 6px;
  border-radius: 10px;
  box-shadow: none;
  background: #fff7f8;
}

.metric-card::before {
  display: none;
}

.metric-card.likes {
  border-color: #fecdd3;
  background: #fff7f8;
}

.metric-card.comments {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.metric-card.visit {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.metric-card.repository-save {
  border-color: #d0d5dd;
  background: #f9fafb;
}

.metric-card.repository-save.is-saved {
  border-color: #86efac;
  background: #f0fdf4;
  box-shadow: none;
}

.gallery-stats em {
  color: #667085;
  font-size: 10px;
  letter-spacing: 0;
}

.gallery-stats strong,
.metric-card.likes strong,
.metric-card.comments strong,
.metric-card.visit strong,
.metric-card.repository-save strong {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
}

.metric-card.likes strong {
  color: #c9002a;
}

.metric-card.comments strong {
  color: #047857;
}

.metric-card.visit strong {
  color: #1d4ed8;
}

.metric-card.repository-save strong {
  color: #101828;
}

.mini-trend-chart {
  margin: 8px 10px 10px;
  padding: 9px 10px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #fcfcfd;
}

.mini-trend-chart:hover,
.mini-trend-chart:focus-visible {
  border-color: #cfd4dc;
  box-shadow: 0 0 0 4px rgba(16, 24, 40, 0.04);
}

.mini-trend-head span,
.mini-trend-foot span,
.mini-trend-empty span {
  color: #667085;
}

.mini-trend-head strong,
.mini-trend-empty strong {
  color: #047857;
}

.skeleton-image,
.skeleton-line {
  background: linear-gradient(90deg, #f2f4f7 0%, #ffffff 48%, #f2f4f7 100%);
  background-size: 220% 100%;
}

.gallery-item.is-saved {
  border-color: #86efac;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(5, 150, 105, 0.12), 0 10px 28px rgba(5, 150, 105, 0.08);
}

.gallery-item.is-like-updated {
  border-color: #fda4af;
  box-shadow: 0 0 0 1px rgba(230, 0, 35, 0.12), 0 10px 28px rgba(230, 0, 35, 0.08);
}

.task-board,
.tool-card,
.activity-card {
  padding: 18px;
}

.section-title h3,
.task-board-head strong {
  color: #101828;
  font-size: 18px;
  letter-spacing: 0;
}

.section-title > span {
  border-radius: 10px;
  color: #e60023;
  background: #fff1f3;
}

.task-form-panel {
  border-color: #e4e7ec;
  border-radius: 12px;
  background: #fcfcfd;
  box-shadow: none;
}

.task-form-panel input,
.task-form-panel select {
  border-color: #d0d5dd;
  border-radius: 10px;
  box-shadow: none;
}

.task-form-panel input:focus,
.task-form-panel select:focus,
.style-category-form input:focus,
.style-category-form select:focus {
  border-color: #e60023;
  box-shadow: 0 0 0 4px rgba(230, 0, 35, 0.10);
}

.quick-presets {
  border-color: #e4e7ec;
  border-radius: 12px;
  background: #ffffff;
}

.task-output {
  border-color: #1d2939;
  border-radius: 12px;
  color: #e4e7ec;
  background: #101828;
}

.ai-mascot-widget {
  right: 12px;
  bottom: 10px;
  gap: 10px;
}

.ai-mascot-button {
  width: 62px;
  height: 62px;
}

.qilin-aura {
  inset: 4px;
}

.qilin-head {
  inset: 9px 7px 6px;
  border-radius: 24px 24px 22px 22px;
}

.qilin-forehead {
  top: 6px;
  width: 13px;
  height: 20px;
}

.qilin-horn {
  width: 13px;
  height: 22px;
}

.qilin-ear {
  top: 18px;
  width: 20px;
  height: 25px;
}

.qilin-eye {
  top: 22px;
  width: 6px;
  height: 8px;
}

.qilin-eye.left {
  left: 15px;
}

.qilin-eye.right {
  right: 15px;
}

.ai-mascot-face {
  bottom: 9px;
  width: 19px;
  height: 12px;
}

.ai-mascot-dot {
  right: 2px;
  top: 5px;
  width: 11px;
  height: 11px;
  border-width: 2px;
}

.ai-mascot-panel {
  width: min(360px, calc(100vw - 24px));
  height: min(700px, calc(100vh - 84px));
  min-height: 0;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.22);
}

.ui-button {
  position: relative;
  user-select: none;
}

.ui-button.is-pressed {
  transform: translateY(1px);
}

.ui-button.is-disabled,
.ui-button:disabled,
.run-button:disabled,
.danger-button:disabled,
.gallery-load-more:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  filter: grayscale(0.12);
  box-shadow: none !important;
}

.ui-button.is-busy::after,
.run-button.is-busy::after,
.library-titlebar button.is-busy::after {
  width: 13px;
  height: 13px;
  margin-left: 8px;
  content: "";
  display: inline-block;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: ui-spin 0.7s linear infinite;
}

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

.ui-control {
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.ui-control.is-focused,
.ui-control:focus-visible,
.task-form-panel input:focus,
.task-form-panel select:focus,
.style-category-form input:focus,
.style-category-form select:focus,
.ai-config-grid input:focus,
.ai-config-grid select:focus,
.user-create-form input:focus,
.hot-url-form input:focus,
.hot-album-name-input:focus,
.ai-mascot-form textarea:focus {
  outline: none;
  border-color: #e60023 !important;
  box-shadow: 0 0 0 4px rgba(230, 0, 35, 0.10) !important;
  background: #ffffff;
}

.ui-control.is-invalid,
.ui-control[aria-invalid="true"] {
  border-color: #f04438 !important;
  background: #fff8f7 !important;
  box-shadow: 0 0 0 4px rgba(240, 68, 56, 0.10) !important;
}

.ui-control.is-empty:not(:focus):not(.has-value)::placeholder {
  color: #98a2b3;
}

.ui-select {
  cursor: pointer;
}

.ui-choice {
  cursor: pointer;
  accent-color: #e60023;
}

.ui-dropdown {
  position: relative;
}

.ui-dropdown > [aria-expanded="true"] {
  border-color: #e60023 !important;
  color: #c9002a !important;
  background: #fff1f3 !important;
}

.ui-dropdown-panel {
  transform-origin: top right;
  animation: ui-dropdown-in 0.14s ease both;
}

.ui-dropdown-option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

@keyframes ui-dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Local final guard: this block intentionally wins over older local overrides. */
.gallery-media,
.gallery-preview,
.gallery-preview img,
.gallery-preview video {
  aspect-ratio: 4 / 5 !important;
}

.gallery-media {
  min-height: 0;
  background: #eef2f6;
}

.gallery-preview img {
  opacity: 0;
  transition: opacity 0.18s ease;
}

.gallery-preview img.is-loaded,
.gallery-preview img.is-image-unavailable {
  opacity: 1;
}

.gallery-preview img.is-image-unavailable {
  object-fit: contain;
  background: linear-gradient(135deg, #f2f4f7, #ffffff);
}

.library-date-options,
.trend-sort-options,
.ui-dropdown-panel {
  z-index: 180 !important;
  color: #101828 !important;
  background: #ffffff !important;
  border: 1px solid #d0d5dd !important;
  box-shadow: 0 18px 46px rgba(16, 24, 40, 0.18) !important;
  backdrop-filter: none !important;
}

.library-date-options,
.ui-dropdown-panel {
  width: min(260px, calc(100vw - 32px));
  max-height: min(440px, calc(100vh - 120px));
  overflow: auto;
}

.trend-sort-options {
  min-width: 150px;
}

.library-date-options *,
.trend-sort-options *,
.ui-dropdown-panel * {
  color: inherit;
}

.library-date-options .date-option,
.trend-sort-options button,
.ui-dropdown-option {
  color: #344054 !important;
  background: transparent !important;
}

.date-options-head strong,
.date-options-head span,
.date-options-group,
.date-options-empty {
  color: #667085 !important;
  background: #ffffff !important;
}

.date-options-head strong {
  color: #101828 !important;
}

.library-date-options .date-option em {
  color: #475467 !important;
  background: #f2f4f7 !important;
}

.library-date-options .date-option.active,
.library-date-options .date-option:hover,
.trend-sort-options button[aria-pressed="true"],
.trend-sort-options button:hover,
.ui-dropdown-option:hover,
.ui-dropdown-option:focus-visible {
  color: #101828 !important;
  background: #f2f4f7 !important;
}

/* Local ultimate guard: keep media and dropdowns stable after every legacy override. */
.gallery-media {
  position: relative;
  isolation: isolate;
  background: #eef2f6 !important;
}

.gallery-media::before,
.gallery-media::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.gallery-media::before {
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(238, 242, 246, 0.92)),
    #eef2f6;
  opacity: 1;
  transition: opacity 0.18s ease;
}

.gallery-media::after {
  top: 50%;
  left: 18%;
  right: 18%;
  z-index: 1;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e4e7ec 0%, #f8fafc 45%, #e4e7ec 100%);
  background-size: 220% 100%;
  opacity: 0.88;
  transform: translateY(-50%);
  animation: gallery-skeleton-sweep 1.1s ease-in-out infinite;
}

.gallery-media.is-media-loaded::before,
.gallery-media.has-video::before,
.gallery-media.is-media-unavailable::before,
.gallery-media.is-media-loaded::after,
.gallery-media.has-video::after,
.gallery-media.is-media-unavailable::after {
  opacity: 0;
}

.gallery-preview {
  position: relative;
  z-index: 2;
  min-height: 0;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  background: transparent !important;
}

.gallery-preview img.gallery-lazy-image,
.gallery-preview img.gallery-video-poster {
  position: relative;
  z-index: 1;
  display: block;
  color: transparent !important;
  font-size: 0 !important;
  opacity: 0 !important;
  transition: opacity 0.18s ease;
}

.gallery-preview img.gallery-lazy-image.is-loaded,
.gallery-preview img.gallery-video-poster.is-loaded {
  opacity: 1 !important;
}

.gallery-preview img.gallery-lazy-image.is-image-unavailable,
.gallery-preview img.gallery-video-poster.is-image-unavailable {
  opacity: 0 !important;
}

.library-date-options,
.trend-sort-options,
.ui-dropdown-panel {
  z-index: 220 !important;
  min-width: 196px;
  padding: 8px !important;
  color: #101828 !important;
  background: #ffffff !important;
  border: 1px solid #d0d5dd !important;
  border-radius: 14px !important;
  box-shadow: 0 18px 48px rgba(16, 24, 40, 0.18) !important;
  backdrop-filter: none !important;
}

.library-date-options[hidden],
.trend-sort-options[hidden],
.ui-dropdown-panel[hidden] {
  display: none !important;
}

.library-date-options *,
.trend-sort-options *,
.ui-dropdown-panel * {
  color: #101828 !important;
  opacity: 1 !important;
  text-shadow: none !important;
  -webkit-text-fill-color: currentColor;
}

.library-date-options .date-option,
.trend-sort-options button,
.ui-dropdown-option {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px !important;
  border: 0 !important;
  border-radius: 10px !important;
  color: #344054 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  text-align: left;
  background: transparent !important;
  box-shadow: none !important;
}

.library-date-options .date-option.active,
.library-date-options .date-option:hover,
.library-date-options .date-option:focus-visible,
.trend-sort-options button[aria-pressed="true"],
.trend-sort-options button:hover,
.trend-sort-options button:focus-visible,
.ui-dropdown-option[aria-selected="true"],
.ui-dropdown-option:hover,
.ui-dropdown-option:focus-visible {
  color: #101828 !important;
  background: #f2f4f7 !important;
}

select.ui-control,
.scrape-form select,
.task-form-panel select,
.style-category-form select,
.ai-config-grid select {
  min-height: 40px;
  padding-right: 38px !important;
  color: #101828 !important;
  background-color: #ffffff !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #667085 50%),
    linear-gradient(135deg, #667085 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  border-color: #d0d5dd !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  appearance: none;
}

select.ui-control option,
.scrape-form select option,
.task-form-panel select option,
.style-category-form select option,
.ai-config-grid select option {
  color: #101828 !important;
  background: #ffffff !important;
}

.gallery-item.is-video .gallery-preview img.gallery-video-poster {
  opacity: 0 !important;
}

.gallery-item.is-video .gallery-preview video.gallery-video {
  z-index: 2;
  opacity: 1 !important;
  background: #eef2f6;
}

.gallery-item.is-video .gallery-preview video.gallery-video.is-playing {
  opacity: 1 !important;
}

/* Local filter layout guard: keep filter groups stacked vertically. */
.library-filter-stack {
  display: grid !important;
  grid-template-columns: 1fr;
  align-items: stretch !important;
  gap: 8px !important;
}

.library-filter-stack .top-filter {
  width: 100%;
  display: flex !important;
  flex: none !important;
  flex-wrap: wrap;
}

.filter-row {
  width: 100%;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start !important;
  gap: 8px !important;
}

.filter-row > span {
  flex: none;
}

.filter-row .style-filter {
  min-width: 0;
  display: flex !important;
  flex-wrap: wrap;
}

/* Local premium lazy-load polish: earlier, softer, and less abrupt. */
.gallery-media {
  overflow: hidden;
  background:
    linear-gradient(135deg, #eef2f6 0%, #f8fafc 100%) !important;
}

.gallery-media::before {
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.78), transparent 34%),
    linear-gradient(135deg, #eef2f6 0%, #f8fafc 52%, #e9eef5 100%) !important;
  transition: opacity 0.34s ease, transform 0.34s ease;
}

.gallery-media::after {
  height: 100% !important;
  inset: 0 !important;
  border-radius: inherit !important;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.58) 44%, rgba(255, 255, 255, 0) 68%),
    linear-gradient(135deg, rgba(238, 242, 246, 0.92), rgba(248, 250, 252, 0.92)) !important;
  background-size: 240% 100%, 100% 100% !important;
  opacity: 1 !important;
  transform: none !important;
  animation: gallery-premium-sheen 1.35s ease-in-out infinite !important;
  transition: opacity 0.34s ease;
}

.gallery-media.is-media-decoded::before,
.gallery-media.has-video::before {
  opacity: 0.28;
}

.gallery-media.is-media-decoded::after,
.gallery-media.has-video::after {
  opacity: 0.18 !important;
}

.gallery-media.is-media-loaded::before,
.gallery-media.is-media-unavailable::before,
.gallery-media.has-video::before,
.gallery-media.is-media-loaded::after,
.gallery-media.is-media-unavailable::after,
.gallery-media.has-video::after {
  opacity: 0 !important;
}

.gallery-preview img.gallery-lazy-image,
.gallery-preview img.gallery-video-poster {
  filter: saturate(0.96) contrast(0.98);
  transform: translateZ(0) scale(1.012);
  transition:
    opacity 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.34s ease,
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1) !important;
  will-change: opacity, transform;
}

.gallery-preview img.gallery-lazy-image.is-loaded,
.gallery-preview img.gallery-video-poster.is-loaded {
  filter: saturate(1) contrast(1);
  transform: translateZ(0) scale(1);
}

.gallery-item {
  content-visibility: auto !important;
  contain: layout paint style;
  contain-intrinsic-size: auto 440px !important;
}

.image-gallery {
  overflow-anchor: none;
}

@keyframes gallery-premium-sheen {
  0% {
    background-position: 140% 0, 0 0;
  }
  100% {
    background-position: -140% 0, 0 0;
  }
}

/* Local lazy-load visibility final override. */
.gallery-item:not(.is-video) .gallery-preview img.gallery-lazy-image.is-loaded {
  opacity: 1 !important;
}

.gallery-item.is-video .gallery-preview img.gallery-video-poster.is-loaded {
  opacity: 0 !important;
}

.gallery-item.is-video .gallery-preview video.gallery-video {
  opacity: 1 !important;
}

.gallery-media.is-media-loaded::before,
.gallery-media.is-media-loaded::after,
.gallery-media.has-video::before,
.gallery-media.has-video::after {
  opacity: 0 !important;
  animation: none !important;
}

/* Local modal layout final override. */
.image-modal {
  z-index: 220 !important;
  padding: clamp(10px, 2vw, 24px) !important;
}

.modal-dialog {
  width: min(1320px, calc(100vw - 24px)) !important;
  height: min(90dvh, 860px) !important;
  max-height: calc(100dvh - 24px) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  overflow: hidden !important;
  background: #f2f4f7 !important;
}

.modal-media-panel {
  min-width: 0 !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  background: #0b1220 !important;
}

.modal-media-frame {
  grid-row: 1 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 12px !important;
}

.modal-media-frame img,
.modal-media-frame video {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

.modal-info {
  grid-row: 2 !important;
  align-self: stretch !important;
  width: 100% !important;
  padding: 14px 18px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(16, 24, 40, 0.72);
}

.modal-comments-panel {
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  border-left: 1px solid #e4e7ec !important;
  background: #ffffff !important;
}

.modal-comments-head {
  min-height: auto !important;
  padding: 18px 64px 14px 20px !important;
}

.modal-comments-list {
  min-height: 0 !important;
  overflow-y: auto !important;
}

.modal-close {
  top: 14px !important;
  right: 14px !important;
  z-index: 4 !important;
}

@media (max-width: 1100px) {
  .modal-dialog {
    width: calc(100vw - 20px) !important;
    height: calc(100dvh - 20px) !important;
    max-height: calc(100dvh - 20px) !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(280px, 58dvh) minmax(220px, 1fr) !important;
    border-radius: 20px !important;
  }

  .modal-media-panel {
    grid-template-rows: minmax(0, 1fr) auto !important;
  }

  .modal-comments-panel {
    border-top: 1px solid #e4e7ec !important;
    border-left: 0 !important;
  }

  .modal-comments-head {
    padding-right: 64px !important;
  }
}

@media (max-width: 640px) {
  .image-modal {
    padding: 6px !important;
  }

  .modal-dialog {
    width: calc(100vw - 12px) !important;
    height: calc(100dvh - 12px) !important;
    max-height: calc(100dvh - 12px) !important;
    grid-template-rows: minmax(220px, 52dvh) minmax(220px, 1fr) !important;
    border-radius: 16px !important;
  }

  .modal-media-frame {
    padding: 8px !important;
  }

  .modal-info {
    padding: 10px 12px !important;
  }

  .modal-comments-head {
    grid-template-columns: 1fr !important;
    padding: 12px 56px 10px 14px !important;
  }

  .modal-comments-list {
    padding: 8px 12px 14px !important;
  }
}

/* Local modal layout final override. */
.image-modal {
  z-index: 220 !important;
  padding: clamp(10px, 2.4vw, 24px) !important;
}

.modal-dialog {
  width: min(1240px, calc(100vw - 24px)) !important;
  height: min(92dvh, 820px) !important;
  max-height: calc(100dvh - 24px) !important;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  border-radius: 18px !important;
}

.modal-media-panel {
  min-width: 0 !important;
  min-height: 0 !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  background: #0b1220 !important;
}

.modal-media-frame {
  min-width: 0 !important;
  min-height: 0 !important;
  grid-row: 1 !important;
  display: grid !important;
  place-items: center !important;
  padding: 16px !important;
  background: transparent !important;
}

.modal-media-frame img,
.modal-media-frame video {
  grid-area: 1 / 1 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

.modal-media-frame #modalVideo {
  opacity: 0 !important;
  transition: opacity 0.16s ease !important;
}

.modal-media-frame #modalVideo.is-ready {
  opacity: 1 !important;
}

.modal-info {
  grid-row: 2 !important;
  width: 100% !important;
  padding: 12px 16px 14px !important;
  background: rgba(11, 18, 32, 0.96) !important;
}

.modal-comments-panel {
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.modal-close {
  top: 12px !important;
  right: 12px !important;
  z-index: 130 !important;
}

@media (max-width: 1100px) {
  .modal-dialog {
    width: min(760px, calc(100vw - 20px)) !important;
    height: min(94dvh, 900px) !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(260px, 54dvh) minmax(190px, 1fr) !important;
  }

  .modal-comments-panel {
    border-left: 0 !important;
    border-top: 1px solid #e4e7ec !important;
  }

  .modal-comments-head {
    min-height: 56px !important;
    padding: 12px 60px 10px 18px !important;
  }

  .modal-comments-list {
    padding: 10px 16px 18px !important;
  }
}

@media (max-width: 640px) {
  .image-modal {
    padding: 8px !important;
  }

  .modal-dialog {
    width: calc(100vw - 16px) !important;
    height: calc(100dvh - 16px) !important;
    grid-template-rows: minmax(240px, 52dvh) minmax(180px, 1fr) !important;
    border-radius: 14px !important;
  }

  .modal-media-frame {
    padding: 10px !important;
  }
}

/* Local final workspace guard: keep filter, settings headers and nav parity stable. */
.media-library.dashboard-view.active .library-filter-stack {
  position: sticky !important;
  top: 66px !important;
  z-index: 28 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-items: stretch !important;
  gap: 8px !important;
  margin-top: 10px !important;
  padding: 10px !important;
  background: rgba(255, 255, 255, 0.97) !important;
  border: 1px solid #eaecf0 !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08) !important;
  transform: translateZ(0);
  contain: layout paint style;
  backdrop-filter: blur(10px);
}

.media-library.dashboard-view.active .library-filter-stack .top-filter,
.media-library.dashboard-view.active .filter-row .style-filter {
  display: flex !important;
  flex-wrap: wrap !important;
  min-width: 0 !important;
  gap: 7px !important;
}

.media-library.dashboard-view.active .filter-row {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 8px !important;
  width: 100% !important;
}

.media-library.dashboard-view.active .style-filter button {
  height: 30px !important;
  padding: 0 11px !important;
  border-radius: 8px !important;
  line-height: 1 !important;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease !important;
}

.settings-view.dashboard-view.active .library-header {
  min-height: 56px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 12px 18px !important;
  border: 1px solid #eaecf0 !important;
  border-radius: 12px !important;
  color: #101828 !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.06) !important;
}

.settings-view.dashboard-view.active .library-header .eyebrow {
  margin: 0 0 2px !important;
  color: #e60023 !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
}

.settings-view.dashboard-view.active .library-header h2 {
  margin: 0 !important;
  color: #101828 !important;
  font-size: 22px !important;
  line-height: 1.15 !important;
  letter-spacing: 0 !important;
}

.settings-view.dashboard-view.active .library-header p:not(.eyebrow) {
  margin: 4px 0 0 !important;
  color: #667085 !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}

.sidebar-menu nav a[data-view="system"],
.sidebar-menu nav a[data-view="settings"] {
  height: 40px !important;
  padding: 0 11px !important;
  border-radius: 9px !important;
  color: #475467 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.sidebar-menu nav a[data-view="system"] span,
.sidebar-menu nav a[data-view="settings"] span {
  width: 22px !important;
  height: 22px !important;
  border-radius: 8px !important;
  color: #667085 !important;
  background: #f2f4f7 !important;
}

.sidebar-menu nav a[data-view="system"]:hover,
.sidebar-menu nav a[data-view="settings"]:hover {
  color: #101828 !important;
  background: #f9fafb !important;
}

.sidebar-menu nav a[data-view="system"].active,
.sidebar-menu nav a[data-view="settings"].active {
  color: #e60023 !important;
  background: #fff1f3 !important;
  box-shadow: inset 3px 0 0 #e60023 !important;
}

.sidebar-menu nav a[data-view="system"].active span,
.sidebar-menu nav a[data-view="settings"].active span {
  color: #e60023 !important;
  background: #ffe4e8 !important;
}

/* Final production guard: uniform product cards. */
.image-gallery {
  align-items: start !important;
  grid-auto-rows: auto !important;
}

.gallery-item {
  --product-card-media-height: 220px;
  --product-card-stats-height: 112px;
  --product-card-trend-height: 144px;
  width: 100% !important;
  height: calc(var(--product-card-media-height) + var(--product-card-stats-height) + var(--product-card-trend-height)) !important;
  min-height: calc(var(--product-card-media-height) + var(--product-card-stats-height) + var(--product-card-trend-height)) !important;
  max-height: calc(var(--product-card-media-height) + var(--product-card-stats-height) + var(--product-card-trend-height)) !important;
  display: grid !important;
  grid-template-rows: var(--product-card-media-height) var(--product-card-stats-height) var(--product-card-trend-height) !important;
  overflow: hidden !important;
  contain-intrinsic-size: 190px 476px !important;
}

.gallery-media,
.gallery-preview {
  width: 100% !important;
  height: var(--product-card-media-height) !important;
  min-height: var(--product-card-media-height) !important;
  max-height: var(--product-card-media-height) !important;
  aspect-ratio: auto !important;
}

.gallery-preview img,
.gallery-preview video,
.gallery-preview img.gallery-lazy-image,
.gallery-preview img.gallery-video-poster {
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
}

.gallery-stats {
  height: var(--product-card-stats-height) !important;
  min-height: var(--product-card-stats-height) !important;
  max-height: var(--product-card-stats-height) !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-rows: 50px !important;
  align-content: start !important;
  overflow: hidden !important;
}

.gallery-stats[data-metric-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.metric-card,
.gallery-stats[data-metric-count="4"] .metric-card {
  height: 50px !important;
  min-height: 50px !important;
  max-height: 50px !important;
  overflow: hidden !important;
}

.metric-card strong,
.metric-card em,
.gallery-stats strong,
.gallery-stats em {
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.mini-trend-chart {
  height: calc(var(--product-card-trend-height) - 16px) !important;
  min-height: calc(var(--product-card-trend-height) - 16px) !important;
  max-height: calc(var(--product-card-trend-height) - 16px) !important;
  display: grid !important;
  grid-template-rows: 16px 48px 14px minmax(0, 1fr) !important;
  overflow: hidden !important;
}

.mini-trend-chart svg {
  height: 48px !important;
  margin: 4px 0 1px !important;
}

.mini-trend-head,
.mini-trend-foot {
  min-height: 14px !important;
  overflow: hidden !important;
}

.mini-trend-summary {
  min-height: 44px !important;
  max-height: 44px !important;
  overflow: hidden !important;
}

.mini-trend-summary span {
  display: block !important;
  overflow: hidden !important;
  line-height: 1.35 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.mini-trend-empty {
  height: 100% !important;
  min-height: 0 !important;
}

@media (min-width: 1440px) {
  .gallery-item {
    --product-card-media-height: 230px;
    --product-card-stats-height: 112px;
    --product-card-trend-height: 144px;
  }
}

@media (max-width: 760px) {
  .gallery-item {
    --product-card-media-height: 210px;
    --product-card-stats-height: 108px;
    --product-card-trend-height: 136px;
  }
}

/* Absolute final override: normal filter scroll and stable lazy images. */
.media-library.dashboard-view.active .library-titlebar,
.media-library.dashboard-view.active .library-filter-stack {
  position: static !important;
  top: auto !important;
  z-index: 1 !important;
}

.gallery-load-sentinel.is-auto-only {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  pointer-events: none !important;
}

.gallery-load-sentinel.is-auto-only .gallery-load-more {
  display: none !important;
}

.gallery-preview {
  position: relative !important;
  height: var(--product-card-media-height) !important;
  min-height: var(--product-card-media-height) !important;
  max-height: var(--product-card-media-height) !important;
  overflow: hidden !important;
  background: #f2f4f7 !important;
  transform: translateZ(0) !important;
}

.gallery-preview::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;
  opacity: 1 !important;
  background: linear-gradient(90deg, #f4eef1 0%, #fff7f9 48%, #f4eef1 100%) !important;
  background-size: 220% 100% !important;
  animation: skeleton-shimmer 1.2s ease-in-out infinite !important;
  transition: opacity 0.16s ease !important;
}

.gallery-preview.is-media-loaded::after,
.gallery-preview.is-media-unavailable::after {
  opacity: 0 !important;
  animation: none !important;
}

.gallery-preview img.gallery-lazy-image,
.gallery-preview img.gallery-video-poster,
.gallery-preview video.gallery-video {
  position: absolute !important;
  inset: 0 !important;
  z-index: 2 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  opacity: 0 !important;
  object-fit: cover !important;
  transform: translateZ(0) !important;
  transition: opacity 0.16s ease !important;
}

.gallery-preview img.gallery-lazy-image.is-loaded,
.gallery-preview img.gallery-video-poster.is-loaded,
.gallery-preview video.gallery-video.is-playing {
  opacity: 1 !important;
}

.gallery-preview img.gallery-lazy-image.is-image-unavailable,
.gallery-preview img.gallery-video-poster.is-image-unavailable {
  opacity: 0 !important;
}

/* Final loading stability override. */
.media-library.dashboard-view.active .library-titlebar,
.media-library.dashboard-view.active .library-filter-stack {
  position: static !important;
  top: auto !important;
  z-index: 1 !important;
}

.gallery-load-sentinel.is-auto-only {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  pointer-events: none !important;
}

.gallery-load-sentinel.is-auto-only .gallery-load-more {
  display: none !important;
}

.gallery-preview {
  position: relative !important;
  height: var(--product-card-media-height) !important;
  min-height: var(--product-card-media-height) !important;
  max-height: var(--product-card-media-height) !important;
  overflow: hidden !important;
  background: #f2f4f7 !important;
  transform: translateZ(0) !important;
}

.gallery-preview::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;
  opacity: 1 !important;
  background: linear-gradient(90deg, #f4eef1 0%, #fff7f9 48%, #f4eef1 100%) !important;
  background-size: 220% 100% !important;
  animation: skeleton-shimmer 1.2s ease-in-out infinite !important;
  transition: opacity 0.16s ease !important;
}

.gallery-preview.is-media-loaded::after,
.gallery-preview.is-media-unavailable::after {
  opacity: 0 !important;
  animation: none !important;
}

.gallery-preview img.gallery-lazy-image,
.gallery-preview img.gallery-video-poster,
.gallery-preview video.gallery-video {
  position: absolute !important;
  inset: 0 !important;
  z-index: 2 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  opacity: 0 !important;
  object-fit: cover !important;
  transform: translateZ(0) !important;
  transition: opacity 0.16s ease !important;
}

.gallery-preview img.gallery-lazy-image.is-loaded,
.gallery-preview img.gallery-video-poster.is-loaded,
.gallery-preview video.gallery-video.is-playing {
  opacity: 1 !important;
}

.gallery-preview img.gallery-lazy-image.is-image-unavailable,
.gallery-preview img.gallery-video-poster.is-image-unavailable {
  opacity: 0 !important;
}

/* Final stability guard: one loading path, fixed cards, no image flicker. */
.gallery-load-sentinel.is-auto-only {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  pointer-events: none !important;
}

.gallery-load-sentinel.is-auto-only .gallery-load-more {
  display: none !important;
}

.gallery-preview {
  position: relative !important;
  height: var(--product-card-media-height) !important;
  min-height: var(--product-card-media-height) !important;
  max-height: var(--product-card-media-height) !important;
  background: #f2f4f7 !important;
  overflow: hidden !important;
  transform: translateZ(0) !important;
}

.gallery-preview::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;
  opacity: 1 !important;
  background: linear-gradient(90deg, #f4eef1 0%, #fff7f9 48%, #f4eef1 100%) !important;
  background-size: 220% 100% !important;
  animation: skeleton-shimmer 1.2s ease-in-out infinite !important;
  transition: opacity 0.16s ease !important;
}

.gallery-preview.is-media-loaded::after,
.gallery-preview.is-media-unavailable::after {
  opacity: 0 !important;
  animation: none !important;
}

.gallery-preview img.gallery-lazy-image,
.gallery-preview img.gallery-video-poster,
.gallery-preview video.gallery-video {
  position: absolute !important;
  inset: 0 !important;
  z-index: 2 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  opacity: 0 !important;
  object-fit: cover !important;
  transform: translateZ(0) !important;
  transition: opacity 0.16s ease !important;
}

.gallery-preview img.gallery-lazy-image.is-loaded,
.gallery-preview img.gallery-video-poster.is-loaded,
.gallery-preview video.gallery-video.is-playing {
  opacity: 1 !important;
}

.gallery-preview img.gallery-lazy-image.is-image-unavailable,
.gallery-preview img.gallery-video-poster.is-image-unavailable {
  opacity: 0 !important;
}

/* Final production guard: uniform product cards and sticky filters. */
.media-library.dashboard-view.active .library-filter-stack {
  position: sticky !important;
  top: 76px !important;
  z-index: 80 !important;
}

.image-gallery {
  align-items: start !important;
  grid-auto-rows: auto !important;
}

.gallery-item {
  --product-card-media-height: 220px;
  --product-card-stats-height: 112px;
  --product-card-trend-height: 144px;
  width: 100% !important;
  height: calc(var(--product-card-media-height) + var(--product-card-stats-height) + var(--product-card-trend-height)) !important;
  min-height: calc(var(--product-card-media-height) + var(--product-card-stats-height) + var(--product-card-trend-height)) !important;
  max-height: calc(var(--product-card-media-height) + var(--product-card-stats-height) + var(--product-card-trend-height)) !important;
  display: grid !important;
  grid-template-rows: var(--product-card-media-height) var(--product-card-stats-height) var(--product-card-trend-height) !important;
  overflow: hidden !important;
  contain-intrinsic-size: 190px 476px !important;
}

.gallery-media,
.gallery-preview {
  width: 100% !important;
  height: var(--product-card-media-height) !important;
  min-height: var(--product-card-media-height) !important;
  max-height: var(--product-card-media-height) !important;
  aspect-ratio: auto !important;
}

.gallery-preview img,
.gallery-preview video,
.gallery-preview img.gallery-lazy-image,
.gallery-preview img.gallery-video-poster {
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
}

.gallery-stats {
  height: var(--product-card-stats-height) !important;
  min-height: var(--product-card-stats-height) !important;
  max-height: var(--product-card-stats-height) !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-rows: 50px !important;
  align-content: start !important;
  overflow: hidden !important;
}

.gallery-stats[data-metric-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.metric-card,
.gallery-stats[data-metric-count="4"] .metric-card {
  height: 50px !important;
  min-height: 50px !important;
  max-height: 50px !important;
  overflow: hidden !important;
}

.metric-card strong,
.metric-card em,
.gallery-stats strong,
.gallery-stats em {
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.mini-trend-chart {
  height: calc(var(--product-card-trend-height) - 16px) !important;
  min-height: calc(var(--product-card-trend-height) - 16px) !important;
  max-height: calc(var(--product-card-trend-height) - 16px) !important;
  display: grid !important;
  grid-template-rows: 16px 48px 14px minmax(0, 1fr) !important;
  overflow: hidden !important;
}

.mini-trend-chart svg {
  height: 48px !important;
  margin: 4px 0 1px !important;
}

.mini-trend-head,
.mini-trend-foot {
  min-height: 14px !important;
  overflow: hidden !important;
}

.mini-trend-summary {
  min-height: 44px !important;
  max-height: 44px !important;
  overflow: hidden !important;
}

.mini-trend-summary span {
  display: block !important;
  overflow: hidden !important;
  line-height: 1.35 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.mini-trend-empty {
  height: 100% !important;
  min-height: 0 !important;
}

@media (min-width: 1440px) {
  .gallery-item {
    --product-card-media-height: 230px;
    --product-card-stats-height: 112px;
    --product-card-trend-height: 144px;
  }
}

@media (max-width: 760px) {
  .gallery-item {
    --product-card-media-height: 210px;
    --product-card-stats-height: 108px;
    --product-card-trend-height: 136px;
  }
}

/* Local/server product card size final override. */
.image-gallery {
  align-items: start !important;
  grid-auto-rows: auto !important;
}

.gallery-item {
  --product-card-media-height: 220px;
  --product-card-stats-height: 112px;
  --product-card-trend-height: 144px;
  width: 100% !important;
  height: calc(var(--product-card-media-height) + var(--product-card-stats-height) + var(--product-card-trend-height)) !important;
  min-height: calc(var(--product-card-media-height) + var(--product-card-stats-height) + var(--product-card-trend-height)) !important;
  max-height: calc(var(--product-card-media-height) + var(--product-card-stats-height) + var(--product-card-trend-height)) !important;
  display: grid !important;
  grid-template-rows: var(--product-card-media-height) var(--product-card-stats-height) var(--product-card-trend-height) !important;
  overflow: hidden !important;
  contain-intrinsic-size: 190px 476px !important;
}

.gallery-media,
.gallery-preview {
  width: 100% !important;
  height: var(--product-card-media-height) !important;
  min-height: var(--product-card-media-height) !important;
  max-height: var(--product-card-media-height) !important;
  aspect-ratio: auto !important;
}

.gallery-preview img,
.gallery-preview video,
.gallery-preview img.gallery-lazy-image,
.gallery-preview img.gallery-video-poster {
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
}

.gallery-stats {
  height: var(--product-card-stats-height) !important;
  min-height: var(--product-card-stats-height) !important;
  max-height: var(--product-card-stats-height) !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-rows: 50px !important;
  align-content: start !important;
  overflow: hidden !important;
}

.gallery-stats[data-metric-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.metric-card,
.gallery-stats[data-metric-count="4"] .metric-card {
  height: 50px !important;
  min-height: 50px !important;
  max-height: 50px !important;
  overflow: hidden !important;
}

.metric-card strong,
.metric-card em,
.gallery-stats strong,
.gallery-stats em {
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.mini-trend-chart {
  height: calc(var(--product-card-trend-height) - 16px) !important;
  min-height: calc(var(--product-card-trend-height) - 16px) !important;
  max-height: calc(var(--product-card-trend-height) - 16px) !important;
  display: grid !important;
  grid-template-rows: 16px 48px 14px minmax(0, 1fr) !important;
  overflow: hidden !important;
}

.mini-trend-chart svg {
  height: 48px !important;
  margin: 4px 0 1px !important;
}

.mini-trend-head,
.mini-trend-foot {
  min-height: 14px !important;
  overflow: hidden !important;
}

.mini-trend-summary {
  min-height: 44px !important;
  max-height: 44px !important;
  overflow: hidden !important;
}

.mini-trend-summary span {
  display: block !important;
  overflow: hidden !important;
  line-height: 1.35 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.mini-trend-empty {
  height: 100% !important;
  min-height: 0 !important;
}

@media (min-width: 1440px) {
  .gallery-item {
    --product-card-media-height: 230px;
    --product-card-stats-height: 112px;
    --product-card-trend-height: 144px;
  }
}

@media (max-width: 760px) {
  .gallery-item {
    --product-card-media-height: 210px;
    --product-card-stats-height: 108px;
    --product-card-trend-height: 136px;
  }
}

/* Local workspace stability and navigation parity final override. */
.media-library.dashboard-view.active .library-filter-stack {
  position: sticky !important;
  top: 66px !important;
  z-index: 28 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 8px !important;
  margin-top: 10px !important;
  padding: 10px !important;
  background: rgba(255, 255, 255, 0.97) !important;
  border: 1px solid #eaecf0 !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08) !important;
  transform: translateZ(0);
  contain: layout paint style;
  backdrop-filter: blur(10px);
}

.media-library.dashboard-view.active .library-filter-stack .top-filter,
.media-library.dashboard-view.active .filter-row .style-filter {
  display: flex !important;
  flex-wrap: wrap !important;
  min-width: 0 !important;
  gap: 7px !important;
}

.media-library.dashboard-view.active .filter-row {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 8px !important;
  width: 100% !important;
}

.media-library.dashboard-view.active .style-filter button {
  height: 30px !important;
  padding: 0 11px !important;
  border-radius: 8px !important;
  line-height: 1 !important;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease !important;
}

.settings-view.dashboard-view.active .library-header {
  min-height: 56px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 12px 18px !important;
  border: 1px solid #eaecf0 !important;
  border-radius: 12px !important;
  color: #101828 !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.06) !important;
}

.settings-view.dashboard-view.active .library-header .eyebrow {
  margin: 0 0 2px !important;
  color: #e60023 !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
}

.settings-view.dashboard-view.active .library-header h2 {
  margin: 0 !important;
  color: #101828 !important;
  font-size: 22px !important;
  line-height: 1.15 !important;
  letter-spacing: 0 !important;
}

.settings-view.dashboard-view.active .library-header p:not(.eyebrow) {
  margin: 4px 0 0 !important;
  color: #667085 !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}

.sidebar-menu nav a[data-view="system"],
.sidebar-menu nav a[data-view="settings"] {
  height: 40px !important;
  padding: 0 11px !important;
  border-radius: 9px !important;
  color: #475467 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.sidebar-menu nav a[data-view="system"] span,
.sidebar-menu nav a[data-view="settings"] span {
  width: 22px !important;
  height: 22px !important;
  border-radius: 8px !important;
  color: #667085 !important;
  background: #f2f4f7 !important;
}

.sidebar-menu nav a[data-view="system"]:hover,
.sidebar-menu nav a[data-view="settings"]:hover {
  color: #101828 !important;
  background: #f9fafb !important;
}

.sidebar-menu nav a[data-view="system"].active,
.sidebar-menu nav a[data-view="settings"].active {
  color: #e60023 !important;
  background: #fff1f3 !important;
  box-shadow: inset 3px 0 0 #e60023 !important;
}

.sidebar-menu nav a[data-view="system"].active span,
.sidebar-menu nav a[data-view="settings"].active span {
  color: #e60023 !important;
  background: #ffe4e8 !important;
}

/* Local sticky filter final override. */
.media-library.dashboard-view.active .library-filter-stack {
  position: sticky !important;
  top: 66px !important;
  z-index: 28 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-items: stretch !important;
  gap: 8px !important;
  margin-top: 10px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid #eaecf0 !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08) !important;
  transform: translateZ(0);
  will-change: top;
  contain: paint;
  backdrop-filter: blur(10px);
}

.media-library.dashboard-view.active .library-filter-stack .top-filter {
  width: 100% !important;
  display: flex !important;
  flex: none !important;
  flex-wrap: wrap !important;
}

.media-library.dashboard-view.active .filter-row {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 8px !important;
}

.media-library.dashboard-view.active .filter-row .style-filter {
  min-width: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
}

.media-library.dashboard-view.active .style-filter button {
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease !important;
}

/* Local lazy-load stability final override. */


.gallery-item {
  content-visibility: auto !important;
  contain: layout paint style;
  contain-intrinsic-size: auto 440px !important;
}

.image-gallery {
  overflow-anchor: none;
}

/* Local lazy-load handoff refinement: make decode-to-reveal feel steadier. */
.gallery-preview {
  isolation: isolate;
}

.gallery-preview img.gallery-lazy-image,
.gallery-preview img.gallery-video-poster {
  backface-visibility: hidden;
  transform-origin: center center;
}

.gallery-media.is-media-decoded::after {
  opacity: 0.1 !important;
  animation-duration: 1.8s !important;
}

.gallery-media.is-media-loaded::after,
.gallery-media.is-media-unavailable::after,
.gallery-media.has-video::after {
  animation: none !important;
}

.gallery-preview.is-media-loaded img.gallery-lazy-image,
.gallery-preview.is-media-loaded img.gallery-video-poster {
  will-change: auto;
}

/* Local ultimate guard: keep media and dropdowns stable after every legacy override. */
.gallery-media {
  position: relative;
  isolation: isolate;
  background: #eef2f6 !important;
}

.gallery-media::before,
.gallery-media::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.gallery-media::before {
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(238, 242, 246, 0.92)),
    #eef2f6;
  opacity: 1;
  transition: opacity 0.18s ease;
}

.gallery-media::after {
  top: 50%;
  left: 18%;
  right: 18%;
  z-index: 1;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e4e7ec 0%, #f8fafc 45%, #e4e7ec 100%);
  background-size: 220% 100%;
  opacity: 0.88;
  transform: translateY(-50%);
  animation: gallery-skeleton-sweep 1.1s ease-in-out infinite;
}

.gallery-media.is-media-loaded::before,
.gallery-media.has-video::before,
.gallery-media.is-media-unavailable::before {
  opacity: 0;
}

.gallery-media.is-media-loaded::after,
.gallery-media.has-video::after,
.gallery-media.is-media-unavailable::after {
  opacity: 0;
}

.gallery-preview {
  position: relative;
  z-index: 2;
  min-height: 0;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  background: transparent !important;
}

.gallery-preview img.gallery-lazy-image,
.gallery-preview img.gallery-video-poster {
  position: relative;
  z-index: 1;
  display: block;
  color: transparent !important;
  font-size: 0 !important;
  opacity: 0 !important;
  transition: opacity 0.18s ease;
}

.gallery-preview img.gallery-lazy-image.is-loaded,
.gallery-preview img.gallery-video-poster.is-loaded {
  opacity: 1 !important;
}

.gallery-preview img.gallery-lazy-image.is-image-unavailable,
.gallery-preview img.gallery-video-poster.is-image-unavailable {
  opacity: 0 !important;
}

.gallery-preview video {
  z-index: 3;
}

.library-date-options,
.trend-sort-options,
.ui-dropdown-panel {
  z-index: 220 !important;
  min-width: 196px;
  padding: 8px !important;
  color: #101828 !important;
  background: #ffffff !important;
  border: 1px solid #d0d5dd !important;
  border-radius: 14px !important;
  box-shadow: 0 18px 48px rgba(16, 24, 40, 0.18) !important;
  backdrop-filter: none !important;
}

.library-date-options[hidden],
.trend-sort-options[hidden],
.ui-dropdown-panel[hidden] {
  display: none !important;
}

.library-date-options *,
.trend-sort-options *,
.ui-dropdown-panel * {
  color: #101828 !important;
  opacity: 1 !important;
  text-shadow: none !important;
  -webkit-text-fill-color: currentColor;
}

.library-date-options .date-option,
.trend-sort-options button,
.ui-dropdown-option {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px !important;
  border: 0 !important;
  border-radius: 10px !important;
  color: #344054 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  text-align: left;
  background: transparent !important;
  box-shadow: none !important;
}

.library-date-options .date-option.active,
.library-date-options .date-option:hover,
.library-date-options .date-option:focus-visible,
.trend-sort-options button[aria-pressed="true"],
.trend-sort-options button:hover,
.trend-sort-options button:focus-visible,
.ui-dropdown-option[aria-selected="true"],
.ui-dropdown-option:hover,
.ui-dropdown-option:focus-visible {
  color: #101828 !important;
  background: #f2f4f7 !important;
}

select.ui-control,
.scrape-form select,
.task-form-panel select,
.style-category-form select,
.ai-config-grid select {
  min-height: 40px;
  padding-right: 38px !important;
  color: #101828 !important;
  background-color: #ffffff !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #667085 50%),
    linear-gradient(135deg, #667085 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  border-color: #d0d5dd !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  appearance: none;
}

select.ui-control option,
.scrape-form select option,
.task-form-panel select option,
.style-category-form select option,
.ai-config-grid select option {
  color: #101828 !important;
  background: #ffffff !important;
}

/* Local stable media loading and unified dropdown polish. */
.gallery-media {
  position: relative;
  isolation: isolate;
  background: #eef2f6 !important;
}

.gallery-media::before,
.gallery-media::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.gallery-media::before {
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(238, 242, 246, 0.92)),
    #eef2f6;
  opacity: 1;
  transition: opacity 0.18s ease;
}

.gallery-media::after {
  top: 50%;
  left: 18%;
  right: 18%;
  z-index: 1;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e4e7ec 0%, #f8fafc 45%, #e4e7ec 100%);
  background-size: 220% 100%;
  opacity: 0.88;
  transform: translateY(-50%);
  animation: gallery-skeleton-sweep 1.1s ease-in-out infinite;
}

.gallery-media.is-media-loaded::before,
.gallery-media.has-video::before {
  opacity: 0;
}

.gallery-media.is-media-loaded::after,
.gallery-media.is-media-unavailable::after,
.gallery-media.has-video::after {
  opacity: 0;
}

.gallery-preview {
  position: relative;
  z-index: 2;
  min-height: 0;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  background: transparent !important;
}

.gallery-preview img.gallery-lazy-image,
.gallery-preview img.gallery-video-poster {
  position: relative;
  z-index: 1;
  display: block;
  color: transparent !important;
  font-size: 0 !important;
  opacity: 0 !important;
  transition: opacity 0.18s ease;
}

.gallery-preview img.gallery-lazy-image.is-loaded,
.gallery-preview img.gallery-video-poster.is-loaded {
  opacity: 1 !important;
}

.gallery-preview img.gallery-lazy-image.is-image-unavailable,
.gallery-preview img.gallery-video-poster.is-image-unavailable {
  opacity: 0 !important;
}

.gallery-preview video {
  z-index: 3;
}

.gallery-official-badge {
  z-index: 6;
}

.library-date-options,
.trend-sort-options,
.ui-dropdown-panel {
  z-index: 120 !important;
  min-width: 196px;
  padding: 8px !important;
  color: #101828 !important;
  background: #ffffff !important;
  border: 1px solid #d0d5dd !important;
  border-radius: 14px !important;
  box-shadow: 0 18px 48px rgba(16, 24, 40, 0.18) !important;
  backdrop-filter: none !important;
}

.library-date-options[hidden],
.trend-sort-options[hidden],
.ui-dropdown-panel[hidden] {
  display: none !important;
}

.library-date-options *,
.trend-sort-options *,
.ui-dropdown-panel * {
  color: #101828 !important;
  opacity: 1 !important;
  text-shadow: none !important;
  -webkit-text-fill-color: currentColor;
}

.library-date-options .date-option,
.trend-sort-options button,
.ui-dropdown-option {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px !important;
  border: 0 !important;
  border-radius: 10px !important;
  color: #344054 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  text-align: left;
  background: transparent !important;
  box-shadow: none !important;
}

.date-options-head {
  padding: 6px 8px 8px !important;
  border-bottom: 1px solid #eaecf0;
  margin-bottom: 6px;
}

.date-options-head strong {
  color: #101828 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
}

.date-options-head span,
.date-options-group,
.date-options-empty {
  color: #667085 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.library-date-options .date-option em {
  min-width: 34px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #475467 !important;
  font-style: normal;
  font-size: 11px !important;
  font-weight: 900 !important;
  text-align: center;
  background: #f2f4f7 !important;
}

.library-date-options .date-option.active,
.library-date-options .date-option:hover,
.library-date-options .date-option:focus-visible,
.trend-sort-options button[aria-pressed="true"],
.trend-sort-options button:hover,
.trend-sort-options button:focus-visible,
.ui-dropdown-option[aria-selected="true"],
.ui-dropdown-option:hover,
.ui-dropdown-option:focus-visible {
  color: #101828 !important;
  background: #f2f4f7 !important;
}

.library-date-options .date-option.active,
.trend-sort-options button[aria-pressed="true"],
.ui-dropdown-option[aria-selected="true"] {
  box-shadow: inset 3px 0 0 #e60023 !important;
}

select.ui-control,
.scrape-form select,
.task-form-panel select,
.style-category-form select,
.ai-config-grid select {
  min-height: 40px;
  padding-right: 38px !important;
  color: #101828 !important;
  background-color: #ffffff !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #667085 50%),
    linear-gradient(135deg, #667085 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  border-color: #d0d5dd !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  appearance: none;
}

select.ui-control option,
.scrape-form select option,
.task-form-panel select option,
.style-category-form select option,
.ai-config-grid select option {
  color: #101828 !important;
  background: #ffffff !important;
}

@keyframes gallery-skeleton-sweep {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

/* Local final guard: this block intentionally wins over older local overrides. */
.gallery-media,
.gallery-preview,
.gallery-preview img,
.gallery-preview video {
  aspect-ratio: 4 / 5 !important;
}

.gallery-media {
  min-height: 0;
  background: #eef2f6;
}

.gallery-preview img {
  opacity: 0;
  transition: opacity 0.18s ease;
}

.gallery-preview img.is-loaded,
.gallery-preview img.is-image-unavailable {
  opacity: 1;
}

.gallery-preview img.is-image-unavailable {
  object-fit: contain;
  background: linear-gradient(135deg, #f2f4f7, #ffffff);
}

.library-date-options,
.trend-sort-options,
.ui-dropdown-panel {
  z-index: 180 !important;
  color: #101828 !important;
  background: #ffffff !important;
  border: 1px solid #d0d5dd !important;
  box-shadow: 0 18px 46px rgba(16, 24, 40, 0.18) !important;
  backdrop-filter: none !important;
}

.library-date-options,
.ui-dropdown-panel {
  width: min(260px, calc(100vw - 32px));
  max-height: min(440px, calc(100vh - 120px));
  overflow: auto;
}

.trend-sort-options {
  min-width: 150px;
}

.library-date-options *,
.trend-sort-options *,
.ui-dropdown-panel * {
  color: inherit;
}

.library-date-options .date-option,
.trend-sort-options button,
.ui-dropdown-option {
  color: #344054 !important;
  background: transparent !important;
}

.date-options-head strong,
.date-options-head span,
.date-options-group,
.date-options-empty {
  color: #667085 !important;
  background: #ffffff !important;
}

.date-options-head strong {
  color: #101828 !important;
}

.library-date-options .date-option em {
  color: #475467 !important;
  background: #f2f4f7 !important;
}

.library-date-options .date-option.active,
.library-date-options .date-option:hover,
.trend-sort-options button[aria-pressed="true"],
.trend-sort-options button:hover,
.ui-dropdown-option:hover,
.ui-dropdown-option:focus-visible {
  color: #101828 !important;
  background: #f2f4f7 !important;
}

/* Local stability polish: keep gallery cards steady while images resolve. */
.gallery-media,
.gallery-preview,
.gallery-preview img,
.gallery-preview video {
  aspect-ratio: 4 / 5;
}

.gallery-media {
  min-height: 0;
  background: #eef2f6;
}

.gallery-preview img {
  opacity: 0;
  transition: opacity 0.18s ease;
}

.gallery-preview img.is-loaded,
.gallery-preview img.is-image-unavailable {
  opacity: 1;
}

.gallery-preview img.is-image-unavailable {
  object-fit: contain;
  background: linear-gradient(135deg, #f2f4f7, #ffffff);
}

/* Local dropdown readability guard: older dark-menu rules can leak through. */
.library-date-options,
.trend-sort-options,
.ui-dropdown-panel {
  z-index: 60;
  color: #101828 !important;
  background: #ffffff !important;
  border: 1px solid #d0d5dd !important;
  box-shadow: 0 18px 46px rgba(16, 24, 40, 0.18) !important;
}

.library-date-options,
.ui-dropdown-panel {
  width: min(260px, calc(100vw - 32px));
  max-height: min(440px, calc(100vh - 120px));
  overflow: auto;
}

.trend-sort-options {
  min-width: 150px;
}

.library-date-options *,
.trend-sort-options *,
.ui-dropdown-panel * {
  color: inherit;
}

.library-date-options .date-option,
.trend-sort-options button,
.ui-dropdown-option {
  color: #344054 !important;
  background: transparent !important;
}

.date-options-head strong,
.date-options-head span,
.date-options-group,
.date-options-empty {
  color: #667085 !important;
  background: #ffffff !important;
}

.date-options-head strong {
  color: #101828 !important;
}

.library-date-options .date-option em {
  color: #475467 !important;
  background: #f2f4f7 !important;
}

.library-date-options .date-option.active,
.library-date-options .date-option:hover,
.trend-sort-options button[aria-pressed="true"],
.trend-sort-options button:hover,
.ui-dropdown-option:hover,
.ui-dropdown-option:focus-visible {
  color: #101828 !important;
  background: #f2f4f7 !important;
}

@media (max-width: 980px) {
  .app-navbar {
    height: auto;
    min-height: 62px;
    padding: 10px 14px;
  }

  .dashboard-layout {
    display: grid;
  }

  .sidebar-menu {
    width: 100%;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid #e4e7ec;
  }

  .sidebar-menu nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
  }

  .sidebar-menu nav a {
    flex: 0 0 auto;
  }

  .dashboard-main {
    padding: 12px;
  }

  .library-titlebar,
  .dashboard-hero {
    display: grid;
    gap: 12px;
    padding: 16px;
  }

  .library-actions {
    justify-content: flex-start;
  }

  .library-surface {
    padding: 14px;
  }

  .image-gallery {
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 12px;
  }
}

/* Local enterprise layout refinement: denser workspace, less scrolling. */
.is-logged-in .tool-panel,
.app-shell.is-auth-checking .tool-panel {
  grid-template-rows: 58px minmax(0, 1fr);
}

.app-navbar {
  height: 58px;
  padding: 0 24px;
}

.app-navbar-brand .brand-mark {
  width: 32px;
  height: 32px;
}

.sidebar-menu {
  width: 212px;
  padding: 14px 12px;
}

.is-sidebar-collapsed .sidebar-menu {
  width: 70px;
  padding: 14px 9px;
}

.sidebar-toggle {
  width: 32px;
  height: 32px;
}

.sidebar-menu nav a {
  height: 40px;
  padding: 0 11px;
  border-radius: 9px;
}

.sidebar-menu nav a span {
  width: 22px;
  height: 22px;
}

.dashboard-main {
  padding: 14px 18px 22px;
  gap: 10px;
}

.media-library.dashboard-view.active,
.settings-view.dashboard-view.active {
  min-height: 100%;
}

.library-titlebar {
  position: sticky;
  top: 0;
  z-index: 24;
  min-height: 56px;
  align-items: center;
  padding: 12px 18px;
  border-radius: 12px;
}

.library-titlebar h2,
.dashboard-hero h2 {
  font-size: 22px;
}

.library-actions {
  gap: 7px;
}

.library-titlebar button {
  height: 34px;
  min-width: 74px;
  padding: 0 12px;
  border-radius: 9px;
}

.library-titlebar #refreshLibrary,
.library-titlebar #refreshRepository {
  min-width: 92px;
}

.library-date-options,
.trend-sort-options {
  top: calc(100% + 6px);
}

.library-surface {
  margin-top: 10px;
  padding: 14px;
  border-radius: 12px;
}

.library-panel-head {
  padding-bottom: 10px;
}

.library-panel-head strong {
  font-size: 15px;
}

.library-panel-head > span {
  height: 26px;
  padding: 0 10px;
  font-size: 11px;
}

.library-toolbar {
  margin-top: 8px;
  padding: 7px 10px;
}

.library-filter-stack {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 10px;
  margin-top: 8px;
  padding: 10px;
}

.library-filter-stack .top-filter {
  flex: 1 1 100%;
  margin-bottom: 0;
}

.filter-row {
  flex: 0 1 auto;
  min-width: 0;
}

.filter-row > span,
.style-filter button,
.style-category-form select,
.style-category-form input {
  height: 28px;
  border-radius: 7px;
}

.filter-row > span {
  min-width: 44px;
  padding: 0 9px;
}

.style-filter {
  gap: 6px;
}

.style-filter button {
  padding: 0 9px;
}

.style-category-form {
  margin-top: 8px;
  gap: 8px;
}

.style-category-form button {
  height: 32px;
  border-radius: 9px;
}

.style-category-form .style-manage-toggle {
  min-width: 98px;
}

.likes-progress {
  margin-top: 8px;
  padding: 10px;
  border-radius: 10px;
}

.image-gallery {
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 12px;
  margin-top: 14px;
  padding-bottom: 68px;
}

.gallery-item {
  border-radius: 11px;
  contain-intrinsic-size: 178px 424px;
}

.gallery-media,
.gallery-preview {
  border-radius: 11px 11px 0 0;
}

.gallery-stats {
  gap: 6px;
  padding: 8px 8px 3px;
}

.metric-card,
.gallery-stats[data-metric-count="4"] .metric-card {
  min-height: 48px;
  padding: 7px 5px;
  gap: 3px;
  border-radius: 9px;
}

.gallery-stats em {
  font-size: 9px;
}

.gallery-stats strong,
.metric-card.likes strong,
.metric-card.comments strong,
.metric-card.visit strong,
.metric-card.repository-save strong {
  font-size: 14px;
}

.mini-trend-chart {
  margin: 7px 8px 9px;
  padding: 8px;
  border-radius: 9px;
}

.mini-trend-chart svg {
  height: 48px;
}

.mini-trend-summary {
  font-size: 10px;
}

.gallery-action-button {
  min-height: 26px;
  padding: 0 8px;
  border-radius: 7px;
}

.move-trash-button,
.move-hot-button {
  width: 28px;
  min-height: 28px;
}

.image-download-button,
.gallery-official-badge {
  width: 31px;
  height: 31px;
}

.image-download-button svg,
.gallery-official-badge svg {
  width: 17px;
  height: 17px;
}

.gallery-official-badge.is-shein {
  width: 42px;
}

.gallery-official-wordmark {
  font-size: 9px;
}

.gallery-empty {
  padding: 20px;
  border-radius: 12px;
}

.task-board,
.tool-card,
.activity-card,
.status-card,
.tips-card,
.mini-grid article {
  border-radius: 12px;
}

.task-board,
.tool-card,
.activity-card {
  padding: 16px;
}

.workspace-grid {
  gap: 14px;
}

@media (min-width: 1600px) {
  .image-gallery {
    grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
  }
}

@media (max-width: 1180px) {
  .sidebar-menu {
    width: 196px;
  }

  .image-gallery {
    grid-template-columns: repeat(auto-fill, minmax(166px, 1fr));
  }
}

@media (max-width: 980px) {
  .is-logged-in .tool-panel,
  .app-shell.is-auth-checking .tool-panel {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .app-navbar {
    height: auto;
  }

  .library-titlebar {
    position: relative;
    top: auto;
  }

  .library-filter-stack .top-filter {
    flex-basis: 100%;
  }

  .filter-row {
    flex-basis: 100%;
  }
}

/* Local interaction system: buttons, inputs and dropdowns. */
.ui-button {
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.ui-button.is-pressed {
  transform: translateY(1px) scale(0.99);
}

.ui-button.is-busy {
  color: transparent !important;
  pointer-events: none;
}

.ui-button.is-busy::after {
  position: absolute;
  inset: 0;
  width: 14px;
  height: 14px;
  margin: auto;
  content: "";
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 999px;
  color: #667085;
  animation: ui-spin 0.72s linear infinite;
}

.run-button.ui-button.is-busy::after,
#refreshLibrary.ui-button.is-busy::after,
#refreshRepository.ui-button.is-busy::after,
.style-manage-toggle.ui-button.is-busy::after {
  color: #ffffff;
}

.ui-button:disabled,
.ui-button.is-disabled,
button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none !important;
}

.ui-button:focus-visible,
.ui-control:focus-visible,
.ui-dropdown-option:focus-visible,
.sidebar-menu nav a:focus-visible,
.metric-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14), 0 0 0 1px #2563eb;
}

.ui-control {
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.ui-control.is-focused,
.ui-control:focus {
  border-color: #2563eb !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12) !important;
}

.ui-control.has-value:not(.ui-choice) {
  border-color: #b8c2d2;
}

.ui-control.is-invalid,
.ui-control[aria-invalid="true"] {
  border-color: #f04438 !important;
  background: #fff8f7 !important;
  box-shadow: 0 0 0 4px rgba(240, 68, 56, 0.12) !important;
}

.ui-control:disabled,
.ui-control.is-disabled {
  cursor: not-allowed;
  color: #98a2b3 !important;
  background: #f2f4f7 !important;
  opacity: 1;
}

.ui-choice {
  cursor: pointer;
}

.ui-select {
  cursor: pointer;
}

.ui-dropdown {
  position: relative;
}

.ui-dropdown > button[aria-expanded="true"],
.ui-dropdown.is-open > button {
  color: #101828;
  border-color: #98a2b3;
  background: #f9fafb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.ui-dropdown-panel {
  transform-origin: top right;
}

.ui-dropdown-panel:not([hidden]) {
  animation: ui-dropdown-in 0.14s ease-out;
}

.ui-dropdown-option {
  outline: none;
}

.ui-dropdown-option:hover,
.ui-dropdown-option:focus-visible {
  color: #101828 !important;
  background: #f2f4f7 !important;
}

.gallery-media,
.gallery-preview,
.gallery-preview img,
.gallery-preview video {
  aspect-ratio: 4 / 5 !important;
}

.gallery-preview {
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
}

.gallery-preview img.gallery-lazy-image,
.gallery-preview img.gallery-video-poster {
  opacity: 0 !important;
  transition: opacity 0.18s ease;
}

.gallery-preview img.gallery-lazy-image.is-loaded,
.gallery-preview img.gallery-video-poster.is-loaded {
  opacity: 1 !important;
}

.library-date-options,
.trend-sort-options,
.ui-dropdown-panel {
  z-index: 160 !important;
  color: #101828 !important;
  background: #ffffff !important;
  border-color: #d0d5dd !important;
  backdrop-filter: none !important;
}

.library-date-options *,
.trend-sort-options *,
.ui-dropdown-panel * {
  color: #101828 !important;
  opacity: 1 !important;
  text-shadow: none !important;
  -webkit-text-fill-color: currentColor;
}

.style-filter button,
.date-option,
.trend-sort-options button {
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.style-filter button:focus-visible,
.date-option:focus-visible,
.trend-sort-options button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

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

@keyframes ui-dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Local final guard: this block intentionally wins over older local overrides. */
.gallery-media,
.gallery-preview,
.gallery-preview img,
.gallery-preview video {
  aspect-ratio: 4 / 5 !important;
}

.gallery-media {
  min-height: 0;
  background: #eef2f6;
}

.gallery-preview img {
  opacity: 0;
  transition: opacity 0.18s ease;
}

.gallery-preview img.is-loaded,
.gallery-preview img.is-image-unavailable {
  opacity: 1;
}

.gallery-preview img.is-image-unavailable {
  object-fit: contain;
  background: linear-gradient(135deg, #f2f4f7, #ffffff);
}

.library-date-options,
.trend-sort-options,
.ui-dropdown-panel {
  z-index: 180 !important;
  color: #101828 !important;
  background: #ffffff !important;
  border: 1px solid #d0d5dd !important;
  box-shadow: 0 18px 46px rgba(16, 24, 40, 0.18) !important;
  backdrop-filter: none !important;
}

.library-date-options,
.ui-dropdown-panel {
  width: min(260px, calc(100vw - 32px));
  max-height: min(440px, calc(100vh - 120px));
  overflow: auto;
}

.trend-sort-options {
  min-width: 150px;
}

.library-date-options *,
.trend-sort-options *,
.ui-dropdown-panel * {
  color: inherit;
}

.library-date-options .date-option,
.trend-sort-options button,
.ui-dropdown-option {
  color: #344054 !important;
  background: transparent !important;
}

.date-options-head strong,
.date-options-head span,
.date-options-group,
.date-options-empty {
  color: #667085 !important;
  background: #ffffff !important;
}

.date-options-head strong {
  color: #101828 !important;
}

.library-date-options .date-option em {
  color: #475467 !important;
  background: #f2f4f7 !important;
}

.library-date-options .date-option.active,
.library-date-options .date-option:hover,
.trend-sort-options button[aria-pressed="true"],
.trend-sort-options button:hover,
.ui-dropdown-option:hover,
.ui-dropdown-option:focus-visible {
  color: #101828 !important;
  background: #f2f4f7 !important;
}

/* Local EOF guard: final media/dropdown stability override. */
.gallery-media {
  position: relative;
  isolation: isolate;
  background: #eef2f6 !important;
}

.gallery-media::before,
.gallery-media::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.gallery-media::before {
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(238, 242, 246, 0.92)),
    #eef2f6;
  opacity: 1;
  transition: opacity 0.18s ease;
}

.gallery-media::after {
  top: 50%;
  left: 18%;
  right: 18%;
  z-index: 1;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e4e7ec 0%, #f8fafc 45%, #e4e7ec 100%);
  background-size: 220% 100%;
  opacity: 0.88;
  transform: translateY(-50%);
  animation: gallery-skeleton-sweep 1.1s ease-in-out infinite;
}

.gallery-media.is-media-loaded::before,
.gallery-media.has-video::before,
.gallery-media.is-media-unavailable::before,
.gallery-media.is-media-loaded::after,
.gallery-media.has-video::after,
.gallery-media.is-media-unavailable::after {
  opacity: 0;
}

.gallery-preview {
  position: relative;
  z-index: 2;
  min-height: 0;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  background: transparent !important;
}

.gallery-preview img.gallery-lazy-image,
.gallery-preview img.gallery-video-poster {
  position: relative;
  z-index: 1;
  display: block;
  color: transparent !important;
  font-size: 0 !important;
  opacity: 0 !important;
  transition: opacity 0.18s ease;
}

.gallery-preview img.gallery-lazy-image.is-loaded,
.gallery-preview img.gallery-video-poster.is-loaded {
  opacity: 1 !important;
}

.gallery-preview img.gallery-lazy-image.is-image-unavailable,
.gallery-preview img.gallery-video-poster.is-image-unavailable {
  opacity: 0 !important;
}

.library-date-options,
.trend-sort-options,
.ui-dropdown-panel {
  z-index: 240 !important;
  min-width: 196px;
  padding: 8px !important;
  color: #101828 !important;
  background: #ffffff !important;
  border: 1px solid #d0d5dd !important;
  border-radius: 14px !important;
  box-shadow: 0 18px 48px rgba(16, 24, 40, 0.18) !important;
  backdrop-filter: none !important;
}

.library-date-options[hidden],
.trend-sort-options[hidden],
.ui-dropdown-panel[hidden] {
  display: none !important;
}

.library-date-options *,
.trend-sort-options *,
.ui-dropdown-panel * {
  color: #101828 !important;
  opacity: 1 !important;
  text-shadow: none !important;
  -webkit-text-fill-color: currentColor;
}

.library-date-options .date-option,
.trend-sort-options button,
.ui-dropdown-option {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px !important;
  border: 0 !important;
  border-radius: 10px !important;
  color: #344054 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  text-align: left;
  background: transparent !important;
  box-shadow: none !important;
}

.library-date-options .date-option.active,
.library-date-options .date-option:hover,
.library-date-options .date-option:focus-visible,
.trend-sort-options button[aria-pressed="true"],
.trend-sort-options button:hover,
.trend-sort-options button:focus-visible,
.ui-dropdown-option[aria-selected="true"],
.ui-dropdown-option:hover,
.ui-dropdown-option:focus-visible {
  color: #101828 !important;
  background: #f2f4f7 !important;
}

select.ui-control,
.scrape-form select,
.task-form-panel select,
.style-category-form select,
.ai-config-grid select {
  min-height: 40px;
  padding-right: 38px !important;
  color: #101828 !important;
  background-color: #ffffff !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #667085 50%),
    linear-gradient(135deg, #667085 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  border-color: #d0d5dd !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  appearance: none;
}

select.ui-control option,
.scrape-form select option,
.task-form-panel select option,
.style-category-form select option,
.ai-config-grid select option {
  color: #101828 !important;
  background: #ffffff !important;
}

.gallery-item.is-video .gallery-preview img.gallery-video-poster {
  opacity: 0 !important;
}

.gallery-item.is-video .gallery-preview video.gallery-video {
  z-index: 2;
  opacity: 1 !important;
  background: #eef2f6;
}

.gallery-item.is-video .gallery-preview video.gallery-video.is-playing {
  opacity: 1 !important;
}

/* Local premium lazy-load polish: final override. */
.gallery-media {
  overflow: hidden;
  background:
    linear-gradient(135deg, #eef2f6 0%, #f8fafc 100%) !important;
}

.gallery-media::before {
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.78), transparent 34%),
    linear-gradient(135deg, #eef2f6 0%, #f8fafc 52%, #e9eef5 100%) !important;
  transition: opacity 0.34s ease, transform 0.34s ease;
}

.gallery-media::after {
  height: 100% !important;
  inset: 0 !important;
  border-radius: inherit !important;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.58) 44%, rgba(255, 255, 255, 0) 68%),
    linear-gradient(135deg, rgba(238, 242, 246, 0.92), rgba(248, 250, 252, 0.92)) !important;
  background-size: 240% 100%, 100% 100% !important;
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  transition: opacity 0.34s ease;
}

.gallery-media.is-media-decoded::before,
.gallery-media.has-video::before {
  opacity: 0.28 !important;
}

.gallery-media.is-media-decoded::after,
.gallery-media.has-video::after {
  opacity: 0.18 !important;
}

.gallery-media.is-media-loaded::before,
.gallery-media.is-media-unavailable::before,
.gallery-media.has-video::before,
.gallery-media.is-media-loaded::after,
.gallery-media.is-media-unavailable::after,
.gallery-media.has-video::after {
  opacity: 0 !important;
}

.gallery-preview img.gallery-lazy-image,
.gallery-preview img.gallery-video-poster {
  filter: saturate(0.96) contrast(0.98);
  transition:
    opacity 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.34s ease !important;
  will-change: auto;
}

.gallery-preview img.gallery-lazy-image.is-loaded,
.gallery-preview img.gallery-video-poster.is-loaded {
  filter: saturate(1) contrast(1);
  transform: none;
}

.gallery-item {
  content-visibility: auto !important;
  contain: layout paint style;
  contain-intrinsic-size: auto 440px !important;
}

.image-gallery {
  overflow-anchor: none;
}

@keyframes gallery-premium-sheen {
  0% {
    background-position: 140% 0, 0 0;
  }
  100% {
    background-position: -140% 0, 0 0;
  }
}

/* Local lazy-load visibility final override. */
.gallery-item:not(.is-video) .gallery-preview img.gallery-lazy-image.is-loaded {
  opacity: 1 !important;
}

.gallery-item.is-video .gallery-preview img.gallery-video-poster.is-loaded {
  opacity: 0 !important;
}

.gallery-item.is-video .gallery-preview video.gallery-video {
  opacity: 1 !important;
}

.gallery-media.is-media-loaded::before,
.gallery-media.is-media-loaded::after,
.gallery-media.has-video::before,
.gallery-media.has-video::after {
  opacity: 0 !important;
  animation: none !important;
}

/* Local modal layout final override. */
.image-modal {
  z-index: 220 !important;
  padding: clamp(10px, 2.4vw, 24px) !important;
}

.modal-dialog {
  width: min(1240px, calc(100vw - 24px)) !important;
  height: min(92dvh, 820px) !important;
  max-height: calc(100dvh - 24px) !important;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  border-radius: 18px !important;
}

.modal-media-panel {
  min-width: 0 !important;
  min-height: 0 !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  background: #0b1220 !important;
}

.modal-media-frame {
  min-width: 0 !important;
  min-height: 0 !important;
  grid-row: 1 !important;
  padding: 16px !important;
}

.modal-media-frame img,
.modal-media-frame video {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

.modal-info {
  grid-row: 2 !important;
  width: 100% !important;
  padding: 12px 16px 14px !important;
  background: rgba(11, 18, 32, 0.96) !important;
}

.modal-comments-panel {
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.modal-close {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  z-index: 230 !important;
}

.modal-media-panel {
  grid-column: 1 !important;
  grid-row: 1 !important;
}

.modal-comments-panel {
  grid-column: 2 !important;
  grid-row: 1 !important;
}

@media (max-width: 1100px) {
  .modal-dialog {
    width: min(760px, calc(100vw - 20px)) !important;
    height: min(94dvh, 900px) !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(260px, 54dvh) minmax(190px, 1fr) !important;
  }

  .modal-comments-panel {
    grid-column: 1 !important;
    grid-row: 2 !important;
    border-left: 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
  }

  .modal-media-panel {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .modal-comments-head {
    min-height: 56px !important;
    padding: 12px 60px 10px 18px !important;
  }

  .modal-comments-list {
    padding: 10px 16px 18px !important;
  }
}

@media (max-width: 640px) {
  .image-modal {
    padding: 8px !important;
  }

  .modal-dialog {
    width: calc(100vw - 16px) !important;
    height: calc(100dvh - 16px) !important;
    grid-template-rows: minmax(240px, 52dvh) minmax(180px, 1fr) !important;
    border-radius: 14px !important;
  }

  .modal-media-frame {
    padding: 10px !important;
  }
}

/* Local absolute final guard: navigation, settings headers and sticky library filters. */
.media-library.dashboard-view.active .library-titlebar {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
}

.media-library.dashboard-view.active .library-filter-stack {
  position: sticky !important;
  top: 76px !important;
  z-index: 80 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-items: stretch !important;
  gap: 8px !important;
  margin-top: 10px !important;
  padding: 10px !important;
  background: rgba(255, 255, 255, 0.97) !important;
  border: 1px solid #eaecf0 !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08) !important;
  transform: translateZ(0);
  contain: layout paint style;
  backdrop-filter: blur(10px);
}

.media-library.dashboard-view.active .library-filter-stack .top-filter,
.media-library.dashboard-view.active .filter-row .style-filter {
  display: flex !important;
  flex-wrap: wrap !important;
  min-width: 0 !important;
  gap: 7px !important;
}

.media-library.dashboard-view.active .filter-row {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 8px !important;
  width: 100% !important;
}

.settings-view.dashboard-view.active .library-header {
  min-height: 56px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 12px 18px !important;
  border: 1px solid #eaecf0 !important;
  border-radius: 12px !important;
  color: #101828 !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.06) !important;
}

.settings-view.dashboard-view.active .library-header .eyebrow {
  margin: 0 0 2px !important;
  color: #e60023 !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
}

.settings-view.dashboard-view.active .library-header h2 {
  margin: 0 !important;
  color: #101828 !important;
  font-size: 22px !important;
  line-height: 1.15 !important;
  letter-spacing: 0 !important;
}

.settings-view.dashboard-view.active .library-header p:not(.eyebrow) {
  display: none !important;
}

.sidebar-menu nav a[data-view="system"],
.sidebar-menu nav a[data-view="settings"] {
  height: 40px !important;
  padding: 0 11px !important;
  border-radius: 9px !important;
  color: #475467 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.sidebar-menu nav a[data-view="system"] span,
.sidebar-menu nav a[data-view="settings"] span {
  width: 22px !important;
  height: 22px !important;
  border-radius: 8px !important;
  color: #667085 !important;
  background: #f2f4f7 !important;
}

.sidebar-menu nav a[data-view="system"]:hover,
.sidebar-menu nav a[data-view="settings"]:hover {
  color: #101828 !important;
  background: #f9fafb !important;
}

.sidebar-menu nav a[data-view="system"].active,
.sidebar-menu nav a[data-view="settings"].active {
  color: #e60023 !important;
  background: #fff1f3 !important;
  box-shadow: inset 3px 0 0 #e60023 !important;
}

.sidebar-menu nav a[data-view="system"].active span,
.sidebar-menu nav a[data-view="settings"].active span {
  color: #e60023 !important;
  background: #ffe4e8 !important;
}

/* Final EOF guard: uniform product cards and normal scrolling filters. */
.media-library.dashboard-view.active .library-filter-stack {
  position: static !important;
  top: auto !important;
  z-index: 1 !important;
}

.image-gallery {
  align-items: start !important;
  grid-auto-rows: auto !important;
}

.gallery-item {
  --product-card-media-height: 220px;
  --product-card-stats-height: 112px;
  --product-card-trend-height: 144px;
  width: 100% !important;
  height: calc(var(--product-card-media-height) + var(--product-card-stats-height) + var(--product-card-trend-height)) !important;
  min-height: calc(var(--product-card-media-height) + var(--product-card-stats-height) + var(--product-card-trend-height)) !important;
  max-height: calc(var(--product-card-media-height) + var(--product-card-stats-height) + var(--product-card-trend-height)) !important;
  display: grid !important;
  grid-template-rows: var(--product-card-media-height) var(--product-card-stats-height) var(--product-card-trend-height) !important;
  overflow: hidden !important;
  contain-intrinsic-size: 190px 476px !important;
}

.gallery-media,
.gallery-preview {
  width: 100% !important;
  height: var(--product-card-media-height) !important;
  min-height: var(--product-card-media-height) !important;
  max-height: var(--product-card-media-height) !important;
  aspect-ratio: auto !important;
}

.gallery-preview img,
.gallery-preview video,
.gallery-preview img.gallery-lazy-image,
.gallery-preview img.gallery-video-poster {
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
}

.gallery-stats {
  height: var(--product-card-stats-height) !important;
  min-height: var(--product-card-stats-height) !important;
  max-height: var(--product-card-stats-height) !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-rows: 50px !important;
  align-content: start !important;
  overflow: hidden !important;
}

.gallery-stats[data-metric-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.metric-card,
.gallery-stats[data-metric-count="4"] .metric-card {
  height: 50px !important;
  min-height: 50px !important;
  max-height: 50px !important;
  overflow: hidden !important;
}

.metric-card strong,
.metric-card em,
.gallery-stats strong,
.gallery-stats em {
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.mini-trend-chart {
  height: calc(var(--product-card-trend-height) - 16px) !important;
  min-height: calc(var(--product-card-trend-height) - 16px) !important;
  max-height: calc(var(--product-card-trend-height) - 16px) !important;
  display: grid !important;
  grid-template-rows: 16px 48px 14px minmax(0, 1fr) !important;
  overflow: hidden !important;
}

.mini-trend-chart svg {
  height: 48px !important;
  margin: 4px 0 1px !important;
}

.mini-trend-head,
.mini-trend-foot {
  min-height: 14px !important;
  overflow: hidden !important;
}

.mini-trend-summary {
  min-height: 44px !important;
  max-height: 44px !important;
  overflow: hidden !important;
}

.mini-trend-summary span {
  display: block !important;
  overflow: hidden !important;
  line-height: 1.35 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.mini-trend-empty {
  height: 100% !important;
  min-height: 0 !important;
}

@media (min-width: 1440px) {
  .gallery-item {
    --product-card-media-height: 230px;
    --product-card-stats-height: 112px;
    --product-card-trend-height: 144px;
  }
}

@media (max-width: 760px) {
  .gallery-item {
    --product-card-media-height: 210px;
    --product-card-stats-height: 108px;
    --product-card-trend-height: 136px;
  }
}

/* Final login override: keep auth fields readable after all global controls run. */
.login-view .input-wrap input,
.login-view .input-wrap input.ui-control,
.login-view .input-wrap input.ui-control:focus,
.login-view .input-wrap input.ui-control:focus-visible,
.login-view .input-wrap input.ui-control.is-focused,
.login-view .input-wrap input.ui-control.has-value,
.login-view .input-wrap input:-webkit-autofill,
.login-view .input-wrap input:-webkit-autofill:hover,
.login-view .input-wrap input:-webkit-autofill:focus {
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.075)),
    radial-gradient(circle at 100% 0, rgba(255, 255, 255, 0.08), transparent 32%) !important;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.09) !important;
}

.login-view .input-wrap input.ui-control:focus,
.login-view .input-wrap input.ui-control:focus-visible,
.login-view .input-wrap input.ui-control.is-focused {
  border-color: rgba(255, 122, 144, 0.78) !important;
  box-shadow: 0 0 0 4px rgba(230, 0, 35, 0.24), 0 16px 34px rgba(0, 0, 0, 0.24) !important;
}

.login-view .input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.48) !important;
  opacity: 1 !important;
}

/* Keep product cards visible behind the enlarged image. */
.image-modal .modal-backdrop {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}


  /* ==================== 任务列表 (Task Center) 全面美化样式 ==================== */
  .task-center-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 18px 24px !important;
    border-radius: 16px !important;
    background: linear-gradient(135deg, #ffffff 0%, #fcfcfd 100%) !important;
    border: 1px solid #e4e7ec !important;
    box-shadow: 0 4px 16px rgba(16, 24, 40, 0.03) !important;
  }
  .task-center-hero:not(.active) {
    display: none !important;
  }
  .task-hero-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }
  .task-hero-title-row h2 {
    margin: 0 !important;
    font-size: 22px !important;
    font-weight: 900 !important;
    color: #101828 !important;
    letter-spacing: -0.02em;
  }
  .task-engine-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px !important;
    padding: 0 10px !important;
    border-radius: 999px;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #027a48 !important;
    background: #ecfdf3 !important;
    border: 1px solid #abefc6;
  }
  .task-engine-pill i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #12b76a;
    box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.2);
    display: inline-block;
  }
  .task-center-hero .hero-copy p {
    margin: 4px 0 0 !important;
    font-size: 13px !important;
    color: #667085 !important;
  }
  .task-kpi-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  .task-kpi-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 104px;
    padding: 8px 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
  }
  .task-kpi-item span {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    line-height: 1.2;
  }
  .task-kpi-item strong {
    margin-top: 3px;
    font-size: 18px;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
  }
  .task-kpi-item.highlight-amber {
    background: #fffbeb;
    border-color: #fde68a;
  }
  .task-kpi-item.highlight-amber span { color: #b45309; }
  .task-kpi-item.highlight-amber strong { color: #d97706; }

  .task-kpi-item.highlight-green {
    background: #f0fdf4;
    border-color: #bbf7d0;
  }
  .task-kpi-item.highlight-green span { color: #15803d; }
  .task-kpi-item.highlight-green strong { color: #16a34a; }

  .task-kpi-item.highlight-brand {
    background: #fff1f2;
    border-color: #fecdd3;
  }
  .task-kpi-item.highlight-brand span { color: #be123c; }
  .task-kpi-item.highlight-brand strong { color: #e11d48; }

  /* 任务队列面板 */
  .task-board {
    padding: 18px 20px !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    border: 1px solid #e4e7ec !important;
    box-shadow: 0 4px 20px rgba(16, 24, 40, 0.04) !important;
  }
  .task-board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px !important;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
  }
  .task-board-title-group {
    display: flex;
    align-items: baseline;
    gap: 10px;
  }
  .task-board-title-group strong {
    margin: 0 !important;
    font-size: 17px !important;
    font-weight: 900 !important;
    color: #0f172a !important;
  }
  .task-board-title-group span {
    font-size: 12.5px !important;
    font-weight: 600;
    color: #64748b !important;
  }
  .task-board-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
  }
  .task-filter-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border-radius: 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
  }
  .task-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 10px;
    border: none;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
  }
  .task-filter-tab:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.6);
  }
  .task-filter-tab.active {
    color: #e60023;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    font-weight: 800;
  }
  .task-filter-tab .tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 16px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    background: rgba(100, 116, 139, 0.14);
    color: #475569;
  }
  .task-filter-tab.active .tab-count {
    background: #ffe4e8;
    color: #e60023;
  }
  .task-search-box {
    position: relative;
    width: 190px;
  }
  .task-search-box input {
    width: 100%;
    height: 32px !important;
    padding: 0 10px 0 28px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    font-size: 12.5px !important;
    color: #1e293b !important;
    background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") no-repeat 8px center !important;
    box-shadow: none !important;
  }
  .task-search-box input:focus {
    background-color: #ffffff !important;
    border-color: #e60023 !important;
    outline: none;
  }

  /* 列表表头 */
  .task-table-header {
    display: grid;
    grid-template-columns: minmax(240px, 1.7fr) minmax(220px, 1.25fr) 155px 124px 128px;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    margin-bottom: 6px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    font-size: 12px;
    font-weight: 800;
    color: #64748b;
  }
  .task-board.is-collapsed .task-table-header,
  .task-board.is-collapsed .task-filter-tabs,
  .task-board.is-collapsed .task-search-box {
    display: none !important;
  }

  /* 任务滚动容器 */
  .task-list {
    display: flex !important;
    flex-direction: column;
    gap: 8px !important;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
  }
  .task-list::-webkit-scrollbar {
    width: 6px;
  }
  .task-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #cbd5e1;
  }

  /* 单行任务卡片 */
  .task-row {
    display: grid !important;
    grid-template-columns: minmax(240px, 1.7fr) minmax(220px, 1.25fr) 155px 124px 128px !important;
    align-items: center !important;
    gap: 12px !important;
    min-height: 60px !important;
    padding: 10px 16px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    cursor: pointer;
    transition: all 0.16s ease;
    position: relative;
  }
  .task-row:hover {
    border-color: #cbd5e1 !important;
    background: #f8fafc !important;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
  }
  .task-row.is-active {
    border-color: #fda4af !important;
    border-left: 4px solid #e60023 !important;
    background: #fff8f9 !important;
    box-shadow: 0 4px 14px rgba(230, 0, 35, 0.07);
  }
  .task-row.queued {
    border-color: #fde68a !important;
    background: #fffdf5 !important;
  }
  .task-row.running {
    border-color: #93c5fd !important;
    background: #f0f9ff !important;
  }
  .task-row.empty {
    display: block !important;
    padding: 28px 16px !important;
    text-align: center;
    color: #64748b !important;
    background: #f8fafc !important;
    border: 1px dashed #cbd5e1 !important;
    cursor: default;
  }

  /* 第1列：任务标题与参数标签 */
  .task-col-main {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
  }
  .task-title-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }
  .task-type-tag {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 7px;
    border-radius: 5px;
    font-size: 11px !important;
    font-weight: 800 !important;
    background: #f1f5f9;
    color: #475569 !important;
  }
  .task-type-tag.is-scheduled {
    background: #f3e8ff;
    color: #7e22ce !important;
  }
  .task-type-tag.is-comments {
    background: #e0f2fe;
    color: #0369a1 !important;
  }
  .task-source-title {
    font-size: 14px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .task-meta-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
  }
  .task-meta-tags span {
    display: inline-flex;
    align-items: center;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    background: #f8fafc;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
  }
  .task-meta-tags span.chunk-tag {
    color: #0369a1 !important;
    background: #f0f9ff;
    border-color: #bae6fd;
  }
  .task-meta-tags span.scan-tag {
    color: #b45309 !important;
    background: #fffbeb;
    border-color: #fde68a;
  }

  /* 第2列：采集结果三色胶囊 */
  .task-col-metrics {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
  }
  .task-metric-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 25px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 12px !important;
    font-weight: 700 !important;
    font-variant-numeric: tabular-nums;
    border: 1px solid transparent;
  }
  .task-metric-pill b {
    font-weight: 900;
  }
  .task-metric-pill.pill-saved {
    color: #15803d !important;
    background: #dcfce7;
    border-color: #bbf7d0;
  }
  .task-metric-pill.pill-skipped {
    color: #334155 !important;
    background: #f1f5f9;
    border-color: #e2e8f0;
  }
  .task-metric-pill.pill-failed {
    color: #b91c1c !important;
    background: #fee2e2;
    border-color: #fecaca;
  }
  .task-metric-pill.pill-zero {
    color: #94a3b8 !important;
    background: #f8fafc;
    border-color: #f1f5f9;
    font-weight: 600 !important;
  }

  /* 第3列：时间与耗时 */
  .task-col-time {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }
  .task-col-time .time-primary {
    font-size: 12.5px !important;
    font-weight: 700 !important;
    color: #334155 !important;
    white-space: nowrap;
  }
  .task-col-time .time-duration {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #94a3b8 !important;
    white-space: nowrap;
  }

  /* 第4列：状态胶囊（绝不换行溢出） */
  .task-col-status {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
  }
  .task-row em.task-status-pill {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    height: 26px !important;
    padding: 0 10px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    font-style: normal;
    white-space: nowrap !important;
    width: auto !important;
    max-width: 100%;
  }
  .task-row em.task-status-pill.is-done,
  .task-row em.task-status-pill.is-done-partial {
    color: #027a48 !important;
    background: #ecfdf3 !important;
    border: 1px solid #a6f4c5;
  }
  .task-row em.task-status-pill.is-running {
    color: #1d4ed8 !important;
    background: #dbeafe !important;
    border: 1px solid #93c5fd;
  }
  .task-row em.task-status-pill.is-queued {
    color: #b45309 !important;
    background: #fef3c7 !important;
    border: 1px solid #fde68a;
  }
  .task-row em.task-status-pill.is-warn {
    color: #c2410c !important;
    background: #ffedd5 !important;
    border: 1px solid #fed7aa;
  }
  .task-row em.task-status-pill.is-failed {
    color: #b42318 !important;
    background: #fef3f2 !important;
    border: 1px solid #fecdca;
  }
  .task-row em.task-status-pill.is-scheduled {
    color: #6d28d9 !important;
    background: #ede9fe !important;
    border: 1px solid #ddd6fe;
  }
  .task-row em.task-status-pill.is-disabled {
    color: #64748b !important;
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0;
  }

  /* 第5列：操作按钮 */
  .task-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
  }
  .task-actions button {
    height: 28px !important;
    padding: 0 9px !important;
    border-radius: 7px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    color: #475569 !important;
    cursor: pointer;
    white-space: nowrap;
  }
  .task-actions button:hover {
    border-color: #cbd5e1 !important;
    background: #f8fafc !important;
    color: #0f172a !important;
  }
  .task-actions button.btn-log.is-viewing {
    color: #e60023 !important;
    background: #fff1f2 !important;
    border-color: #fecdd3 !important;
  }
  .task-actions button.btn-delete:hover {
    color: #e11d48 !important;
    background: #fff1f2 !important;
    border-color: #fecdd3 !important;
  }

  /* 下方工作区：新建任务 + 实时日志 双栏对等布局 */
  .workspace-grid[data-panel="scrape"].active {
    display: grid !important;
    grid-template-columns: minmax(340px, 1fr) minmax(380px, 1.25fr) !important;
    gap: 16px !important;
    align-items: stretch !important;
  }
  .workspace-grid[data-panel="scrape"] .activity-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .log-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
  }
  .log-card-head .section-title {
    margin-bottom: 0 !important;
  }
  .log-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .log-active-badge {
    display: inline-flex;
    align-items: center;
    max-width: 220px;
    height: 26px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
    background: #f1f5f9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .copy-log-btn {
    height: 28px !important;
    padding: 0 10px !important;
    border-radius: 7px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #334155 !important;
    cursor: pointer;
  }
  .copy-log-btn:hover {
    background: #f8fafc !important;
    color: #0f172a !important;
  }
  .workspace-grid[data-panel="scrape"] .task-output {
    flex: 1;
    min-height: 290px !important;
    max-height: 380px !important;
    padding: 14px 16px !important;
    font-size: 12.5px !important;
    line-height: 1.65 !important;
    border-radius: 12px !important;
    background: #0f172a !important;
    color: #e2e8f0 !important;
    border: 1px solid #1e293b !important;
  }
  .tool-inline-tip {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .tool-inline-tip strong {
    color: #334155;
    white-space: nowrap;
  }

  @media (max-width: 1100px) {
    .task-table-header {
      display: none !important;
    }
    .task-row {
      grid-template-columns: 1fr auto !important;
      gap: 8px !important;
    }
    .workspace-grid[data-panel="scrape"].active {
      grid-template-columns: 1fr !important;
    }
  }
