:root {
  color-scheme: dark;
  --bg: #040814;
  --bg-deep: #02050d;
  --bg-soft: #0a1221;
  --surface: rgba(9, 15, 28, 0.84);
  --surface-strong: rgba(14, 22, 38, 0.94);
  --surface-soft: rgba(16, 27, 46, 0.78);
  --card: rgba(10, 17, 30, 0.92);
  --card-strong: rgba(15, 24, 41, 0.98);
  --line: rgba(122, 144, 184, 0.2);
  --line-strong: rgba(132, 174, 255, 0.28);
  --ink: #eef4ff;
  --ink-soft: #92a5ca;
  --ink-faint: #667799;
  --accent: #7ee7ff;
  --accent-strong: #4f95ff;
  --accent-warm: #ff8f63;
  --ok: #76f0c1;
  --warn: #ff8a8a;
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 18px 44px rgba(0, 0, 0, 0.34);
  --shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.22);
  --radius-xl: 1.5rem;
  --radius-lg: 1.1rem;
  --radius-md: 0.9rem;
  --panel-top: 6.4rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg-deep);
}

body {
  position: relative;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  line-height: 1.45;
  background:
    radial-gradient(circle at top, rgba(44, 93, 195, 0.22), transparent 36%),
    radial-gradient(circle at 18% 16%, rgba(0, 214, 255, 0.1), transparent 24%),
    radial-gradient(circle at 82% 20%, rgba(255, 148, 92, 0.12), transparent 26%),
    linear-gradient(180deg, #08101d 0%, #040814 52%, #02050d 100%);
}

body::selection {
  background: rgba(126, 231, 255, 0.22);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

img {
  max-width: 100%;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(146, 165, 202, 0.24);
}

.bg-noise {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  opacity: 0.18;
  background-image: radial-gradient(rgba(255, 255, 255, 0.18) 0.5px, transparent 0.5px);
  background-size: 5px 5px;
  mix-blend-mode: soft-light;
}

.ambient {
  position: fixed;
  z-index: -2;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.55;
  pointer-events: none;
  animation: drift 16s ease-in-out infinite alternate;
}

.ambient-a {
  top: -8rem;
  left: -6rem;
  width: 22rem;
  height: 22rem;
  background: rgba(79, 149, 255, 0.22);
}

.ambient-b {
  top: 8rem;
  right: -6rem;
  width: 20rem;
  height: 20rem;
  background: rgba(126, 231, 255, 0.16);
  animation-delay: -4s;
}

.ambient-c {
  bottom: -7rem;
  left: 35%;
  width: 18rem;
  height: 18rem;
  background: rgba(255, 143, 99, 0.16);
  animation-delay: -9s;
}

.app-shell {
  width: min(1540px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 1.5rem;
}

.app-header {
  position: sticky;
  top: 1rem;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(132, 174, 255, 0.16);
  border-radius: calc(var(--radius-xl) + 0.15rem);
  background:
    linear-gradient(135deg, rgba(9, 15, 28, 0.86), rgba(14, 23, 39, 0.74)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 60%);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(22px) saturate(140%);
  animation: riseIn 700ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.header-brand,
.header-side {
  min-width: 0;
}

.header-side {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.kicker,
.panel-label,
.timeline-date,
.field span,
.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.kicker {
  color: var(--accent);
}

.title {
  margin: 0;
  font-family: "Syne", "Arial Black", sans-serif;
  font-size: clamp(1.95rem, 3vw, 3.15rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.status-cluster,
.header-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.25rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(132, 174, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-soft);
  font-size: 0.77rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.status-cluster {
  justify-content: flex-end;
  flex-wrap: nowrap;
  min-width: 0;
}

.status-cluster .button {
  flex-shrink: 0;
  white-space: nowrap;
}

.app-stage {
  padding-top: 1rem;
}

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

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(132, 174, 255, 0.14);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(13, 22, 37, 0.96), rgba(8, 14, 25, 0.92)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 30%);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px) saturate(125%);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(126, 231, 255, 0.06), transparent 28%),
    radial-gradient(circle at top right, rgba(79, 149, 255, 0.12), transparent 30%);
  pointer-events: none;
}

.input-panel,
.output-panel {
  padding: 1rem;
}

.input-panel {
  position: sticky;
  top: var(--panel-top);
  padding: 0.85rem;
  max-height: calc(100vh - var(--panel-top) - 1rem);
  overflow: auto;
}

.output-panel {
  min-height: calc(100vh - var(--panel-top) - 1rem);
  display: flex;
  flex-direction: column;
}

.stack {
  position: relative;
  display: grid;
  gap: 0.72rem;
}

.stack.compact {
  gap: 0.55rem;
}

.project-spotlight {
  display: grid;
  gap: 0.65rem;
  padding: 0.8rem;
  border: 1px solid rgba(126, 231, 255, 0.16);
  border-radius: calc(var(--radius-lg) + 0.05rem);
  background:
    radial-gradient(circle at top right, rgba(126, 231, 255, 0.14), transparent 32%),
    linear-gradient(140deg, rgba(10, 18, 33, 0.98), rgba(20, 36, 63, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.project-spotlight strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
}

.project-spotlight .field span,
.project-spotlight .muted,
.project-spotlight strong,
.project-spotlight .eyebrow {
  color: inherit;
}

.project-spotlight .muted {
  color: rgba(238, 244, 255, 0.72);
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.field span {
  color: var(--ink-soft);
}

.input-panel .field span,
.input-panel .eyebrow {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
}

.field-meta {
  flex-shrink: 0;
  color: var(--ink-faint);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.field-hero textarea {
  min-height: 7.2rem;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid rgba(132, 174, 255, 0.14);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(14, 22, 38, 0.96), rgba(10, 17, 30, 0.96)),
    rgba(10, 17, 30, 0.92);
  color: var(--ink);
  padding: 0.74rem 0.84rem;
  font-size: 0.95rem;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease,
    background-color 180ms ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.input-panel textarea,
.input-panel input,
.input-panel select,
.input-panel .button,
.input-panel .check-row {
  font-size: 0.88rem;
}

textarea {
  resize: vertical;
  min-height: 5.7rem;
}

#instruction-editor {
  min-height: 20rem;
}

input::placeholder,
textarea::placeholder {
  color: rgba(146, 165, 202, 0.52);
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: rgba(126, 231, 255, 0.55);
  box-shadow:
    0 0 0 4px rgba(126, 231, 255, 0.12),
    0 14px 24px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 14px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.grid {
  display: grid;
  gap: 0.75rem;
}

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

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

.subsection {
  display: grid;
  gap: 0.8rem;
  padding: 0.95rem;
  border: 1px solid rgba(132, 174, 255, 0.14);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 100%),
    rgba(10, 17, 30, 0.54);
}

.subsection.slim {
  padding-top: 1rem;
}

.sub-head h3,
.panel-head h2,
.drawer-head h2,
.modal-head h2 {
  margin: 0;
  font-family: "Syne", "Arial Black", sans-serif;
  font-size: 1.02rem;
  letter-spacing: -0.03em;
}

.reference-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: flex-start;
}

.upload-tile {
  width: 106px;
  min-width: 106px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  gap: 0.45rem;
  border: 1px dashed rgba(126, 231, 255, 0.3);
  border-radius: 1rem;
  background:
    radial-gradient(circle at top, rgba(126, 231, 255, 0.14), transparent 45%),
    linear-gradient(180deg, rgba(15, 24, 41, 0.96), rgba(10, 17, 30, 0.98));
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.upload-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(126, 231, 255, 0.48);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
}

.upload-tile-icon {
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.upload-tile-icon svg {
  width: 100%;
  height: 100%;
}

.upload-tile-label {
  font-size: 0.82rem;
  font-weight: 700;
}

.reference-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.reference-chip,
.library-card,
.timeline-project,
.image-card,
.memory-rule,
.image-history-item {
  animation: riseIn 380ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.reference-chip {
  position: relative;
  width: 106px;
  overflow: hidden;
  border: 1px solid rgba(132, 174, 255, 0.14);
  border-radius: 1rem;
  background: var(--card-strong);
  box-shadow: var(--shadow-sm);
}

.ref-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.04);
}

.reference-chip-controls {
  display: grid;
  gap: 0.4rem;
  padding: 0.45rem;
  background: linear-gradient(180deg, rgba(14, 22, 38, 0.98), rgba(8, 14, 25, 1));
}

.reference-alias,
.reference-role {
  padding: 0.42rem 0.5rem;
  font-size: 0.72rem;
  box-shadow: none;
}

.reference-role {
  text-transform: capitalize;
}

.reference-remove {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 1.6rem;
  height: 1.6rem;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 6, 12, 0.72);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1;
  transform: rotate(45deg);
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.reference-remove:hover {
  background: rgba(255, 143, 99, 0.9);
  transform: rotate(45deg) scale(1.05);
}

.action-row {
  display: grid;
  gap: 0.7rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(132, 174, 255, 0.16);
  border-radius: 0.95rem;
  background:
    linear-gradient(180deg, rgba(17, 27, 46, 0.96), rgba(11, 18, 31, 0.96)),
    var(--card);
  color: var(--ink);
  padding: 0.72rem 0.95rem;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    transform 170ms ease,
    box-shadow 170ms ease,
    border-color 170ms ease,
    background-color 170ms ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.button:hover,
.icon-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.28);
}

.button:active,
.icon-button:active {
  transform: translateY(0);
}

.button.primary {
  border-color: rgba(126, 231, 255, 0.38);
  background:
    linear-gradient(135deg, rgba(126, 231, 255, 0.28), rgba(79, 149, 255, 0.24)),
    linear-gradient(180deg, #13253f, #0e1a2e);
  box-shadow:
    0 18px 34px rgba(29, 74, 145, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.03);
}

.button.danger,
.icon-button.danger {
  border-color: rgba(248, 113, 113, 0.32);
  color: #fecaca;
}

.button.danger:hover,
.icon-button.danger:hover {
  border-color: rgba(248, 113, 113, 0.52);
  background: rgba(127, 29, 29, 0.25);
}

.button.small {
  padding: 0.5rem 0.72rem;
  font-size: 0.76rem;
}

#open-library {
  width: 100%;
  justify-content: center;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.check-row input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
}

.timeline-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
}

.panel-head.sticky {
  position: sticky;
  top: 0;
  z-index: 3;
  padding-bottom: 0.9rem;
  background: linear-gradient(180deg, rgba(9, 15, 28, 0.98), rgba(9, 15, 28, 0.82) 82%, transparent);
}

.status-block,
.loading-shell,
.error-banner {
  border-radius: var(--radius-lg);
}

.status-block {
  margin: 0.4rem 0 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(132, 174, 255, 0.14);
  background:
    radial-gradient(circle at top right, rgba(126, 231, 255, 0.08), transparent 35%),
    rgba(10, 17, 30, 0.72);
}

.status-main,
.time-row,
.compact-head,
.timeline-project-head,
.memory-entry {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.compact-head {
  align-items: center;
}

.timeline-project-head {
  align-items: center;
}

.status-main,
.time-row {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.time-row {
  margin-top: 0.35rem;
}

.loading-shell {
  margin-bottom: 0.85rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(126, 231, 255, 0.14);
  background: rgba(10, 17, 30, 0.74);
}

.loading-bar {
  position: relative;
  height: 0.72rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.loading-progress {
  position: relative;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong), var(--accent-warm));
  transition: width 600ms ease;
}

.loading-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: shimmer 1.5s linear infinite;
}

.error-banner {
  margin-bottom: 0.85rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(255, 138, 138, 0.28);
  background: rgba(58, 12, 18, 0.72);
  color: #ffc0c0;
  font-size: 0.84rem;
}

.hidden {
  display: none !important;
}

.muted,
.timeline-project-meta,
.timeline-project-copy,
.library-meta,
.library-usage,
.image-history-copy span {
  margin: 0.1rem 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.5;
}

.list,
.library-grid,
.timeline-list,
.image-history-list {
  display: grid;
  gap: 0.7rem;
}

.image-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  align-content: start;
}

.timeline-history {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(132, 174, 255, 0.12);
}

.flush p {
  margin-bottom: 0;
}

.timeline-list {
  margin-top: 0.8rem;
}

.timeline-project {
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem;
  border: 1px solid rgba(132, 174, 255, 0.12);
  border-radius: 1rem;
  background:
    linear-gradient(180deg, rgba(16, 27, 46, 0.88), rgba(10, 17, 30, 0.92)),
    var(--card);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.timeline-project:hover {
  transform: translateY(-3px);
  border-color: rgba(126, 231, 255, 0.34);
  box-shadow: 0 20px 34px rgba(0, 0, 0, 0.3);
}

.timeline-project-head strong {
  font-size: 0.9rem;
}

.project-remove {
  flex: 0 0 auto;
}

.timeline-project-previews {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}

.timeline-project-previews img,
.library-thumb,
.image-history-item img {
  border: 1px solid rgba(132, 174, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(24, 33, 50, 0.94), rgba(12, 18, 30, 0.94)),
    linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.04) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.04) 75%);
  background-size: auto, 16px 16px, 16px 16px;
  background-position: 0 0, 0 0, 8px 8px;
}

.timeline-project-previews img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0.8rem;
}

.timeline-project-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 4rem;
  grid-column: 1 / -1;
  border-radius: 0.8rem;
  border: 1px dashed rgba(132, 174, 255, 0.2);
  color: var(--ink-soft);
  font-size: 0.77rem;
}

.image-card {
  overflow: hidden;
  border: 1px solid rgba(132, 174, 255, 0.14);
  border-radius: 1.15rem;
  background:
    linear-gradient(180deg, rgba(14, 22, 38, 0.98), rgba(10, 17, 30, 0.98)),
    var(--card);
  box-shadow: var(--shadow-sm);
}

.image-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid rgba(132, 174, 255, 0.12);
}

.image-title {
  font-size: 0.84rem;
  line-height: 1.4;
}

.image-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(252, 165, 165, 0.5);
  background: rgba(127, 29, 29, 0.25);
  color: #fecaca;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.image-card-failed {
  border-color: rgba(252, 165, 165, 0.35);
}

.image-preview {
  display: block;
  width: 100%;
  height: 320px;
  object-fit: contain;
  cursor: zoom-in;
  background:
    radial-gradient(circle at top, rgba(126, 231, 255, 0.08), transparent 48%),
    linear-gradient(180deg, rgba(20, 31, 50, 0.96), rgba(9, 14, 24, 0.96)),
    linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.04) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.04) 75%);
  background-size: auto, auto, 18px 18px, 18px 18px;
  background-position: 0 0, 0 0, 0 0, 9px 9px;
}

.image-preview.is-failed {
  object-fit: cover;
  cursor: default;
  background:
    radial-gradient(circle at top, rgba(248, 113, 113, 0.08), transparent 48%),
    linear-gradient(180deg, rgba(40, 19, 27, 0.96), rgba(21, 9, 14, 0.96));
}

.image-card-body {
  display: grid;
  gap: 0.65rem;
  padding: 0.8rem 0.85rem 0.9rem;
  border-top: 1px solid rgba(132, 174, 255, 0.08);
}

.image-meta {
  min-height: 1rem;
}

.image-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.icon-button {
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid rgba(132, 174, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 170ms ease,
    box-shadow 170ms ease,
    border-color 170ms ease,
    background-color 170ms ease;
}

.icon-button svg {
  width: 1rem;
  height: 1rem;
}

.image-history-toggle:disabled {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(132, 174, 255, 0.08);
  color: rgba(146, 165, 202, 0.4);
}

.icon-button:disabled,
.button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.image-edit-panel {
  display: grid;
  gap: 0.65rem;
  padding: 0.8rem;
  border: 1px solid rgba(126, 231, 255, 0.14);
  border-radius: 1rem;
  background:
    radial-gradient(circle at top right, rgba(126, 231, 255, 0.08), transparent 38%),
    rgba(8, 14, 25, 0.92);
}

.image-edit-panel textarea {
  min-height: 4.5rem;
}

.image-edit-actions {
  justify-content: flex-end;
}

.library-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-content: start;
}

.library-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.8rem;
  border: 1px solid rgba(132, 174, 255, 0.14);
  border-radius: 1rem;
  background: rgba(10, 17, 30, 0.84);
}

.library-thumb {
  width: 82px;
  height: 82px;
  object-fit: contain;
  border-radius: 0.85rem;
}

.library-body {
  display: grid;
  gap: 0.35rem;
  align-content: start;
}

.library-title {
  font-size: 0.84rem;
}

.memory-entry {
  align-items: end;
}

.memory-entry input {
  min-width: 0;
}

.memory-rule {
  align-items: flex-start;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(132, 174, 255, 0.12);
  border-radius: 0.95rem;
  background: rgba(10, 17, 30, 0.82);
  font-size: 0.82rem;
}

.settings-stack {
  gap: 1rem;
}

.settings-hero {
  gap: 0.5rem;
  background:
    radial-gradient(circle at top right, rgba(126, 231, 255, 0.12), transparent 42%),
    linear-gradient(135deg, rgba(79, 149, 255, 0.08), rgba(255, 143, 99, 0.06)),
    rgba(10, 17, 30, 0.76);
}

.settings-hero h3 {
  margin: 0;
  font-family: "Syne", "Arial Black", sans-serif;
  font-size: 1.18rem;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.settings-runtime {
  align-items: end;
}

.settings-default-logo {
  gap: 0.65rem;
}

.default-logo-actions {
  align-items: end;
}

.default-logo-preview {
  width: min(180px, 100%);
  padding: 0.55rem;
  border: 1px solid rgba(132, 174, 255, 0.18);
  border-radius: 0.9rem;
  background: rgba(10, 17, 30, 0.72);
}

.default-logo-preview img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.03);
}

.runtime-check {
  min-height: 100%;
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(132, 174, 255, 0.14);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 100%),
    rgba(10, 17, 30, 0.54);
}

.settings-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 1rem;
  align-items: start;
}

.settings-column {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.settings-locks {
  gap: 0.9rem;
}

.settings-lock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.settings-lock-item {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid rgba(132, 174, 255, 0.12);
  border-radius: 1rem;
  background:
    linear-gradient(180deg, rgba(17, 27, 46, 0.76), rgba(10, 17, 30, 0.92)),
    rgba(10, 17, 30, 0.82);
}

.settings-lock-item strong {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

.settings-lock-item span {
  color: var(--ink-soft);
  font-size: 0.77rem;
  line-height: 1.45;
}

.builder-shell {
  position: relative;
  z-index: 2;
  gap: 0.9rem;
}

.builder-stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
}

.builder-step {
  display: grid;
  gap: 0.3rem;
  align-content: start;
  min-height: 4.35rem;
  position: relative;
  z-index: 1;
  padding: 0.72rem 0.8rem;
  border: 1px solid rgba(132, 174, 255, 0.14);
  border-radius: 1rem;
  background:
    linear-gradient(180deg, rgba(17, 27, 46, 0.76), rgba(10, 17, 30, 0.9)),
    rgba(10, 17, 30, 0.82);
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

.builder-step:hover {
  transform: translateY(-2px);
  border-color: rgba(126, 231, 255, 0.34);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.24);
}

.builder-step.is-active {
  color: var(--ink);
  border-color: rgba(126, 231, 255, 0.42);
  background:
    radial-gradient(circle at top right, rgba(126, 231, 255, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(19, 37, 63, 0.96), rgba(10, 17, 30, 0.96));
  box-shadow:
    0 18px 32px rgba(8, 16, 33, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.builder-step-index {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.builder-step-copy {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
}

.builder-panel-stack {
  display: grid;
}

.builder-panel {
  display: grid;
  gap: 0.85rem;
  padding: 0.95rem;
  border: 1px solid rgba(132, 174, 255, 0.14);
  border-radius: 1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 100%),
    rgba(8, 14, 25, 0.82);
}

.color-builder-card {
  gap: 0.75rem;
}

.color-builder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.color-field {
  gap: 0.45rem;
}

.color-input-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 0.6rem;
  align-items: center;
}

input[type="color"] {
  min-width: 0;
  width: 56px;
  height: 44px;
  padding: 0.2rem;
  border-radius: 0.85rem;
  cursor: pointer;
}

.builder-example-tools {
  align-items: stretch;
}

.builder-example-tile {
  min-height: 106px;
}

#builder-derived-examples {
  min-height: 12rem;
}

.style-preview-card {
  width: min(1200px, 100%);
}

.style-preview-grid {
  display: grid;
  gap: 1rem;
}

.style-option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.style-option-card {
  display: grid;
  gap: 0.35rem;
  min-height: 160px;
  padding: 1rem;
  border: 1px solid rgba(132, 174, 255, 0.14);
  border-radius: 1rem;
  background:
    linear-gradient(180deg, rgba(17, 27, 46, 0.92), rgba(10, 17, 30, 0.96)),
    rgba(10, 17, 30, 0.84);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.style-option-card:hover {
  transform: translateY(-3px);
  border-color: rgba(126, 231, 255, 0.34);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.28);
}

.style-option-card strong {
  font-size: 1.05rem;
  line-height: 1.05;
}

.style-option-card span {
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.5;
}

.font-preview-syne strong {
  font-family: "Syne", "Arial Black", sans-serif;
}

.font-preview-manrope strong {
  font-family: "Manrope", "IBM Plex Sans", sans-serif;
}

.font-preview-plex strong {
  font-family: "IBM Plex Sans", sans-serif;
}

.font-preview-archivo strong {
  font-family: "Archivo", "Arial Black", sans-serif;
  letter-spacing: 0.02em;
}

.font-preview-cormorant strong {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.3rem;
}

.creative-swiss {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 58%, transparent 58%),
    linear-gradient(90deg, rgba(255, 98, 64, 0.16), transparent 50%),
    linear-gradient(180deg, rgba(18, 28, 47, 0.96), rgba(10, 17, 30, 0.98));
}

.creative-scientific {
  background:
    radial-gradient(circle at top right, rgba(126, 231, 255, 0.14), transparent 38%),
    linear-gradient(180deg, rgba(9, 22, 38, 0.98), rgba(8, 14, 25, 0.98));
}

.creative-product {
  background:
    linear-gradient(160deg, rgba(255, 143, 99, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(17, 27, 46, 0.96), rgba(10, 17, 30, 0.98));
}

.creative-brutalist {
  background:
    linear-gradient(135deg, rgba(255, 98, 64, 0.22), rgba(255, 207, 80, 0.08)),
    linear-gradient(180deg, rgba(15, 20, 30, 0.98), rgba(8, 12, 18, 0.98));
}

.creative-premium {
  background:
    radial-gradient(circle at top right, rgba(255, 232, 210, 0.12), transparent 40%),
    linear-gradient(180deg, rgba(28, 27, 40, 0.96), rgba(13, 13, 18, 0.98));
}

.creative-magazine {
  background:
    linear-gradient(90deg, rgba(126, 231, 255, 0.12), transparent 45%),
    linear-gradient(180deg, rgba(13, 21, 35, 0.98), rgba(8, 14, 25, 0.98));
}

.layout-split,
.layout-text,
.layout-image,
.layout-center,
.layout-asym,
.layout-grid {
  position: relative;
  overflow: hidden;
}

.layout-split::after,
.layout-text::after,
.layout-image::after,
.layout-center::after,
.layout-asym::after,
.layout-grid::after {
  content: "";
  position: absolute;
  inset: auto 1rem 1rem 1rem;
  height: 48px;
  border-radius: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0.9;
}

.layout-split::after {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 56%, rgba(255, 98, 64, 0.18) 56% 100%);
}

.layout-text::after {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 0 68%, rgba(126, 231, 255, 0.14) 68% 100%);
}

.layout-image::after {
  background:
    linear-gradient(90deg, rgba(126, 231, 255, 0.14) 0 58%, rgba(255, 255, 255, 0.1) 58% 100%);
}

.layout-center::after {
  background:
    radial-gradient(circle at center, rgba(255, 98, 64, 0.24), transparent 42%),
    rgba(255, 255, 255, 0.05);
}

.layout-asym::after {
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.12) 0 45%, rgba(255, 98, 64, 0.16) 45% 72%, transparent 72%);
}

.layout-grid::after {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 32%, transparent 32% 36%, rgba(255, 98, 64, 0.14) 36% 68%, transparent 68% 72%, rgba(126, 231, 255, 0.12) 72% 100%);
}

.builder-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding-top: 0.15rem;
  position: relative;
  z-index: 2;
}

.builder-footer-copy {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.79rem;
}

#builder-status {
  min-height: 1.2rem;
}

.raw-editor-card {
  position: relative;
  top: auto;
}

.raw-rewrite-panel {
  padding: 0.85rem;
  background:
    radial-gradient(circle at top right, rgba(255, 143, 99, 0.09), transparent 42%),
    rgba(8, 14, 25, 0.72);
}

.drawer,
.modal-shell {
  position: fixed;
  inset: 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.drawer {
  display: flex;
  justify-content: flex-end;
  background: rgba(1, 3, 8, 0.62);
  z-index: 30;
}

.modal-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(1, 3, 8, 0.68);
  z-index: 40;
}

.drawer.open,
.modal-shell.open {
  visibility: visible;
  opacity: 1;
  pointer-events: all;
}

.drawer-card,
.modal-card,
.image-lightbox .lightbox-card {
  border: 1px solid rgba(132, 174, 255, 0.16);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px) saturate(120%);
}

.drawer-card {
  width: min(72rem, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 1rem;
  background:
    linear-gradient(180deg, rgba(12, 19, 33, 0.98), rgba(7, 12, 22, 0.98)),
    var(--card-strong);
  border-left: 1px solid rgba(132, 174, 255, 0.16);
  transform: translateX(100%);
  transition: transform 240ms ease;
}

.drawer.open .drawer-card {
  transform: translateX(0);
}

.drawer-head,
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

.modal-card {
  width: min(980px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  padding: 1rem;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(11, 18, 31, 0.98), rgba(7, 12, 22, 0.98)),
    var(--card-strong);
}

.image-lightbox .lightbox-card {
  width: min(1200px, 100%);
  max-height: min(92vh, 1000px);
  overflow: auto;
  padding: 1rem;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(11, 18, 31, 0.98), rgba(7, 12, 22, 0.98)),
    var(--card-strong);
}

.lightbox-stage {
  display: grid;
  place-items: center;
  min-height: 60vh;
  border-radius: 1rem;
  background:
    radial-gradient(circle at top, rgba(126, 231, 255, 0.08), transparent 40%),
    linear-gradient(180deg, rgba(20, 31, 50, 0.96), rgba(9, 14, 24, 0.96)),
    linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.04) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.04) 75%);
  background-size: auto, auto, 18px 18px, 18px 18px;
  background-position: 0 0, 0 0, 0 0, 9px 9px;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
}

.image-history-item {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.7rem;
  border: 1px solid rgba(132, 174, 255, 0.12);
  border-radius: 1rem;
  background: rgba(10, 17, 30, 0.82);
}

.image-history-actions {
  display: grid;
  gap: 0.45rem;
}

.image-history-item img {
  width: 82px;
  height: 82px;
  object-fit: cover;
  border-radius: 0.8rem;
}

.image-history-copy {
  display: grid;
  gap: 0.24rem;
  min-width: 0;
}

.image-history-copy strong {
  font-size: 0.82rem;
}

.image-history-item.is-active {
  border-color: rgba(126, 231, 255, 0.3);
  background:
    radial-gradient(circle at top right, rgba(126, 231, 255, 0.08), transparent 34%),
    rgba(12, 21, 37, 0.92);
}

.image-history-empty {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.debug-modal-card {
  width: min(1120px, 100%);
}

.debug-toggle {
  display: inline-flex;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
  padding: 0.25rem;
  border: 1px solid rgba(132, 174, 255, 0.14);
  border-radius: 999px;
  background: rgba(8, 14, 25, 0.8);
}

.debug-tab {
  min-width: 6.25rem;
}

.debug-tab.is-active {
  border-color: rgba(126, 231, 255, 0.36);
  background:
    linear-gradient(135deg, rgba(126, 231, 255, 0.2), rgba(79, 149, 255, 0.18)),
    rgba(18, 29, 48, 0.96);
  color: var(--ink);
}

.debug-reference-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.debug-reference-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid rgba(132, 174, 255, 0.14);
  border-radius: 1rem;
  background:
    radial-gradient(circle at top right, rgba(126, 231, 255, 0.06), transparent 34%),
    rgba(8, 14, 25, 0.88);
}

.debug-reference-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 0.85rem;
  border: 1px solid rgba(132, 174, 255, 0.14);
}

.debug-reference-body {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.debug-reference-body strong {
  font-size: 0.8rem;
}

.debug-json {
  margin: 0;
  padding: 1rem;
  max-height: min(68vh, 820px);
  overflow: auto;
  border: 1px solid rgba(132, 174, 255, 0.14);
  border-radius: 1rem;
  background:
    radial-gradient(circle at top right, rgba(126, 231, 255, 0.07), transparent 38%),
    rgba(7, 13, 24, 0.94);
  color: #d9e7ff;
  font-size: 0.77rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.status-ok {
  color: var(--ok);
}

.status-warn {
  color: var(--warn);
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(1.2rem, -1rem, 0) scale(1.06);
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 1120px) {
  :root {
    --panel-top: 0;
  }

  .app-shell {
    width: min(100%, calc(100% - 1rem));
    padding-top: 0.5rem;
  }

  .app-header {
    position: static;
  }

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

  .input-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .output-panel {
    min-height: auto;
  }

  .settings-workspace,
  .settings-lock-grid,
  .color-builder-grid,
  .style-option-grid {
    grid-template-columns: 1fr;
  }

  .raw-editor-card {
    position: static;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: calc(100% - 0.8rem);
  }

  .app-header,
  .timeline-panel-head,
  .timeline-project-head,
  .drawer-head,
  .modal-head,
  .memory-entry {
    flex-direction: column;
    align-items: stretch;
  }

  .header-side {
    width: 100%;
  }

  .status-cluster,
  .inline-actions,
  .status-main,
  .time-row,
  .compact-head {
    justify-content: space-between;
  }

  .status-cluster {
    flex-wrap: wrap;
  }

  .grid.two,
  .grid.three,
  .library-card,
  .image-grid,
  .image-history-item,
  .debug-reference-item {
    grid-template-columns: 1fr;
  }

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

  .builder-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .timeline-project-previews {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-thumb,
  .image-history-item img,
  .debug-reference-thumb {
    width: 100%;
    height: 180px;
  }

  .image-preview {
    height: 260px;
  }

  .drawer-card,
  .modal-card,
  .image-lightbox .lightbox-card {
    width: 100%;
    max-height: 100%;
  }
}

.full-width {
  width: 100%;
}

.client-grid {
  align-items: stretch;
}

.client-context-card {
  display: grid;
  gap: 0.3rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(126, 231, 255, 0.14);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top right, rgba(126, 231, 255, 0.12), transparent 34%),
    linear-gradient(135deg, rgba(14, 23, 40, 0.92), rgba(8, 13, 24, 0.94));
}

.client-context-card strong {
  font-size: 1rem;
}

.page-shell {
  width: min(1360px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.page-header {
  margin-bottom: 1rem;
}

.auth-page,
.clients-page {
  min-height: 100vh;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 460px);
  gap: 1rem;
  align-items: center;
}

.auth-hero {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 4vw, 3rem);
  animation: riseIn 800ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.auth-copy {
  max-width: 38rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
}

.auth-panel {
  padding: 1rem;
  animation: riseIn 900ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.clients-shell {
  display: grid;
  gap: 1rem;
}

.clients-layout {
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 420px);
}

.clients-list-panel,
.clients-form-panel {
  padding: 1rem;
}

.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
}

.client-card {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid rgba(132, 174, 255, 0.16);
  border-radius: calc(var(--radius-lg) + 0.05rem);
  background:
    radial-gradient(circle at top right, rgba(126, 231, 255, 0.1), transparent 30%),
    linear-gradient(145deg, rgba(11, 18, 32, 0.96), rgba(18, 32, 54, 0.9));
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.client-card:hover {
  transform: translateY(-2px);
  border-color: rgba(126, 231, 255, 0.28);
  box-shadow: var(--shadow-md);
}

.client-card.is-active {
  border-color: rgba(126, 231, 255, 0.42);
  box-shadow:
    0 0 0 1px rgba(126, 231, 255, 0.12),
    var(--shadow-md);
}

.client-card-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(126, 231, 255, 0.18), rgba(79, 149, 255, 0.28));
  color: var(--ink);
  font-family: "Syne", "Arial Black", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
  overflow: hidden;
}

.client-card-logo.is-initials {
  background: linear-gradient(135deg, rgba(126, 231, 255, 0.18), rgba(79, 149, 255, 0.28));
}

.client-card-logo-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.client-card-name {
  margin: 0;
  font-family: "Syne", "Arial Black", sans-serif;
  font-size: 1.05rem;
  line-height: 1.25;
}

.client-card-count {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.client-card-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

@media (max-width: 980px) {
  .auth-shell,
  .clients-layout {
    grid-template-columns: 1fr;
  }
}
