:root {
  color-scheme: dark;
  --bg: #08090b;
  --bg-2: #101114;
  --panel: #121317;
  --panel-2: #191b20;
  --panel-3: #eff0eb;
  --ink: #f3f4ef;
  --ink-dark: #101114;
  --muted: #a0a3a8;
  --muted-2: #6f737a;
  --line: #2a2d33;
  --line-strong: #4b4f58;
  --accent: #f3f4ef;
  --accent-ink: #08090b;
  --warn: #d2d3ce;
  --danger: #d26a5f;
  --glass: rgba(18, 19, 23, 0.78);
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.42);
  --radius: 8px;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(243, 244, 239, 0.035) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(rgba(243, 244, 239, 0.03) 1px, transparent 1px) 0 0 / 44px 44px,
    radial-gradient(circle at 78% 10%, rgba(243, 244, 239, 0.14), transparent 30%),
    var(--bg);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.028), transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent 1px);
  background-size: 100% 3px, 3px 100%;
  mix-blend-mode: screen;
  opacity: 0.42;
}

body::after {
  content: "";
  position: fixed;
  right: clamp(-170px, -8vw, -72px);
  top: clamp(52px, 9vw, 120px);
  z-index: -1;
  width: clamp(360px, 42vw, 720px);
  aspect-ratio: 1;
  pointer-events: none;
  border-radius: 50%;
  background:
    radial-gradient(circle at 44% 50%, rgba(8, 9, 11, 0.98) 0 29%, transparent 29.5%),
    radial-gradient(circle at 52% 48%, rgba(243, 244, 239, 0.92) 0 37%, transparent 37.4%),
    radial-gradient(circle at 50% 50%, rgba(243, 244, 239, 0.12) 40%, transparent 63%);
  filter: drop-shadow(0 0 46px rgba(243, 244, 239, 0.18));
  opacity: 0.7;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.app-shell {
  min-height: 100dvh;
  position: relative;
  isolation: isolate;
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    conic-gradient(from 120deg at 78% 18%, transparent 0 32deg, rgba(243, 244, 239, 0.12) 34deg 35deg, transparent 38deg 360deg),
    radial-gradient(circle at 78% 18%, transparent 0 22%, rgba(243, 244, 239, 0.08) 22.2% 22.5%, transparent 22.7%),
    radial-gradient(circle at 78% 18%, transparent 0 34%, rgba(243, 244, 239, 0.04) 34.2% 34.6%, transparent 34.8%);
  opacity: 0.78;
}

.loading-view,
.auth-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.loading-view {
  color: var(--muted);
}

.brand-mark {
  position: relative;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--ink-dark);
  font-weight: 900;
  letter-spacing: 0;
  isolation: isolate;
  overflow: hidden;
  user-select: none;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  z-index: -1;
  border-radius: 50%;
}

.brand-mark::before {
  border: 1px solid rgba(8, 9, 11, 0.42);
  transform: rotate(18deg) scaleX(1.18);
}

.brand-mark::after {
  background: linear-gradient(90deg, transparent, rgba(8, 9, 11, 0.22), transparent);
  transform: translateX(-140%);
}

.auth-card {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(360px, 0.72fr);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(120%);
  box-shadow: var(--shadow);
}

.auth-art {
  position: relative;
  min-height: 630px;
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(180deg, #16171b, #090a0c);
}

.auth-art::before {
  content: "";
  position: absolute;
  right: -120px;
  top: 70px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 42% 50%, #07080a 0 42%, transparent 42.5%),
    radial-gradient(circle at 50% 50%, #f3f4ef 0 53%, transparent 53.5%);
  box-shadow: 0 0 70px rgba(243, 244, 239, 0.18);
  opacity: 0.88;
}

.auth-art::after {
  content: "";
  position: absolute;
  inset: 0;
  height: auto;
  background:
    linear-gradient(90deg, transparent 0 16%, rgba(243, 244, 239, 0.08) 16.2% 16.4%, transparent 16.6% 100%),
    linear-gradient(180deg, transparent 0 68%, rgba(243, 244, 239, 0.1) 68.2% 68.4%, transparent 68.6% 100%);
  mask-image: radial-gradient(circle at 62% 36%, black, transparent 68%);
  pointer-events: none;
}

.auth-title,
.preview-strip {
  position: relative;
  z-index: 1;
}

.auth-title {
  max-width: 560px;
}

.kicker {
  margin: 18px 0 14px;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(40px, 6vw, 74px);
  line-height: 0.96;
  letter-spacing: 0;
}

.auth-title p {
  max-width: 48ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.preview-strip {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
}

.preview-tile {
  min-height: 170px;
  padding: 16px;
  border: 1px solid rgba(243, 244, 239, 0.18);
  border-radius: var(--radius);
  background: rgba(8, 9, 11, 0.68);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.preview-canvas {
  position: relative;
  min-height: 190px;
  background:
    radial-gradient(circle at 45% 50%, #08090b 0 29%, transparent 29.7%),
    radial-gradient(circle at 54% 48%, #f3f4ef 0 39%, transparent 39.6%),
    radial-gradient(circle at 51% 49%, transparent 0 48%, rgba(243, 244, 239, 0.2) 48.2% 49%, transparent 49.2%),
    linear-gradient(135deg, #101114, #08090b);
}

.preview-canvas::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(243, 244, 239, 0.16);
  border-radius: 50%;
  transform: rotate(-18deg) scaleY(0.34);
}

.mini-bars {
  display: grid;
  gap: 8px;
}

.mini-bars span {
  height: 10px;
  border-radius: 99px;
  background: #3b3f46;
  transform-origin: left;
}

.mini-bars span:nth-child(2) {
  width: 72%;
  background: #777b82;
}

.mini-bars span:nth-child(3) {
  width: 46%;
  background: var(--ink);
}

.auth-panel {
  padding: 34px;
  background: rgba(12, 13, 16, 0.96);
}

.auth-tabs,
.view-tabs,
.segmented {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}

.auth-tabs button,
.view-tabs button,
.segmented button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 9px 12px;
  white-space: nowrap;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.auth-tabs button.active,
.view-tabs button.active,
.segmented button.active {
  background: var(--ink);
  color: var(--ink-dark);
}

.form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.flush-form {
  margin-top: 0;
}

.field {
  display: grid;
  gap: 7px;
}

.field label,
.toggle span:first-child {
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

.field small,
.toggle small {
  color: var(--muted);
  line-height: 1.45;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #0c0d10;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

.field textarea {
  min-height: 152px;
  resize: vertical;
  line-height: 1.5;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #777b82;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(243, 244, 239, 0.14);
}

.captcha-row,
.button-row {
  display: flex;
  gap: 10px;
  align-items: end;
}

.captcha-row .field {
  flex: 1;
}

.captcha-chip {
  min-width: 118px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: var(--panel-2);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
}

.btn {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 780;
  white-space: nowrap;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.btn:hover,
.captcha-chip:hover,
.side-nav button:hover {
  border-color: rgba(243, 244, 239, 0.74);
  box-shadow: 0 0 0 1px rgba(243, 244, 239, 0.08), 0 14px 34px rgba(0, 0, 0, 0.26);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary,
.btn.dark {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--ink-dark);
}

.btn.warn {
  border-color: var(--danger);
  color: #ffd1cc;
  background: rgba(210, 106, 95, 0.08);
}

.notice {
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--ink);
  border-radius: var(--radius);
  padding: 12px 13px;
  color: var(--muted);
  background: rgba(243, 244, 239, 0.045);
  line-height: 1.45;
}

.notice.error {
  border-left-color: var(--danger);
  color: #ffd1cc;
  background: rgba(210, 106, 95, 0.08);
}

.workspace {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 20px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(243, 244, 239, 0.045), transparent 22%),
    rgba(8, 9, 11, 0.88);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.sidebar-brand strong {
  display: block;
}

.sidebar-brand span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 11px 12px;
  text-align: left;
  font-weight: 740;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.side-nav button.active {
  border-color: var(--line-strong);
  background: var(--ink);
  color: var(--ink-dark);
}

.user-box {
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

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

.user-box span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.full-width {
  width: 100%;
  margin-top: 12px;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  min-height: 64px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.topbar h2 {
  margin: 0 0 4px;
  font-size: 28px;
  letter-spacing: 0;
}

.topbar p {
  margin: 0;
  color: var(--muted);
}

.status-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 7px 10px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.pill.ok {
  border-color: rgba(243, 244, 239, 0.32);
  color: var(--ink);
  background: rgba(243, 244, 239, 0.08);
}

.pill.warn {
  border-color: rgba(210, 106, 95, 0.42);
  color: #ffd1cc;
  background: rgba(210, 106, 95, 0.08);
}

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

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(243, 244, 239, 0.045), transparent 36%),
    rgba(18, 19, 23, 0.9);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 46px rgba(0, 0, 0, 0.24);
  position: relative;
  overflow: hidden;
}

.panel::before,
.stat-card::before,
.history-item::before,
.user-row::before,
.log-row::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0 36%, rgba(243, 244, 239, 0.08) 48%, transparent 60% 100%);
  transform: translateX(-120%);
}

.panel-header,
.panel-body {
  padding: 18px;
}

.panel-header {
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.panel-header h3 {
  margin: 0 0 5px;
}

.panel-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 54px;
  gap: 10px;
  align-items: center;
}

input[type="range"] {
  accent-color: var(--ink);
}

.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.switch {
  width: 44px;
  height: 24px;
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: #2d3036;
  position: relative;
}

.switch::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  top: 2px;
  left: 3px;
  border-radius: 50%;
  background: #c5c8c9;
  transition: transform 0.16s ease;
}

.switch:checked {
  background: var(--ink);
  border-color: var(--ink);
}

.switch:checked::after {
  background: var(--ink-dark);
  transform: translateX(18px);
}

.output-grid {
  min-height: 560px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.progress-panel {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(243, 244, 239, 0.07), transparent 46%),
    rgba(8, 9, 11, 0.64);
  position: relative;
  overflow: hidden;
}

.progress-panel::after {
  content: "";
  position: absolute;
  inset: -80px auto -80px -35%;
  width: 46%;
  background: linear-gradient(90deg, transparent, rgba(243, 244, 239, 0.1), transparent);
  transform: skewX(-18deg);
}

.progress-topline,
.progress-foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.progress-topline strong,
.progress-topline span {
  display: block;
}

.progress-topline strong {
  margin-bottom: 4px;
}

.progress-topline span,
.progress-foot {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.progress-topline b {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 22px;
}

.progress-track {
  height: 10px;
  margin: 14px 0 10px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: #08090b;
}

.progress-track progress {
  display: block;
  width: 100%;
  height: 100%;
  appearance: none;
  border: 0;
  background: transparent;
}

.progress-track progress::-webkit-progress-bar {
  background: transparent;
}

.progress-track progress::-webkit-progress-value {
  border-radius: 99px;
  background:
    linear-gradient(90deg, rgba(243, 244, 239, 0.5), var(--ink)),
    var(--ink);
  transition: width 0.45s ease;
}

.progress-track progress::-moz-progress-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(243, 244, 239, 0.5), var(--ink));
  transition: width 0.45s ease;
}

.image-card {
  min-height: 268px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(243, 244, 239, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(243, 244, 239, 0.04) 25%, transparent 25%),
    #0d0e11;
  background-size: 24px 24px;
  display: grid;
  place-items: center;
  position: relative;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.image-card:hover {
  border-color: rgba(243, 244, 239, 0.45);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
  transform: translateY(-2px);
}

.result-card {
  display: grid;
  grid-template-rows: minmax(220px, 1fr) auto;
  place-items: stretch;
}

.image-preview {
  border: 0;
  width: 100%;
  min-height: 220px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
}

.image-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #f3f4ef;
}

.image-actions {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px;
  border-top: 1px solid var(--line);
  background: rgba(8, 9, 11, 0.92);
}

.image-actions span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.image-actions div {
  display: flex;
  gap: 8px;
}

.btn.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.image-card.empty {
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.span-all {
  grid-column: 1 / -1;
}

.image-card.loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(243, 244, 239, 0.18), transparent 80%);
  animation: sweep 1.1s linear infinite;
}

.image-card.loading::after {
  content: "";
  position: absolute;
  width: 96px;
  height: 96px;
  border: 1px solid rgba(243, 244, 239, 0.24);
  border-radius: 50%;
  background:
    radial-gradient(circle at 42% 50%, #08090b 0 38%, transparent 39%),
    radial-gradient(circle at 54% 48%, rgba(243, 244, 239, 0.86) 0 48%, transparent 49%);
}

@keyframes sweep {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

.history-list,
.admin-list {
  display: grid;
  gap: 10px;
}

.history-item,
.user-row,
.log-row {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 12px;
}

.history-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
}

.history-thumb {
  width: 78px;
  height: 78px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  object-fit: cover;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.meta span {
  padding: 4px 7px;
  border-radius: 99px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
}

.history-item p,
.log-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.stat-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px;
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.admin-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.user-row {
  display: grid;
  gap: 10px;
}

.invite-create-form,
.invite-edit-form {
  display: grid;
  gap: 12px;
}

.invite-create-form {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1.2fr) 120px auto;
  align-items: end;
  margin-bottom: 14px;
}

.invite-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 12px;
}

.invite-edit-form {
  grid-template-columns: minmax(150px, 0.9fr) minmax(180px, 1.2fr) 150px minmax(132px, 0.7fr) auto;
  align-items: end;
}

.invite-usage {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 7px;
  align-items: center;
}

.invite-usage span {
  color: var(--muted);
  font-weight: 800;
}

.invite-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.compact-toggle {
  min-height: 42px;
  margin: 0;
}

.user-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

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

.settings-grid {
  display: grid;
  gap: 12px;
}

.mt-panel {
  margin-top: 18px;
}

.hidden {
  display: none !important;
}

.eclipse-egg-active {
  --ink: #ffffff;
  --muted: #f3f4ef;
}

.eclipse-egg-active .app-shell {
  animation: eggPulse 0.7s ease both;
}

.easter-arming .brand-mark {
  transform: scale(0.96) rotate(-3deg);
}

@media (prefers-reduced-motion: no-preference) {
  body::after {
    animation: eclipseDrift 16s ease-in-out infinite alternate;
  }

  .app-shell::before {
    animation: orbitSweep 22s linear infinite;
  }

  .brand-mark::after {
    animation: markSweep 2.8s ease-in-out infinite;
  }

  .auth-art::before,
  .preview-canvas {
    animation: eclipseBreath 5.8s ease-in-out infinite alternate;
  }

  .mini-bars span {
    animation: barPulse 2.4s ease-in-out infinite;
  }

  .mini-bars span:nth-child(2) {
    animation-delay: 0.18s;
  }

  .mini-bars span:nth-child(3) {
    animation-delay: 0.36s;
  }

  .panel:hover::before,
  .stat-card:hover::before,
  .history-item:hover::before,
  .user-row:hover::before,
  .log-row:hover::before {
    animation: panelScan 0.82s ease;
  }

  .progress-panel::after {
    animation: progressScan 1.8s ease-in-out infinite;
  }

  .image-card.loading::after {
    animation: loadingEclipse 1.6s ease-in-out infinite alternate;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes eclipseDrift {
  from {
    transform: translate3d(0, 0, 0) rotate(-4deg);
  }
  to {
    transform: translate3d(-24px, 18px, 0) rotate(5deg);
  }
}

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

@keyframes markSweep {
  0%,
  54% {
    transform: translateX(-140%);
  }
  100% {
    transform: translateX(140%);
  }
}

@keyframes eclipseBreath {
  from {
    filter: drop-shadow(0 0 20px rgba(243, 244, 239, 0.08));
  }
  to {
    filter: drop-shadow(0 0 42px rgba(243, 244, 239, 0.18));
  }
}

@keyframes barPulse {
  0%,
  100% {
    transform: scaleX(0.58);
    opacity: 0.56;
  }
  50% {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes panelScan {
  to {
    transform: translateX(120%);
  }
}

@keyframes progressScan {
  from {
    transform: translateX(0) skewX(-18deg);
  }
  to {
    transform: translateX(360%) skewX(-18deg);
  }
}

@keyframes loadingEclipse {
  from {
    transform: translateX(-10px) rotate(-8deg) scale(0.92);
  }
  to {
    transform: translateX(10px) rotate(8deg) scale(1.04);
  }
}

@keyframes eggPulse {
  0% {
    filter: contrast(1);
  }
  45% {
    filter: contrast(1.8) invert(1);
  }
  100% {
    filter: contrast(1);
  }
}

@media (max-width: 1080px) {
  .workspace,
  .studio-grid,
  .admin-columns {
    grid-template-columns: 1fr;
  }

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

  .side-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .auth-card {
    grid-template-columns: 1fr;
  }

  .auth-art {
    min-height: auto;
    gap: 28px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .auth-art::before {
    right: -160px;
    top: 42px;
    width: 320px;
    height: 320px;
  }

  .preview-strip,
  .two-col,
  .output-grid,
  .invite-create-form,
  .invite-edit-form,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 16px;
  }

  .topbar,
  .user-main {
    align-items: stretch;
    flex-direction: column;
  }

  .status-pills {
    justify-content: flex-start;
  }

  .side-nav {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 40px;
  }

  .image-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .image-actions div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
