/* Dasha — pink theme, shared layout */

:root {
  --pink-50: #fff5f7;
  --pink-100: #ffe4ec;
  --pink-200: #fecdd6;
  --pink-300: #fda4b8;
  --pink-400: #fb7198;
  --pink-500: #f43f5e;
  --pink-600: #e11d48;
  --pink-700: #be123c;
  --text: #1f0a12;
  --text-muted: #6b4553;
  --surface: #ffffff;
  --shadow: 0 4px 24px rgba(225, 29, 72, 0.12);
  --shadow-nav: 0 8px 32px rgba(190, 18, 60, 0.08);
  --radius: 16px;
  --radius-pill: 9999px;
  --font: "Outfit", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--pink-50);
  background-image:
    radial-gradient(ellipse 120% 80% at 0% 0%, rgba(253, 164, 184, 0.35) 0%, transparent 50%),
    radial-gradient(ellipse 100% 60% at 100% 10%, rgba(244, 63, 94, 0.15) 0%, transparent 45%),
    linear-gradient(180deg, var(--pink-50) 0%, var(--pink-100) 100%);
}

a {
  color: var(--pink-600);
  text-decoration: none;
}

a:hover {
  color: var(--pink-700);
}

/* Top bar — [ brand | nav (center column) | meta (right) ] */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(253, 164, 184, 0.35);
  box-shadow: var(--shadow-nav);
}

.app-header .brand {
  justify-self: start;
  min-width: 0;
}

.app-header__nav,
.app-header > .nav-pills {
  justify-self: center;
}

.app-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem 1.25rem;
  min-width: 0;
  justify-self: end;
  max-width: 100%;
}

.header-logout {
  display: inline-block;
  padding: 0;
  line-height: 0;
}

.header-logout:hover {
  opacity: 0.85;
}

.header-logout img {
  width: 28px;
  height: 28px;
  display: block;
}

.header-status {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-muted);
  max-width: min(44ch, 100%);
  text-align: center;
}

.app-header__meta .alert--header,
.alert--header {
  margin: 0;
  display: inline-block;
  padding: 0.5rem 0.9rem;
  font-size: 0.88rem;
  line-height: 1.4;
  border-radius: var(--radius-pill);
  max-width: min(44ch, 100%);
}

.app-header__meta .alert--ok strong,
.alert--header.alert--ok strong {
  color: inherit;
  font-weight: 700;
}

.header-status--err {
  color: #9f1239;
  text-align: left;
  max-width: 100%;
}

.header-balance {
  display: inline-block;
  padding: 0.45rem 1rem;
  background: #0a0a0a;
  border: 1px solid #262626;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--pink-500) 0%, var(--pink-600) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35);
}

/* Nav pills */
.nav-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem;
  background: var(--pink-100);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(253, 164, 184, 0.4);
}

.nav-pills a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.nav-pills a:hover {
  color: var(--pink-700);
  background: rgba(255, 255, 255, 0.7);
}

.nav-pills a.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--pink-500) 0%, var(--pink-600) 100%);
  box-shadow: 0 2px 12px rgba(225, 29, 72, 0.35);
}

.nav-pills a.is-active:hover {
  color: #fff;
}

/* Main */
.app-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 1.5rem 3rem;
}

/* Topics: use full viewport width, wider columns */
.app-main--topics {
  max-width: none;
  width: 100%;
  padding: 10px clamp(1rem, 2.5vw, 2.5rem) 3rem;
  box-sizing: border-box;
}

/* Jobs: full width for date + topic + wide table */
.app-main--jobs {
  max-width: none;
  width: 100%;
  padding: 10px clamp(1rem, 2.5vw, 2.5rem) 3rem;
  box-sizing: border-box;
}

.app-main--images {
  max-width: none;
  width: 100%;
  padding: 10px clamp(1rem, 2.5vw, 2.5rem) 3rem;
  box-sizing: border-box;
}

.jobs-page-card {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}

.page-hero {
  margin: 0 0 10px;
  padding: 0;
}

.page-hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, var(--pink-700) 0%, var(--pink-500) 50%, #db2777 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--pink-700);
}

.page-hero p {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 36ch;
}

/* Placeholder card (jobs will go here) */
.content-card {
  background: #fff1f6;
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(253, 164, 184, 0.3);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.content-card--muted {
  background: linear-gradient(180deg, #fff1f6 0%, #ffe7f1 100%);
}

.content-card--left {
  text-align: left;
  display: block;
  align-items: stretch;
  justify-content: flex-start;
}

/* Alerts */
.alert {
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
  border: 1px solid transparent;
}

.alert--ok {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #6ee7b7;
  color: #064e3b;
}

.alert--err {
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  border-color: #fda4af;
  color: #881337;
}

.alert.alert--header {
  margin: 0;
}

.site-toast {
  position: fixed !important;
  top: 5.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(0.5rem);
  z-index: 12000 !important;
  width: min(92vw, 760px);
  margin: 0;
  border-radius: 14px;
  padding: 0.8rem 1.05rem;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.site-toast[hidden] {
  display: none !important;
}

.site-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.site-toast--hide {
  opacity: 0;
  transform: translateX(-50%) translateY(0.5rem);
}

.site-toast details,
.site-toast summary {
  margin: 0;
}

/* Stats / org */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-pill {
  background: var(--pink-100);
  border: 1px solid rgba(253, 164, 184, 0.5);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.stat-pill .label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.stat-pill .value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
}

/* Jobs table */
.jobs-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(253, 164, 184, 0.35);
}

.jobs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.jobs-table th,
.jobs-table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(253, 164, 184, 0.25);
}

.jobs-table th {
  font-weight: 600;
  color: var(--text-muted);
  background: var(--pink-50);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.jobs-table tr:last-child td {
  border-bottom: none;
}

.jobs-table code {
  font-size: 0.82rem;
  background: var(--pink-100);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  color: var(--pink-700);
}

.jobs-cell-date {
  font-weight: 700;
  color: var(--pink-800);
  white-space: nowrap;
}

.jobs-cell-topic {
  min-width: 8rem;
  max-width: 28rem;
  word-break: break-word;
}

.jobs-cell-taskid {
  white-space: nowrap;
}

.jobs-taskid-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pink-700);
  background: var(--pink-100);
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(244, 63, 94, 0.25);
  cursor: help;
}

.jobs-taskid-label:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(244, 63, 94, 0.45);
}

.jobs-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.jobs-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  text-decoration: none;
  line-height: 1;
  cursor: pointer;
}

.jobs-action img {
  width: 30px;
  height: 30px;
  display: block;
}

.jobs-action--open img {
  width: 40px;
  height: 20px;
}

.jobs-action.is-copied {
  opacity: 0.55;
}

.jobs-prompt-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.jobs-prompt-trigger img {
  width: 35px;
  height: 35px;
  display: block;
}

.jobs-gpt-dialog {
  width: min(54rem, 92vw);
  border: none;
  padding: 0;
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.22);
}

.jobs-gpt-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.jobs-gpt-dialog__card {
  margin: 0;
  padding: 1rem 1rem 1.1rem;
}

.jobs-gpt-dialog__head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
  position: relative;
}

.jobs-gpt-dialog__head h2 {
  margin: 0;
  font-size: 1rem;
  text-align: center;
}

.jobs-gpt-dialog__close {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(253, 164, 184, 0.45);
  border-radius: 8px;
  background: #fff;
  width: 2rem;
  height: 2rem;
  font-size: 1.1rem;
  cursor: pointer;
}

.jobs-gpt-dialog__text {
  margin: 0;
  max-height: 62vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: center;
  background: var(--pink-50);
  border: 1px solid rgba(253, 164, 184, 0.4);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  font-family: var(--font);
  font-size: 0.9rem;
  line-height: 1.45;
}

.jobs-copy-toast {
  position: fixed !important;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%) translateY(8px);
  z-index: 10070;
  margin: 0;
  padding: 0.55rem 0.95rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.jobs-copy-toast[hidden] {
  display: none !important;
}

.jobs-copy-toast--ok {
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}

.jobs-copy-toast--err {
  background: #ffe4e6;
  border: 1px solid #fda4af;
  color: #9f1239;
}

.jobs-copy-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.jobs-copy-toast--hide {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge--pending {
  background: #fef3c7;
  color: #92400e;
}

.badge--running {
  background: #dbeafe;
  color: #1e3a5f;
}

.badge--ok {
  background: #d1fae5;
  color: #065f46;
}

.badge--bad {
  background: #fee2e2;
  color: #991b1b;
}

.muted {
  color: var(--text-muted);
}

.org-section__title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  color: var(--text);
  font-weight: 700;
}

.org-section__lede {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.45;
}

.dashboard-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.dashboard-two-col__item.content-card {
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .dashboard-two-col {
    grid-template-columns: 1fr;
  }
}

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

/* Settings */
.app-main--settings {
  max-width: 58rem;
}

.settings-toast {
  position: fixed !important;
  bottom: 1.75rem;
  left: 50%;
  z-index: 10050;
  max-width: min(90vw, 22rem);
  margin: 0;
  padding: 0.85rem 1.35rem;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(225, 29, 72, 0.15);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-50%, 0.75rem, 0);
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.settings-toast[hidden] {
  display: none !important;
}

.settings-toast--show {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}

.settings-toast--hide {
  opacity: 0;
  transform: translate3d(-50%, 0.75rem, 0);
}

.settings-toast--ok {
  color: #064e3b;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #6ee7b7;
}

.settings-messages {
  margin-bottom: 1.5rem;
}

.settings-messages .alert:last-child {
  margin-bottom: 0;
}

/* Settings — accordion (exclusive open via <details name> in supporting browsers) */
.settings-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.settings-acc {
  border-radius: 14px;
  border: 1px solid rgba(253, 164, 184, 0.45);
  background: linear-gradient(180deg, #fff 0%, var(--pink-50) 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.settings-acc[open] {
  box-shadow: 0 4px 28px rgba(225, 29, 72, 0.12);
  border-color: rgba(244, 63, 94, 0.4);
}

.settings-acc__summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.settings-acc__summary::-webkit-details-marker {
  display: none;
}

.settings-acc__summary::marker {
  content: none;
}

.settings-acc__summary:hover {
  background: linear-gradient(90deg, rgba(244, 63, 94, 0.06) 0%, rgba(255, 255, 255, 0) 100%);
}

.settings-acc[open] .settings-acc__summary {
  border-bottom: 1px solid rgba(253, 164, 184, 0.4);
  background: linear-gradient(180deg, #fff8fa 0%, rgba(255, 255, 255, 0.65) 100%);
}

.settings-acc__summary:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--pink-400);
}

.settings-acc__summary-main {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  text-align: left;
  flex: 1 1 auto;
}

.settings-acc__heading {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.settings-acc__chev {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--pink-100) 0%, #fff 100%);
  border: 1px solid rgba(253, 164, 184, 0.5);
  transition: transform 0.2s ease, background 0.2s;
}

.settings-acc__chev::after {
  content: "";
  display: block;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid var(--pink-600);
  border-bottom: 2px solid var(--pink-600);
  transform: translateY(-0.1rem) rotate(45deg);
  transition: transform 0.2s ease;
}

.settings-acc[open] .settings-acc__chev::after {
  transform: translateY(0.1rem) rotate(225deg);
}

.settings-acc__panel {
  padding: 0 1.1rem 1.3rem 1.25rem;
  animation: settings-acc-fade 0.2s ease;
}

@keyframes settings-acc-fade {
  from {
    opacity: 0.85;
  }

  to {
    opacity: 1;
  }
}

.settings-acc__panel .settings-form {
  padding: 0.35rem 0 0;
}

.settings-prompt-hull {
  margin: 0;
}

.settings-prompt-hull__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.settings-prompt-frame {
  position: relative;
  border-radius: 14px;
  border: 1px solid rgba(253, 164, 184, 0.5);
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 12px rgba(190, 18, 60, 0.06);
  padding: 0.25rem;
}

.settings-prompt {
  display: block;
  width: 100%;
  min-height: 18rem;
  box-sizing: border-box;
  margin: 0;
  padding: 1rem 1.1rem;
  font-family: var(--font);
  font-size: 0.9rem;
  line-height: 1.55;
  border: none;
  border-radius: 11px;
  background: linear-gradient(180deg, #fffbfc 0%, #fff 0.5rem);
  color: var(--text);
  resize: vertical;
}

.settings-prompt--compact {
  min-height: 9rem;
}

.settings-prompt::placeholder {
  color: #a1a1aa;
}

.settings-prompt:focus {
  outline: none;
  background: #fff;
}

.settings-prompt-frame:focus-within {
  border-color: var(--pink-400);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 0 3px rgba(244, 63, 94, 0.18);
}

.settings-form__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.4rem;
  padding-top: 1.25rem;
  border-top: 1px dashed rgba(253, 164, 184, 0.5);
}

@media (max-width: 520px) {
  .settings-form__bar {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-save-btn {
    width: 100%;
    justify-content: center;
  }
}

.settings-save-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.35rem;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  background: linear-gradient(135deg, var(--pink-500) 0%, var(--pink-600) 100%);
  color: #fff;
  box-shadow: 0 3px 14px rgba(225, 29, 72, 0.28);
  transition: filter 0.15s, transform 0.1s, box-shadow 0.15s;
  flex: 0 0 auto;
}

.settings-save-btn:hover {
  filter: brightness(1.05);
  color: #fff;
  box-shadow: 0 5px 20px rgba(225, 29, 72, 0.32);
}

.settings-save-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(244, 63, 94, 0.4);
}

.settings-social-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.settings-social-row {
  display: grid;
  grid-template-columns: 30px 92px minmax(0, 1fr);
  align-items: start;
  gap: 0.55rem;
}

.settings-social-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.settings-social-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.settings-social-input {
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(253, 164, 184, 0.55);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  line-height: 1.35;
}

.settings-social-textarea {
  min-height: 7.25rem;
  resize: vertical;
}

.settings-social-input:focus {
  outline: none;
  border-color: var(--pink-400);
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.15);
}

.settings-social-icon--instagram { background: linear-gradient(135deg, #f58529 0%, #dd2a7b 45%, #8134af 75%, #515bd4 100%); }
.settings-social-icon--threads { background: #111827; }
.settings-social-icon--facebook { background: #1877f2; }
.settings-social-icon--tiktok { background: #0f172a; }
.settings-social-icon--youtube { background: #ff0000; }
.settings-social-icon--x { background: #0f172a; }

/* Create (Topic / Image / Video / Audio) */
.create-card {
  min-height: unset;
  padding: 1.5rem 1.75rem 1.75rem;
}

.create-block {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(253, 164, 184, 0.35);
}

.create-block:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.create-block__title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.create-block__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.9rem;
  margin-bottom: 0;
  background: #fff;
  border: 1px solid rgba(253, 164, 184, 0.45);
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
}

.create-block__head .create-block__title {
  margin: 0;
  min-width: 0;
}

.create-cascade {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem 1.25rem;
  align-items: start;
}

@media (max-width: 560px) {
  .create-cascade {
    grid-template-columns: 1fr;
  }
}

.create-field {
  min-width: 0;
}

.create-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.create-select {
  width: 100%;
  max-width: 100%;
  padding: 0.55rem 0.75rem;
  font-family: var(--font);
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--text);
  background: #fff;
  border: 1px solid rgba(253, 164, 184, 0.55);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  cursor: pointer;
}

.create-select:focus {
  outline: none;
  border-color: var(--pink-400);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.2);
}

.create-select:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background: var(--pink-50);
}

/* Create page — image panel (Runway + ChatGPT merge) */
.create-image-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  column-gap: clamp(1.25rem, 3.5vw, 2.5rem);
  row-gap: 1.1rem;
  margin: 0 0 1.1rem;
  padding: 0.35rem 0 0.15rem;
}

.create-image-inline--video-three {
  justify-content: center;
  align-items: flex-end;
  column-gap: clamp(1.5rem, 4vw, 2.75rem);
}

.create-image-inline--video-three .create-image-field--inline-center {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.create-image-inline--video-three .create-image-field__label {
  width: 100%;
  text-align: center;
}

.create-image-field--inline-quality {
  min-width: min(100%, 17rem);
}

.create-image-inline--video-three .create-quality__switch-wrap {
  justify-content: center;
  flex: 0 1 auto;
  width: 100%;
  max-width: 22rem;
}

.create-image-inline--video-three .create-image-field--inline-duration .create-select,
.create-image-inline--video-three .create-image-field--inline-ratio .create-select {
  margin-inline: auto;
}

.create-image-inline .create-quality {
  margin-bottom: 0;
  flex: 0 1 auto;
  min-width: min(100%, 16rem);
}

.create-image-field--inline-ratio {
  flex: 0 1 auto;
  min-width: 11rem;
  max-width: 100%;
}

.create-image-field--inline-duration {
  flex: 0 1 auto;
  min-width: 10rem;
  max-width: 100%;
}

.create-image-field--inline-name {
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 100%;
}

.create-image-field--inline-ratio .create-select {
  min-width: 10.5rem;
  width: 100%;
  max-width: 20rem;
}

.create-image-field--inline-duration .create-select {
  min-width: 8.5rem;
  width: 100%;
  max-width: 14rem;
}

.create-image-field--inline-name .create-image-input {
  min-width: 0;
  width: 100%;
  max-width: 22rem;
}

.create-image-field--inline-name .create-select {
  width: 300px;
  min-width: 300px;
  max-width: 300px;
}

.create-image-field--inline-duration .create-image-field__label,
.create-image-field--inline-name .create-image-field__label,
.create-image-field--inline-quality .create-image-field__label {
  margin-bottom: 0.4rem;
}

.create-image-field--video-ref {
  margin: 0 0 1.1rem;
}

.create-social {
  margin: 0.8rem 0 0;
}

.create-social__label {
  margin: 0 0 0.45rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}

.create-social__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem 1rem;
}

.create-social__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  user-select: none;
}

.create-social__item:not(:last-child)::after {
  content: "|";
  margin-left: 0.65rem;
  color: rgba(31, 10, 18, 0.4);
  font-weight: 600;
}

.create-social__item input[type="checkbox"] {
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
}

.create-social__icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.create-social__name {
  font-size: 0.82rem;
  color: var(--text);
}

.create-social__icon--instagram { background: linear-gradient(135deg, #f58529 0%, #dd2a7b 45%, #8134af 75%, #515bd4 100%); }
.create-social__icon--threads { background: #111827; }
.create-social__icon--facebook { background: #1877f2; }
.create-social__icon--tiktok { background: #0f172a; }
.create-social__icon--youtube { background: #ff0000; }
.create-social__icon--x { background: #0f172a; }

.create-image-field--inline-ref {
  flex: 1 1 14rem;
  min-width: 10rem;
  max-width: 100%;
}

.create-image-field--inline-ref .create-image-input {
  min-width: 0;
  width: 100%;
  max-width: 32rem;
}

.create-image-turbo-hint {
  font-size: 0.8rem;
  line-height: 1.4;
  margin: -0.15rem 0 0.5rem;
  max-width: 52rem;
}

.create-upload-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.create-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem 1.6rem;
  align-items: start;
}

.create-upload-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.create-upload-col .create-image-field__label {
  width: 100%;
  text-align: center;
}

.create-upload-col .create-select {
  flex: 0 0 auto;
  width: 300px;
  min-width: 300px;
  max-width: 300px;
  height: 2.25rem;
  box-sizing: border-box;
}

.create-upload-file {
  flex: 0 0 260px;
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  height: 2.25rem;
  box-sizing: border-box;
  padding: 0.18rem 0.35rem;
  border: 1px solid rgba(253, 164, 184, 0.55);
  border-radius: 10px;
  background: #fff;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.8rem;
  line-height: 1.2;
}

.create-upload-file::file-selector-button,
.create-upload-file::-webkit-file-upload-button,
.images-upload-row .create-image-input[type="file"]::file-selector-button,
.images-upload-row .create-image-input[type="file"]::-webkit-file-upload-button {
  border: 1px solid #93c5fd;
  border-radius: 8px;
  background: #dbeafe;
  color: #1e3a8a;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.42rem 0.62rem;
  margin-right: 0.52rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.create-upload-file:hover::file-selector-button,
.create-upload-file:hover::-webkit-file-upload-button,
.images-upload-row .create-image-input[type="file"]:hover::file-selector-button,
.images-upload-row .create-image-input[type="file"]:hover::-webkit-file-upload-button {
  background: #bfdbfe;
}

.create-upload-file:disabled::file-selector-button,
.create-upload-file:disabled::-webkit-file-upload-button,
.images-upload-row .create-image-input[type="file"]:disabled::file-selector-button,
.images-upload-row .create-image-input[type="file"]:disabled::-webkit-file-upload-button {
  opacity: 0.65;
  cursor: not-allowed;
}

.create-upload-btn {
  flex: 0 0 auto;
  height: 2.25rem;
  border: 1px solid #93c5fd;
  border-radius: 9px;
  background: #dbeafe;
  color: #1e3a8a;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.52rem 0.75rem;
  line-height: 1;
  cursor: pointer;
}

.create-upload-btn:hover:not(:disabled) {
  background: #bfdbfe;
}

.create-upload-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.images-upload-row .topics-btn--primary {
  border-color: #93c5fd;
  background: #dbeafe;
  color: #1e3a8a;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.images-upload-row .topics-btn--primary:hover {
  background: #bfdbfe;
  color: #1e3a8a;
  filter: none;
}

.create-image-inline .create-quality__row {
  gap: 0.5rem 1.5rem;
}

.create-image-inline .create-quality__switch-wrap {
  gap: 0.55rem 1.15rem;
}

.create-image-field--inline-ratio .create-image-field__label,
.create-image-field--inline-ref .create-image-field__label {
  margin-bottom: 0.4rem;
}

.create-image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  margin: 0 0 1.1rem;
  align-items: end;
}

.create-image-field--wide {
  grid-column: 1 / -1;
}

.create-image-field__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.create-image-optional {
  text-transform: none;
  font-weight: 500;
  letter-spacing: 0;
  font-size: 0.7rem;
  color: #a1a1aa;
}

.create-image-input {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.5rem 0.7rem;
  font-family: var(--font);
  font-size: 0.9rem;
  line-height: 1.35;
  border: 1px solid rgba(253, 164, 184, 0.55);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}

.create-image-input::placeholder {
  color: #a1a1aa;
}

.create-image-input:focus {
  outline: none;
  border-color: var(--pink-400);
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.15);
}

.create-image-field--prompt {
  margin: 0 0 1.1rem;
}

.create-image-prompt {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.65rem 0.85rem;
  min-height: 9rem;
  font-family: var(--font);
  font-size: 0.9rem;
  line-height: 1.45;
  border: 1px solid rgba(253, 164, 184, 0.55);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  resize: vertical;
}

.create-image-prompt:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background: var(--pink-50);
}

.create-image-prompt:focus {
  outline: none;
  border-color: var(--pink-400);
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.15);
}

.create-image-prompt__note {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
}

@media (max-width: 600px) {
  .create-image-inline {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    row-gap: 1.25rem;
    padding: 0.2rem 0 0.1rem;
  }

  .create-image-inline--video-three {
    align-items: center;
  }

  .create-image-field--inline-ratio,
  .create-image-field--inline-duration,
  .create-image-field--inline-name,
  .create-image-field--inline-quality {
    min-width: 0;
  }

  .create-image-field--inline-ratio .create-select,
  .create-image-field--inline-duration .create-select {
    max-width: none;
  }

  .create-image-field--inline-name .create-image-input {
    max-width: none;
  }

  .create-image-field--inline-name .create-select {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .create-image-field--inline-ref .create-image-input {
    max-width: none;
  }

  .create-image-grid {
    grid-template-columns: 1fr;
  }

  .create-upload-inline .create-select {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .create-upload-file {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .create-upload-grid {
    grid-template-columns: 1fr;
  }

  .create-upload-col .create-select {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
}

/* Create page — GENERATE */
.create-generate-wrap {
  margin-top: 0.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(253, 164, 184, 0.35);
}

.create-generate {
  width: 300px;
  display: block;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  font-family: var(--font);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--pink-500) 0%, var(--pink-600) 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(225, 29, 72, 0.28);
  cursor: pointer;
  transition: filter 0.15s, opacity 0.15s, box-shadow 0.15s;
}

.create-generate:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow: 0 6px 24px rgba(225, 29, 72, 0.35);
}

.create-generate:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(244, 63, 94, 0.45);
}

.create-generate:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  filter: none;
}

.create-generate__hint {
  margin: 0.85rem 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
  text-align: center;
}

.create-processing {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.32);
}

.create-processing[hidden] {
  display: none !important;
}

.create-processing__card {
  min-width: min(92vw, 480px);
  padding: 1.4rem 1.8rem;
  border-radius: 14px;
  background: #ffffff;
  border: 2px solid rgba(34, 197, 94, 0.45);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.create-processing__title,
.create-processing__subtitle {
  margin: 0;
  color: #15803d;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.create-processing__title {
  font-size: 1.32rem;
  line-height: 1.25;
}

.create-processing__subtitle {
  margin-top: 0.45rem;
  font-size: 1.05rem;
  line-height: 1.3;
}

/* Create page — toggles (Image) */
/* Native checkbox: invisible hit target over track */
.create-switch {
  position: relative;
  display: inline-block;
  width: 2.75rem;
  height: 1.6rem;
  flex: 0 0 auto;
}

.create-switch--quality {
  width: 2.75rem;
}

.create-switch__input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  border: 0;
}

.create-switch__input:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.create-switch__track {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  border-radius: 9999px;
  background: #e2e8f0;
  border: 1px solid rgba(253, 164, 184, 0.45);
  transition: background 0.2s, border-color 0.2s;
  pointer-events: none;
}

.create-switch__thumb {
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
  pointer-events: none;
}

.create-switch__input:checked + .create-switch__track {
  background: linear-gradient(135deg, var(--pink-500) 0%, var(--pink-600) 100%);
  border-color: transparent;
}

.create-switch__input:checked + .create-switch__track .create-switch__thumb {
  transform: translateX(1.15rem);
}

.create-switch__input:disabled + .create-switch__track {
  background: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.45);
  opacity: 0.7;
}

.create-switch__input:focus-visible + .create-switch__track {
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.22);
}

.create-block__panel {
  margin-top: 1.15rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(253, 164, 184, 0.35);
}

.create-quality {
  max-width: 100%;
  margin-bottom: 1.35rem;
}

.create-quality__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
}

.create-quality__lede {
  /* Match .create-image-field__label (Aspect ratio, etc.) */
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0;
  flex: 0 0 auto;
}

.create-quality__switch-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  flex: 1 1 16rem;
  min-width: 0;
}

.create-quality__opt {
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--text-muted);
  transition: color 0.2s, font-weight 0.2s;
  white-space: nowrap;
}

.create-quality__switch-wrap[data-quality="normal"] .create-quality__opt--left,
.create-quality__switch-wrap[data-quality="high"] .create-quality__opt--right {
  color: var(--text);
  font-weight: 700;
}

/* Topics admin (three-column layout) */
.topics-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.topics-3col {
  display: grid;
  grid-template-columns: minmax(200px, 1.05fr) minmax(220px, 1.1fr) minmax(0, 2.4fr);
  gap: 1.25rem clamp(1rem, 2vw, 1.75rem);
  align-items: start;
  width: 100%;
  min-width: 0;
}

.topics-3col > * {
  min-width: 0;
}

.topics-col.content-card {
  min-height: unset;
  padding: 1.25rem 1.35rem;
}

.topics-col__h {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.topics-c1-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.topics-input--full {
  width: 100%;
  flex: unset;
}

/* New category + add topic: one line only */
/* Override .topics-input { flex: 1 1 180px } — in a column flex parent that grows the field tall */
.topics-c1-form .topics-input,
.topics-c3-add .topics-input {
  display: block;
  flex: 0 0 auto;
  align-self: stretch;
  box-sizing: border-box;
  width: 100%;
  min-height: 0;
  height: 2.125rem;
  padding: 0 0.6rem;
  font-size: 0.86rem;
  line-height: 1.2;
  border-radius: 8px;
}

.topics-btn--block {
  width: 100%;
  justify-content: center;
}

.topics-c1-form .topics-btn--block {
  padding: 0.4rem 0.75rem;
  font-size: 0.86rem;
}

.topics-c2-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.topics-c2-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.topics-c2-link {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.topics-c2-link:hover {
  background: var(--pink-100);
  border-color: rgba(253, 164, 184, 0.4);
}

.topics-c2-link.is-active {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.12) 0%, rgba(225, 29, 72, 0.14) 100%);
  border-color: rgba(244, 63, 94, 0.35);
  font-weight: 700;
  color: var(--pink-700);
}

.topics-c2-link__text {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.topics-c2-link__n {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.7);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  flex: 0 0 auto;
}

.topics-c2-link.is-active .topics-c2-link__n {
  color: var(--pink-700);
}

.topics-c2-del {
  flex: 0 0 auto;
  margin: 0;
}

.topics-c2-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  border: 1px solid rgba(253, 164, 184, 0.5);
  border-radius: 8px;
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.topics-c2-x:hover {
  background: #fff1f2;
  color: #9f1239;
}

.topics-bulk {
  margin-bottom: 1rem;
}

.topics-bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.topics-bulk-toolbar .topics-btn {
  flex: 0 0 auto;
}

.topics-bulk-toolbar .topics-select {
  flex: 1 1 180px;
  min-width: 0;
  max-width: none;
}

.topics-c3-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.topics-c3-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem 0.65rem;
  padding: 0.55rem 0.65rem;
  background: var(--pink-50);
  border: 1px solid rgba(253, 164, 184, 0.4);
  border-radius: 10px;
  min-width: 0;
}

.topics-c3-item.is-used {
  background: #ecfdf3;
  border-color: rgba(34, 197, 94, 0.45);
}

.topics-c3-cb {
  flex: 0 0 auto;
  margin-top: 0.2rem;
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
}

.topics-c3-txt-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  cursor: pointer;
  padding-top: 0.05rem;
}

.topics-c3-used-pill {
  flex: 0 0 auto;
  align-self: center;
  padding: 0.14rem 0.48rem;
  border-radius: 9999px;
  border: 1px solid rgba(34, 197, 94, 0.45);
  background: #dcfce7;
  color: #166534;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

#topic-select option.create-topic-option-used {
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
}

.topics-c3-xform {
  flex: 0 0 auto;
  margin: 0;
}

.topics-c3-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  font-size: 1.15rem;
  line-height: 1;
  border: 1px solid rgba(253, 164, 184, 0.5);
  border-radius: 8px;
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
}

.topics-c3-x:hover {
  background: #fff1f2;
  color: #9f1239;
}

.topics-c3-add {
  margin: 0 0 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(253, 164, 184, 0.35);
}

.topics-c3-add-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 520px) {
  .topics-c3-add-row {
    flex-direction: row;
    align-items: center;
  }

  .topics-c3-add-row .topics-input {
    flex: 1 1 auto;
    min-width: 0;
  }

  .topics-c3-add-row .topics-btn {
    flex: 0 0 auto;
  }
}

.topics-grid {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 1.25rem 1.5rem;
  align-items: start;
  width: 100%;
  min-width: 0;
}

/* Let grid columns shrink; default min-width:auto breaks nested wide flex children */
.topics-grid > * {
  min-width: 0;
}

/* Topics cards: don’t use the default 200px min-height + flex center from .content-card */
.topics-side.content-card,
.topics-main.content-card {
  min-height: unset;
}

.topics-side {
  padding: 1.25rem 1.35rem;
  position: sticky;
  top: 1rem;
  align-self: start;
}

.topics-side__title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.topics-side__add {
  margin-bottom: 1rem;
}

.topics-side__add-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.topics-catnav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.topics-catnav__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.topics-catnav__item:hover {
  background: var(--pink-100);
  border-color: rgba(253, 164, 184, 0.4);
}

.topics-catnav__item.is-active {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.12) 0%, rgba(225, 29, 72, 0.14) 100%);
  border-color: rgba(244, 63, 94, 0.35);
  font-weight: 700;
  color: var(--pink-700);
}

.topics-catnav__name {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.topics-catnav__count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.7);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}

.topics-catnav__item.is-active .topics-catnav__count {
  color: var(--pink-700);
}

.topics-main {
  padding: 1.35rem 1.5rem 1.5rem;
  min-height: 12rem;
}

.topics-panel {
  margin-bottom: 1.75rem;
}

.topics-panel:last-child {
  margin-bottom: 0;
}

.topics-panel--add {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(253, 164, 184, 0.35);
  margin-bottom: 1.5rem;
}

.topics-panel__h {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.topics-panel__lede {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.topics-panel__sub {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.topics-rename-cat__wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1.25rem;
}

.topics-rename-cat {
  flex: 1 1 220px;
  min-width: 0;
}

.topics-rename-cat__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.topics-rename-cat__del {
  flex: 0 0 auto;
}

.topics-form-add-topic {
  max-width: 100%;
}

.topics-form-row {
  margin-bottom: 0.75rem;
}

.topics-field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.topics-textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.55rem 0.75rem;
  font-family: var(--font);
  font-size: 0.9rem;
  line-height: 1.4;
  border: 1px solid rgba(253, 164, 184, 0.55);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  resize: vertical;
}

.topics-textarea:focus {
  outline: none;
  border-color: var(--pink-400);
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.15);
}

.topics-select {
  width: 100%;
  max-width: 420px;
  padding: 0.5rem 0.7rem;
  font-family: var(--font);
  font-size: 0.9rem;
  border: 1px solid rgba(253, 164, 184, 0.55);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.topics-input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  font-family: var(--font);
  font-size: 0.9rem;
  border: 1px solid rgba(253, 164, 184, 0.55);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}

.topics-input:focus,
.topics-select:focus {
  outline: none;
  border-color: var(--pink-400);
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.15);
}

.topics-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.9rem;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid rgba(253, 164, 184, 0.5);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.topics-btn:hover {
  background: var(--pink-50);
}

.topics-btn--primary {
  background: linear-gradient(135deg, var(--pink-500) 0%, var(--pink-600) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.25);
}

.topics-btn--primary:hover {
  filter: brightness(1.05);
  color: #fff;
}

.topics-btn--danger {
  color: #9f1239;
  border-color: #fecdd3;
  background: #fff1f2;
}

.topics-btn--danger:hover {
  background: #ffe4e6;
}

/* Images manager */
.images-manager {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}

.images-upload-form {
  margin-bottom: 1.1rem;
  width: min(900px, 100%);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.images-upload-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: center;
}

.images-upload-label {
  margin: 0;
  white-space: nowrap;
}

.images-upload-row .create-image-input {
  width: 300px;
  max-width: 300px;
  flex: 0 0 300px;
  min-width: 0;
}

.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 220px));
  gap: 0.9rem;
  justify-content: flex-start;
}

.images-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  background: #fff;
  border: 1px solid rgba(253, 164, 184, 0.38);
  border-radius: 12px;
  padding: 0.7rem;
}

.images-thumb-link {
  display: block;
  width: 160px;
  height: 284px;
  max-width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: var(--pink-50);
}

.images-thumb {
  display: block;
  width: 160px;
  height: 284px;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center;
}

.images-card-meta {
  min-width: 0;
  width: 160px;
  min-height: 5.2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: center;
}

.images-card-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.3;
}

.images-make-video-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding: 0.35rem 0.65rem;
  border-radius: 9px;
  border: 1px solid rgba(244, 63, 94, 0.35);
  background: #fff;
  color: var(--pink-700);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.images-make-video-btn:hover {
  background: var(--pink-50);
  color: var(--pink-700);
}

.images-card-sub {
  font-size: 0.76rem;
  line-height: 1.35;
}

.images-delete-form {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  margin: 0;
}

.images-delete-x {
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid #fca5a5;
  border-radius: 9999px;
  background: #ef4444;
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  font-weight: 700;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.images-delete-x:hover {
  background: #dc2626;
}

.images-delete-dialog {
  border: none;
  border-radius: 14px;
  padding: 0;
  width: min(26rem, 92vw);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.22);
}

.images-delete-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.images-delete-dialog__card {
  margin: 0;
  padding: 1.15rem 1.2rem 1rem;
  text-align: center;
}

.images-delete-dialog__title {
  margin: 0;
  font-size: 1.02rem;
  color: var(--text);
}

.images-delete-dialog__text {
  margin: 0.5rem 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.images-delete-dialog__actions {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
}

.images-delete-dialog__btn {
  border: 1px solid rgba(253, 164, 184, 0.45);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

.images-delete-dialog__btn--cancel:hover {
  background: var(--pink-50);
}

.images-delete-dialog__btn--danger {
  background: #ef4444;
  border-color: #fca5a5;
  color: #fff;
}

.images-delete-dialog__btn--danger:hover {
  background: #dc2626;
}

.images-toast {
  position: fixed !important;
  bottom: 1.75rem;
  left: 50%;
  z-index: 10060;
  max-width: min(90vw, 24rem);
  margin: 0;
  padding: 0.85rem 1.35rem;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(225, 29, 72, 0.15);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-50%, 0.75rem, 0);
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.images-toast[hidden] {
  display: none !important;
}

.images-toast--show {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}

.images-toast--hide {
  opacity: 0;
  transform: translate3d(-50%, 0.75rem, 0);
}

.images-toast--ok {
  color: #064e3b;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #6ee7b7;
}

.images-toast--err {
  color: #881337;
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  border: 1px solid #fda4af;
}

.topics-topic {
  background: var(--pink-50);
  border: 1px solid rgba(253, 164, 184, 0.4);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
}

.topics-topic__edit {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.65rem;
  margin-bottom: 0.65rem;
}

.topics-topic__edit .topics-textarea {
  flex: 1 1 200px;
  min-height: 3.2rem;
  min-width: 0;
}

.topics-topic__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
  padding-top: 0.35rem;
  border-top: 1px dashed rgba(253, 164, 184, 0.45);
}

.topics-topic__move {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  flex: 1 1 200px;
  min-width: 0;
}

.topics-topic__move .topics-field-label {
  margin: 0;
  text-transform: none;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.topics-topic__move .topics-select {
  flex: 1 1 160px;
  max-width: 280px;
}

.topics-topic__del {
  flex: 0 0 auto;
  margin-left: auto;
}

.topics-quick-add {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(253, 164, 184, 0.35);
}

.topics-quick-add__row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (max-width: 1000px) {
  .topics-3col {
    grid-template-columns: 1fr 1fr;
  }

  .topics-col--topics {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .topics-3col {
    grid-template-columns: 1fr;
  }

  .topics-col--topics {
    grid-column: auto;
  }
}

@media (max-width: 900px) {
  .topics-grid {
    grid-template-columns: 1fr;
  }

  .topics-side {
    position: static;
  }
}

@media (max-width: 480px) {
  .app-header {
    padding: 0.75rem 1rem;
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .app-header .brand {
    justify-self: center;
  }

  .app-header__nav,
  .app-header > .nav-pills {
    justify-self: stretch;
    width: 100%;
    justify-content: center;
  }

  .app-header__meta {
    justify-content: center;
    justify-self: stretch;
  }

  .header-logout {
    width: 100%;
  }

  .header-status {
    text-align: center;
  }

  .nav-pills a {
    flex: 1;
    min-width: 0;
  }
}

.login-page {
  min-height: 100vh;
  margin: 0;
  position: relative;
  overflow: hidden;
}

.login-page::before,
.login-page::after {
  content: "";
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(12px);
  pointer-events: none;
}

.login-page::before {
  width: min(42vw, 520px);
  height: min(42vw, 520px);
  top: -8rem;
  left: -6rem;
  background: radial-gradient(circle at center, rgba(244, 63, 94, 0.3) 0%, rgba(244, 63, 94, 0) 70%);
}

.login-page::after {
  width: min(46vw, 560px);
  height: min(46vw, 560px);
  bottom: -10rem;
  right: -8rem;
  background: radial-gradient(circle at center, rgba(253, 164, 184, 0.45) 0%, rgba(253, 164, 184, 0) 72%);
}

.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-card {
  width: min(30rem, 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 245, 247, 0.96) 100%);
  border: 1px solid rgba(253, 164, 184, 0.5);
  border-radius: 1.35rem;
  box-shadow: 0 24px 60px rgba(190, 18, 60, 0.18), 0 8px 22px rgba(190, 18, 60, 0.08);
  padding: 2.1rem;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.7rem;
}

.login-brand .brand-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
}

.login-brand__text {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--pink-700);
}

.login-kicker {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.login-card h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3.4vw, 2.25rem);
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, var(--pink-700) 0%, var(--pink-500) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--pink-700);
}

.login-sub {
  margin: 0.35rem 0 1.35rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.login-form {
  display: grid;
  gap: 0.6rem;
}

.login-form label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-form input {
  border: 1px solid rgba(253, 164, 184, 0.5);
  border-radius: 0.7rem;
  padding: 0.78rem 0.85rem;
  font: inherit;
  margin-bottom: 0.55rem;
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.login-form input::placeholder {
  color: #b06b82;
}

.login-form input:focus {
  outline: none;
  border-color: var(--pink-400);
  box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.14);
  background: #fff;
}

.login-form button {
  margin-top: 0.65rem;
  border: 0;
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--pink-500) 0%, var(--pink-600) 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(225, 29, 72, 0.32);
  transition: transform 0.12s, filter 0.15s, box-shadow 0.15s;
}

.login-form button:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(225, 29, 72, 0.35);
}

.login-form button:active {
  transform: translateY(0);
}

.login-card .alert {
  margin: 0.35rem 0 1rem;
  border-radius: 0.75rem;
}

@media (max-width: 560px) {
  .login-shell {
    padding: 1rem;
  }

  .login-card {
    padding: 1.4rem 1.15rem;
    border-radius: 1rem;
  }
}
