:root {
  --bg: #fafafa;
  --panel: #ffffff;
  --panel-soft: #f6f7f8;
  --ink: #18181b;
  --text: #27272a;
  --muted: #71717a;
  --quiet: #a1a1aa;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;
  --accent: #18181b;
  --accent-soft: #f4f4f5;
  --green: #10b981;
  --green-soft: #ecfdf5;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 10px 28px rgba(24, 24, 27, .045);
  --radius: 12px;
  --sidebar: 252px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

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

button {
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

.route-hidden {
  display: none !important;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.tiny-label {
  color: var(--quiet);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  background: #fafafa;
  border-right: 1px solid rgba(212, 212, 216, .72);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 24px;
  border-bottom: 1px solid rgba(228, 228, 231, .8);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  overflow: hidden;
  border: 1px solid rgba(212, 212, 216, .72);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(24, 24, 27, .06);
}

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

.brand-copy {
  min-width: 0;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 860;
  line-height: 1;
  letter-spacing: .02em;
}

.brand-ai-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 20px;
  padding: 2px 6px 3px;
  border: 1px solid rgba(37, 99, 235, .28);
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(239, 246, 255, .95), rgba(245, 243, 255, .95));
  color: #2563eb;
  font-size: 11px;
  font-weight: 860;
  letter-spacing: .06em;
}

.brand-sub {
  margin-top: 5px;
  color: var(--quiet);
  font-size: 11px;
  line-height: 1.2;
}

.sidebar nav {
  flex: 1;
  padding: 18px 0;
}

.nav-item {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  padding: 9px 10px;
  border-radius: 8px;
  color: #52525b;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: background .16s ease, color .16s ease;
}

.ui-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: inline-block;
  color: currentColor;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -2px;
}

.nav-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #52525b;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.nav-icon .ui-icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

.nav-item:hover,
.nav-item.active {
  color: var(--ink);
  background: #f4f4f5;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .025);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .12);
}

.shell {
  min-height: 100vh;
  margin-left: var(--sidebar);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 73px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 28px;
  background: rgba(250, 250, 250, .88);
  border-bottom: 1px solid rgba(228, 228, 231, .82);
  backdrop-filter: blur(16px);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--quiet);
  font-size: 12px;
  line-height: 1.2;
}

.breadcrumb b {
  color: var(--line-strong);
}

.breadcrumb strong {
  color: var(--muted);
  font-weight: 650;
}

h1,
h2,
h3,
h4,
p {
  letter-spacing: 0;
}

h1 {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.18;
  font-weight: 820;
}

h2 {
  margin: 6px 0 0;
  max-width: 680px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.18;
  font-weight: 820;
}

h3 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.25;
  font-weight: 780;
}

h4 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.3;
}

.status-strip,
.button-row,
.hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.button-row {
  justify-content: flex-start;
  margin-top: 16px;
}

.button-row.compact {
  margin-top: 0;
}

.pill,
.chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.pill.ok {
  border-color: #bbf7d0;
  background: var(--green-soft);
  color: #047857;
}

.pill.warn {
  border-color: #fde68a;
  background: var(--amber-soft);
  color: #92400e;
}

.login-strip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.login-strip input {
  width: 132px;
  min-height: 28px;
  padding: 5px 8px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
}

.pulse::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  opacity: .8;
}

.btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 720;
  text-decoration: none;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.btn .ui-icon,
.tool-strip button .ui-icon {
  width: 15px;
  height: 15px;
  flex-basis: 15px;
}

.btn:hover {
  background: #f4f4f5;
  border-color: #c7c7cf;
}

.btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 0 8px 18px rgba(24, 24, 27, .12);
}

.btn.primary:hover {
  background: #27272a;
  border-color: #27272a;
}

.btn.danger {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

.btn.tiny {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
}

.membership-trigger {
  border-color: rgba(37, 99, 235, .22);
  background: linear-gradient(135deg, #111827, #2563eb);
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .16);
}

.membership-trigger:hover {
  border-color: rgba(37, 99, 235, .34);
  background: linear-gradient(135deg, #18181b, #1d4ed8);
}

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

.membership-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 24, 27, .48);
  backdrop-filter: blur(8px);
}

.membership-dialog {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid rgba(212, 212, 216, .86);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 88px rgba(24, 24, 27, .24);
}

.membership-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.membership-head p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.62;
}

.membership-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.membership-close:hover {
  background: #f4f4f5;
  color: var(--ink);
}

.membership-plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 20px 24px;
}

.membership-plan {
  min-width: 0;
  min-height: 286px;
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfbfb;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.membership-plan:hover {
  transform: translateY(-2px);
  border-color: #c7c7cf;
  background: #fff;
  box-shadow: 0 14px 30px rgba(24, 24, 27, .08);
}

.membership-plan.selected {
  border-color: var(--ink);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--ink), 0 18px 42px rgba(24, 24, 27, .1);
}

.membership-plan.featured {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.plan-badge {
  width: max-content;
  max-width: 100%;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #047857;
  font-size: 12px;
  font-weight: 820;
  line-height: 1;
}

.membership-plan.featured .plan-badge {
  background: var(--blue-soft);
  color: #1d4ed8;
}

.membership-plan strong {
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.membership-plan strong span {
  margin-left: 3px;
  color: var(--quiet);
  font-size: 13px;
  font-weight: 760;
}

.membership-plan p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.58;
}

.membership-plan ul {
  display: grid;
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.membership-plan li {
  position: relative;
  padding-left: 18px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.42;
}

.membership-plan li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .52em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
}

.membership-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: stretch;
  padding: 0 24px 18px;
}

.membership-usage {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin: 0 24px 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
}

.usage-title h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
}

.usage-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.usage-item {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid rgba(228, 228, 231, .92);
  border-radius: 10px;
  background: #fff;
}

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

.usage-item b {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

.usage-item em {
  color: var(--quiet);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.membership-summary div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
}

.membership-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

.membership-summary b {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.membership-summary .btn {
  min-height: 100%;
  padding-left: 18px;
  padding-right: 18px;
}

.membership-notice {
  margin: 0 24px 24px;
  padding: 12px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: var(--amber-soft);
  color: #92400e;
  font-size: 12px;
  line-height: 1.6;
}

.membership-account {
  display: grid;
  gap: 12px;
  margin: 18px 24px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafafa;
}

.account-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.account-actions label,
.membership-admin label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.account-actions input,
.membership-admin input,
.membership-admin select {
  min-height: 36px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: 0;
}

.membership-profile {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.membership-profile div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.membership-profile span,
.ledger-row em {
  color: var(--quiet);
  font-size: 11px;
  font-weight: 720;
}

.membership-profile b {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-list {
  display: grid;
  gap: 7px;
}

.compact-ledger {
  max-height: 148px;
  overflow: auto;
}

.ledger-row {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid rgba(228, 228, 231, .9);
  border-radius: 8px;
  background: #fff;
}

.ledger-row span {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.42;
}

.muted-row span {
  color: var(--quiet);
}

.membership-admin {
  margin: 0 24px 18px;
  padding: 13px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.membership-admin summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 14px;
  font-weight: 820;
}

.admin-grid,
.admin-adjust-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1.3fr) auto minmax(150px, 1.3fr) minmax(150px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.admin-adjust-grid {
  grid-template-columns: minmax(150px, 1fr) auto auto minmax(150px, 1fr) auto auto;
}

.admin-notice {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: var(--blue-soft);
  color: #1d4ed8;
  font-size: 12px;
  line-height: 1.5;
}

.admin-columns {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 12px;
  margin-top: 12px;
}

.admin-columns h4 {
  margin: 0 0 8px;
}

.admin-user-list {
  display: grid;
  gap: 7px;
  max-height: 260px;
  overflow: auto;
}

.admin-user-row {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.admin-user-row:hover {
  background: #fff;
  border-color: #c7c7cf;
}

.admin-user-row b {
  color: var(--ink);
  font-size: 13px;
}

.admin-user-row span,
.admin-empty {
  color: var(--muted);
  font-size: 12px;
}

.admin-login-shell {
  min-height: 100vh;
  margin-left: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-login-panel {
  width: min(520px, 100%);
  padding: 24px;
}

.admin-login-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.admin-login-form .btn {
  justify-self: start;
}

.home-showcase {
  position: relative;
  width: calc(100% - 56px);
  max-width: 1640px;
  min-height: 260px;
  max-height: 480px;
  aspect-ratio: 3.2 / 1;
  margin: 24px auto 0;
  overflow: hidden;
  border: 1px solid rgba(212, 212, 216, .84);
  border-radius: 12px;
  background: #18181b;
  box-shadow: 0 18px 42px rgba(24, 24, 27, .12);
  isolation: isolate;
  cursor: default;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.home-showcase img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform .5s ease, filter .5s ease;
}

.home-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(8, 8, 12, .72) 0%, rgba(8, 8, 12, .38) 33%, rgba(8, 8, 12, .08) 68%, rgba(8, 8, 12, .18) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, .08) 0%, rgba(0, 0, 0, .22) 100%);
  pointer-events: none;
}

.home-showcase::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -36%;
  z-index: 2;
  width: 30%;
  transform: skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent);
  opacity: 0;
  pointer-events: none;
}

.home-showcase:hover {
  transform: translateY(-3px);
  border-color: rgba(161, 161, 170, .9);
  box-shadow: 0 24px 58px rgba(24, 24, 27, .17);
}

.home-showcase:hover img {
  transform: scale(1.045);
  filter: saturate(1.08) contrast(1.03);
}

.home-showcase:hover::after {
  animation: showcase-shine .82s ease forwards;
}

@keyframes showcase-shine {
  0% { left: -36%; opacity: 0; }
  24% { opacity: .8; }
  100% { left: 116%; opacity: 0; }
}

.home-showcase-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(22px, 4vw, 58px);
  color: #fff;
  text-shadow: 0 3px 18px rgba(0, 0, 0, .38);
}

.showcase-kicker {
  width: max-content;
  max-width: 100%;
  margin-bottom: 12px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .88);
  font-size: 12px;
  font-weight: 780;
  line-height: 1.2;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.home-showcase h2 {
  max-width: 720px;
  margin: 0;
  color: #fff;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.08;
  font-weight: 880;
}

.home-showcase h2 span {
  display: block;
}

.home-showcase p {
  max-width: 620px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, .9);
  font-size: clamp(15px, 1.6vw, 22px);
  font-weight: 760;
  line-height: 1.35;
}

.home-showcase.clean-showcase {
  min-height: 188px;
  max-height: 300px;
  aspect-ratio: 4.8 / 1;
  background: #f7faf9;
  box-shadow: 0 14px 36px rgba(24, 24, 27, .08);
}

.home-showcase.clean-showcase::before {
  background:
    radial-gradient(ellipse at 50% 47%, rgba(255, 255, 255, .86) 0%, rgba(255, 255, 255, .68) 34%, rgba(255, 255, 255, .16) 62%, rgba(255, 255, 255, .02) 100%),
    linear-gradient(180deg, rgba(250, 250, 250, .1) 0%, rgba(229, 244, 241, .18) 100%);
}

.home-showcase.clean-showcase .home-showcase-overlay {
  max-width: none;
  align-items: center;
  padding: clamp(16px, 3vw, 36px);
  color: var(--ink);
  text-align: center;
  text-shadow: none;
}

.home-showcase.clean-showcase .showcase-kicker {
  margin-bottom: 10px;
  padding: 6px 10px;
  border-color: rgba(212, 212, 216, .82);
  background: rgba(255, 255, 255, .78);
  color: #52525b;
  font-size: 11px;
  box-shadow: 0 10px 24px rgba(24, 24, 27, .05);
}

.home-showcase.clean-showcase h2 {
  max-width: 820px;
  color: var(--ink);
  font-size: clamp(30px, 3.4vw, 48px);
  letter-spacing: 0;
}

.home-showcase.clean-showcase p {
  max-width: 680px;
  margin-top: 10px;
  color: #52525b;
  font-size: clamp(14px, 1.1vw, 17px);
  font-weight: 720;
}

.home-showcase.clean-showcase .showcase-slogan {
  width: min(520px, 80%);
  max-width: 100%;
  margin-top: 9px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #52525b;
  font-size: clamp(12px, .9vw, 14px);
  font-weight: 680;
  line-height: 1.35;
}

.home-showcase.clean-showcase .showcase-slogan span {
  height: 1px;
  flex: 1 1 80px;
  max-width: 96px;
  background: linear-gradient(90deg, transparent, rgba(113, 113, 122, .42));
}

.home-showcase.clean-showcase .showcase-slogan span:last-child {
  background: linear-gradient(90deg, rgba(113, 113, 122, .42), transparent);
}

.home-showcase.clean-showcase .showcase-desc {
  margin-top: 14px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  width: 100%;
  max-width: 1640px;
  margin: 0 auto;
  padding: 24px 28px 56px;
}

.primary-stack {
  min-width: 0;
  display: grid;
  gap: 18px;
  align-content: start;
}

.right-rail {
  min-width: 0;
  display: grid;
  gap: 18px;
  align-content: start;
}

body[data-page]:not([data-page="deliveries"]) .workspace-grid {
  grid-template-columns: minmax(0, 1fr);
}

body[data-page]:not([data-page="deliveries"]) .right-rail {
  display: none;
}

body[data-page="deliveries"] .primary-stack {
  display: none;
}

body[data-page="deliveries"] .right-rail {
  grid-template-columns: minmax(0, 1fr);
}

body[data-page="deliveries"] #deliveries .compact-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(212, 212, 216, .72);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.overview-panel {
  display: grid;
  gap: 20px;
  padding: 24px;
  box-shadow: none;
}

.overview-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.overview-copy p,
.section-head p {
  margin: 8px 0 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.62;
}

.eyebrow {
  color: var(--quiet);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
}

.feature-showcase {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.feature-card {
  position: relative;
  min-width: 0;
  height: 124px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 4px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(24, 24, 27, .02) 22%, rgba(24, 24, 27, .72) 100%),
    var(--feature-image),
    linear-gradient(135deg, #f4f4f5, #e4e4e7);
  background-position: center;
  background-size: cover;
  color: #fff;
  cursor: pointer;
  isolation: isolate;
  padding: 14px;
  text-align: left;
  box-shadow: inset 0 -56px 72px rgba(0, 0, 0, .34);
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}

.feature-card > .ui-icon {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 24px;
  height: 24px;
  padding: 5px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  backdrop-filter: blur(8px);
}

.feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, rgba(255, 255, 255, .16), transparent 38%);
  opacity: .72;
}

.feature-card:hover {
  transform: translateY(-2px);
  filter: saturate(1.04) contrast(1.02);
  box-shadow: inset 0 -62px 76px rgba(0, 0, 0, .38), 0 12px 24px rgba(24, 24, 27, .12);
}

.feature-card span {
  max-width: 100%;
  overflow: hidden;
  color: rgba(255, 255, 255, .84);
  font-size: 11px;
  font-weight: 720;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .45);
  white-space: nowrap;
}

.feature-card strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 15px;
  font-weight: 820;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .56);
}

.tool-strip {
  width: min(100%, 840px);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-self: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7c3aed, #2563eb, #0ea5e9);
  color: #fff;
  box-shadow: 0 12px 26px rgba(37, 99, 235, .18);
}

.tool-strip span,
.tool-strip button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 0;
  color: #fff;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
}

.tool-strip span {
  padding: 0 12px;
}

.tool-strip button {
  gap: 6px;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  cursor: pointer;
  transition: background .16s ease;
}

.tool-strip button:hover {
  background: rgba(255, 255, 255, .2);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.section-head.tight {
  padding: 16px 18px;
}

.production-panel,
.brief-panel,
.projects-panel,
.detail-panel,
.wide,
.side-config,
.rail-panel,
.metrics-card,
.wizard-panel {
  overflow: hidden;
}

.studio-form {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
}

.upload-card,
.settings-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  padding: 16px;
}

.upload-card {
  min-height: 290px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-style: dashed;
}

.upload-card label {
  color: var(--ink);
  font-size: 18px;
  font-weight: 820;
}

.upload-card input {
  margin-top: 14px;
}

.upload-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.carousel-rule {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 13px;
  line-height: 1.5;
}

.carousel-rule b {
  color: #312e81;
  font-size: 12px;
}

.upload-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.settings-card {
  display: grid;
  gap: 14px;
  align-content: start;
}

.settings-card .compact-form {
  grid-template-columns: 1fr;
}

label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
  font-size: 13px;
  line-height: 1.35;
}

input,
select {
  min-height: 39px;
  padding: 8px 11px;
}

input[type="file"] {
  padding: 9px;
  background: #fff;
}

input[type="checkbox"] {
  width: auto;
  min-height: 0;
  margin: 0;
  accent-color: var(--ink);
}

textarea,
textarea.brief-input {
  min-height: 126px;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.65;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #a1a1aa;
  box-shadow: 0 0 0 3px rgba(161, 161, 170, .16);
}

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

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

.brief-fields,
.title-fields,
.wizard-fields {
  margin-top: 14px;
}

.brief-panel,
.wide,
.side-config,
.wizard-panel {
  padding: 0;
}

.brief-panel > textarea,
.brief-panel > .form-grid,
.brief-panel > .upload-row,
.brief-panel > .agent-compose,
.brief-panel > .button-row,
.brief-panel > .console,
.brief-panel > .secondary-tools,
.wide > .flow,
.wide > .form-grid,
.wide > .button-row,
.wide > .execute-box,
.wide > .console,
.side-config > .kv-list {
  margin-left: 20px;
  margin-right: 20px;
}

.brief-panel > textarea {
  width: calc(100% - 40px);
  margin-top: 20px;
}

.agent-compose {
  margin-top: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.agent-prompt {
  min-height: 132px;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  resize: vertical;
}

.agent-prompt:focus {
  border-color: transparent;
  box-shadow: none;
}

.agent-prompt::placeholder {
  color: #9ca3af;
}

.agent-compose-bar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.compose-tools {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.compose-select {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 720;
}

.compose-select span {
  color: var(--muted);
}

.compose-select select {
  width: auto;
  min-height: 28px;
  margin: 0;
  padding: 0 20px 0 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 720;
}

.file-summary {
  color: var(--quiet);
  font-size: 12px;
  font-weight: 650;
}

body[data-page="brief"] {
  background:
    linear-gradient(112deg, rgba(252, 231, 243, .42) 0%, rgba(239, 246, 255, .54) 36%, rgba(240, 253, 244, .42) 68%, rgba(250, 250, 250, 0) 100%),
    var(--bg);
}

body[data-page="brief"] .workspace-grid {
  max-width: 1160px;
  padding-top: clamp(28px, 4vw, 48px);
}

body[data-page="brief"] .home-showcase {
  width: calc(100% - 56px);
  max-width: 1640px;
  min-height: 188px;
  margin-top: 24px;
}

.home-brief-panel {
  position: relative;
  scroll-margin-top: 116px;
  padding: 0 4px;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.home-brief-title {
  max-width: 760px;
  margin: 0 auto 20px;
  text-align: center;
}

.home-brief-title h2 {
  max-width: none;
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 3.5vw, 43px);
  line-height: 1.12;
  font-weight: 880;
}

.home-brief-title p {
  margin: 10px auto 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.home-brief-panel > .agent-compose,
.home-brief-panel > .button-row,
.home-brief-panel > .console,
.home-brief-panel > .secondary-tools {
  margin-left: 0;
  margin-right: 0;
}

.home-compose {
  min-height: 242px;
  margin-top: 0;
  border: 1px solid rgba(212, 212, 216, .72);
  border-radius: 22px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 18px 60px rgba(24, 24, 27, .08), 0 1px 2px rgba(24, 24, 27, .04);
  backdrop-filter: blur(18px);
}

.home-compose .agent-prompt {
  min-height: 174px;
  padding: 26px 26px 12px;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.75;
}

.home-compose .agent-prompt::placeholder {
  color: #a1a1aa;
}

.home-compose .agent-compose-bar {
  min-height: 68px;
  padding: 12px 16px 16px;
  border-top: 0;
  background: transparent;
}

.home-compose .btn.tiny,
.home-compose .compose-select {
  min-height: 38px;
  border-radius: 999px;
  background: #fff;
}

.home-compose .btn.tiny {
  padding: 8px 14px;
}

.home-compose .compose-select {
  padding: 0 12px;
}

.home-compose .btn.primary {
  min-height: 42px;
  padding: 9px 22px;
  border-radius: 999px;
  background: #3f3f46;
  border-color: #3f3f46;
  box-shadow: 0 12px 24px rgba(24, 24, 27, .16);
}

.home-compose .btn.primary:hover {
  background: #27272a;
  border-color: #27272a;
}

.home-brief-panel > .production-actions {
  justify-content: center;
  margin-top: 18px;
}

.home-brief-panel > .production-actions .btn {
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
}

.home-brief-panel > .production-actions .btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.home-brief-panel > .production-actions .btn.primary:hover {
  background: #27272a;
  border-color: #27272a;
}

.home-brief-panel > .console {
  width: 100%;
  margin-top: 18px;
}

.home-brief-panel > .secondary-tools {
  text-align: center;
}

.hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.upload-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 160px auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}

.promptless-upload {
  grid-template-columns: minmax(260px, 1fr) auto;
}

.brief-batch-upload {
  grid-template-columns: minmax(260px, 1fr) minmax(160px, 240px);
}

.title-upload {
  grid-template-columns: minmax(260px, 1fr) auto auto;
}

.single-ref-tools {
  grid-template-columns: minmax(170px, 220px) auto auto;
}

.detail-upload {
  grid-template-columns: minmax(220px, 1fr) 160px auto auto;
  margin: 0 20px 16px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.execution-summary {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.console {
  width: 100%;
  max-height: 260px;
  margin: 0;
  padding: 13px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #18181b;
  color: #e4e4e7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.58;
  white-space: pre-wrap;
}

.progress-output {
  width: 100%;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(212, 212, 216, .72);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  white-space: normal;
}

.progress-output.small {
  font-size: 12px;
}

.brief-panel > .console,
.brief-panel > .progress-output,
.wide > .console,
.wide > .progress-output {
  width: calc(100% - 40px);
  margin-top: 16px;
  margin-bottom: 20px;
}

.console.small {
  max-height: 210px;
}

.progress-card {
  display: grid;
  gap: 12px;
}

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

.progress-title-row {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.progress-status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  margin-top: 5px;
  border-radius: 999px;
  background: #f59e0b;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, .13);
}

.progress-status-dot.success {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(16, 185, 129, .12);
}

.progress-status-dot.warn {
  background: #f59e0b;
}

.progress-status-dot.error {
  background: #ef4444;
  box-shadow: 0 0 0 5px rgba(239, 68, 68, .11);
}

.progress-title {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
}

.progress-message {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.progress-percent {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.progress-track {
  position: relative;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e4e7;
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #10b981);
  transition: width .3s ease;
}

.progress-output.is-moving .progress-fill {
  width: 42%;
  background: linear-gradient(90deg, transparent, var(--accent), #10b981, transparent);
  animation: progressSlide 1.25s ease-in-out infinite;
}

@keyframes progressSlide {
  from { transform: translateX(-110%); }
  to { transform: translateX(250%); }
}

.progress-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}

.progress-stat {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(228, 228, 231, .9);
  border-radius: 8px;
  background: #fff;
}

.progress-stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.progress-stat b {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
}

.progress-note {
  color: var(--muted);
  font-size: 12px;
}

.secondary-tools {
  margin-top: 14px;
  margin-bottom: 20px;
  color: var(--muted);
}

.secondary-tools summary,
.tech-details summary {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.home-stat {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(212, 212, 216, .72);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.home-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.home-stat b {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: var(--ink);
  font-size: 23px;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-stat em {
  display: block;
  margin-top: 5px;
  color: var(--quiet);
  font-size: 11px;
  font-style: normal;
}

.home-template-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 18px 18px;
}

.home-template-card {
  min-width: 0;
  min-height: 104px;
  display: grid;
  align-content: space-between;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfb;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.home-template-card:hover {
  transform: translateY(-1px);
  border-color: #c7c7cf;
  background: #fff;
  box-shadow: 0 10px 22px rgba(24, 24, 27, .05);
}

.home-template-icon {
  background: var(--green-soft);
  border-color: #bbf7d0;
  color: #047857;
}

.home-template-card b {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}

.home-template-card small {
  color: var(--quiet);
  font-size: 11px;
  line-height: 1.35;
}

.home-workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 18px;
}

.home-recent-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px 18px;
}

.home-recent-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.home-recent-card:hover {
  transform: translateY(-1px);
  border-color: #c7c7cf;
  box-shadow: 0 10px 24px rgba(24, 24, 27, .06);
}

.home-recent-thumb {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #f4f4f5;
  color: var(--quiet);
  font-size: 22px;
  font-weight: 800;
}

.home-recent-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.home-recent-body {
  padding: 10px;
}

.home-recent-body b {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-recent-body span {
  display: block;
  margin-top: 4px;
  color: var(--quiet);
  font-size: 11px;
}

.home-task-list {
  display: grid;
  gap: 10px;
  padding: 16px 18px 18px;
}

.home-task {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfbfb;
}

.home-task .nav-icon {
  width: 32px;
  height: 32px;
}

.home-task.warn .nav-icon {
  background: var(--amber-soft);
  border-color: #fde68a;
  color: #92400e;
}

.home-task.good .nav-icon {
  background: var(--green-soft);
  border-color: #bbf7d0;
  color: #047857;
}

.home-task.danger .nav-icon {
  background: var(--red-soft);
  border-color: #fecaca;
  color: #b91c1c;
}

.home-task b {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}

.home-task span {
  display: block;
  margin-top: 3px;
  color: var(--quiet);
  font-size: 12px;
  line-height: 1.35;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

.metric {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.metric strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 25px;
  line-height: 1.05;
}

.metric em {
  display: block;
  margin-top: 5px;
  color: var(--quiet);
  font-size: 11px;
  font-style: normal;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  padding: 20px;
}

.compact-grid {
  grid-template-columns: 1fr;
  padding: 16px 18px 18px;
}

.project-card {
  position: relative;
  min-width: 0;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}

.project-card:hover {
  transform: translateY(-1px);
  border-color: #c7c7cf;
  box-shadow: 0 10px 24px rgba(24, 24, 27, .06);
}

.project-card.selected {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.project-card h4 {
  margin: 0 34px 10px 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card-select {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, .92);
  cursor: pointer;
}

.card-select input {
  width: 14px;
  height: 14px;
}

.thumb {
  height: 170px;
  margin: -4px -4px 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f4f4f5;
  color: var(--quiet);
  font-size: 28px;
  font-weight: 800;
}

.thumb.placeholder {
  background:
    linear-gradient(45deg, rgba(228, 228, 231, .55) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(228, 228, 231, .55) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(228, 228, 231, .55) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(228, 228, 231, .55) 75%);
  background-color: #fafafa;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4f4f5;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.tag.good {
  border-color: #bbf7d0;
  background: var(--green-soft);
  color: #047857;
}

.tag.warn {
  border-color: #fde68a;
  background: var(--amber-soft);
  color: #92400e;
}

.card-actions,
.tile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.detail-panel {
  padding-bottom: 20px;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 20px;
}

.kv-list {
  display: grid;
  gap: 10px;
  padding-bottom: 20px;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}

.kv span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.kv b {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-align: right;
  text-overflow: ellipsis;
}

.reference-strip {
  display: flex;
  gap: 12px;
  margin: 0 20px 18px;
  overflow: auto;
}

.ref-card {
  position: relative;
  min-width: 140px;
  height: 140px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--muted);
}

.ref-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ref-card span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.ref-analysis {
  min-width: 260px;
  max-width: 420px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.ref-analysis p,
.ref-analysis small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.image-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
  margin: 0 20px;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 20px 14px;
  padding-top: 4px;
}

.inline-results {
  margin-bottom: 20px;
}

.white-bg-empty {
  grid-column: 1 / -1;
  cursor: default;
}

.white-bg-empty:hover {
  transform: none;
}

.image-tile {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.image-preview {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background: #f4f4f5;
  color: var(--quiet);
}

.image-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.tile-body {
  padding: 13px;
}

.tile-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 780;
}

.tile-purpose {
  margin: 5px 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.run-report {
  margin: 0 20px 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}

.run-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.run-title small {
  color: var(--muted);
}

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

.run-metric {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.run-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.run-metric b {
  color: var(--ink);
  font-size: 16px;
}

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

.run-box {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.run-box b {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
}

.run-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 7px;
  margin-top: 7px;
  border-top: 1px solid var(--line);
}

.flow {
  display: flex;
  align-items: center;
  margin-top: 20px;
  margin-bottom: 20px;
}

.flow-step {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.flow-step.active {
  border-color: #a1a1aa;
  background: var(--accent-soft);
  color: var(--ink);
}

.flow-line {
  height: 1px;
  flex: 1;
  min-width: 18px;
  background: var(--line);
}

.execute-box {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #f3d08a;
  border-radius: 10px;
  background: var(--amber-soft);
}

.execute-title {
  color: #92400e;
  font-weight: 800;
}

.execute-box p {
  margin: 6px 0 12px;
  color: #92400e;
  font-size: 13px;
  line-height: 1.55;
}

.worker-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  padding: 16px 18px 0;
}

.worker {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-soft);
  text-align: center;
}

.worker .dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-bottom: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .11);
}

.worker.backup .dot {
  background: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .1);
}

.worker small {
  color: var(--muted);
}

.rail-panel .console,
.rail-panel .progress-output {
  width: calc(100% - 36px);
  margin: 14px 18px 18px;
}

.tech-details {
  display: none;
}

.wizard-panel {
  padding-bottom: 20px;
}

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 18px 20px 0;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.wizard-step b {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
}

.wizard-step.active {
  border-color: #a1a1aa;
  background: #fff;
  color: var(--ink);
}

.wizard-step.done {
  border-color: #bbf7d0;
  background: var(--green-soft);
  color: #047857;
}

.wizard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 18px;
  padding: 18px 20px 0;
}

.wizard-upload {
  grid-template-columns: minmax(220px, 1fr) 150px auto;
}

.human-report {
  min-height: 312px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.human-report .ok-line {
  color: #047857;
}

.human-report .warn-line,
.issues {
  color: #92400e;
}

.tech-details {
  margin-top: 12px;
}

.prompt-editor {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}

.prompt-editor textarea {
  min-height: 160px;
  font-size: 12px;
}

.regen-status {
  grid-column: 1 / -1;
  cursor: default;
}

.regen-status:hover {
  transform: none;
}

@media (max-width: 1360px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .right-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .metrics-card {
    grid-column: 1 / -1;
  }

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

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

@media (max-width: 1100px) {
  :root {
    --sidebar: 0px;
  }

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

  .sidebar nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-item {
    flex: 0 0 auto;
  }

  .sidebar-footer {
    display: none;
  }

  .shell {
    margin-left: 0;
  }

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

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

  .overview-top {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .feature-card {
    height: 132px;
  }

  .overview-panel,
  .studio-form,
  .section-head {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .form-grid,
  .form-grid.compact-form,
  .upload-row,
  .brief-batch-upload,
  .title-upload,
  .single-ref-tools,
  .detail-upload,
  .home-stats,
  .home-workbench-grid,
  .wizard-grid,
  .wizard-steps,
  .run-metrics,
  .run-columns,
  .detail-meta,
  .right-rail,
  .membership-profile,
  .admin-grid,
  .admin-adjust-grid,
  .admin-columns {
    grid-template-columns: 1fr;
  }

  .workspace-grid {
    padding: 18px;
  }

  .home-showcase {
    width: calc(100% - 36px);
    min-height: 260px;
    aspect-ratio: 1.8 / 1;
    margin-top: 18px;
  }

  .home-showcase::before {
    background:
      linear-gradient(180deg, rgba(8, 8, 12, .72) 0%, rgba(8, 8, 12, .28) 52%, rgba(8, 8, 12, .7) 100%);
  }

  .home-showcase-overlay {
    justify-content: flex-end;
  }
}

@media (max-width: 720px) {
  .metrics-grid,
  .card-grid,
  .image-wall,
  .membership-plans,
  .home-template-grid,
  .home-recent-grid,
  .feature-showcase {
    grid-template-columns: 1fr;
  }

  .feature-card {
    height: 150px;
  }

  .tool-strip {
    justify-content: flex-start;
    border-radius: 16px;
  }

  .workspace-grid {
    padding: 14px;
  }

  .home-showcase {
    width: calc(100% - 28px);
    min-height: 330px;
    aspect-ratio: 1 / 1.1;
  }

  .home-showcase img {
    object-position: 42% center;
  }

  .showcase-kicker {
    font-size: 10px;
  }

  h2 {
    font-size: 24px;
  }
}

@media (max-width: 720px) {
  body[data-page="brief"] .home-showcase {
    width: calc(100% - 56px);
  }

  .home-showcase.clean-showcase h2 {
    font-size: clamp(26px, 7vw, 32px);
  }

  .membership-modal {
    padding: 12px;
    place-items: end center;
  }

  .membership-dialog {
    max-height: calc(100vh - 24px);
    border-radius: 14px 14px 0 0;
  }

  .membership-head,
  .membership-plans,
  .membership-usage,
  .membership-summary {
    padding-left: 16px;
    padding-right: 16px;
  }

  .membership-usage {
    grid-template-columns: 1fr;
    margin-left: 16px;
    margin-right: 16px;
    padding: 14px;
  }

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

  .membership-summary {
    grid-template-columns: 1fr;
  }

  .membership-account,
  .membership-admin {
    margin-left: 16px;
    margin-right: 16px;
  }

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

  .account-actions label {
    width: 100%;
  }

  .membership-notice {
    margin-left: 16px;
    margin-right: 16px;
  }

  .home-showcase.clean-showcase p {
    max-width: 330px;
    font-size: 13px;
    line-height: 1.45;
  }

  .home-showcase.clean-showcase .showcase-slogan {
    margin-top: 9px;
    padding: 7px 10px;
    font-size: 12px;
  }

  body[data-page="brief"] .workspace-grid {
    padding-top: 28px;
  }

  .home-brief-panel {
    max-width: 100%;
    min-width: 0;
    padding: 0;
  }

  .home-brief-title {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-bottom: 16px;
    text-align: left;
  }

  .home-brief-title h2 {
    font-size: 28px;
    overflow-wrap: anywhere;
  }

  .home-brief-title p {
    overflow-wrap: anywhere;
  }

  .home-compose {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 248px;
    border-radius: 18px;
  }

  .home-compose .agent-prompt {
    min-width: 0;
    min-height: 140px;
    padding: 20px 18px 8px;
    font-size: 15px;
  }

  .home-compose .agent-compose-bar {
    align-items: stretch;
    flex-direction: column;
    padding: 10px 12px 14px;
  }

  .home-compose .compose-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
  }

  .home-compose .btn.primary,
  .home-compose .btn.tiny,
  .home-compose .compose-select {
    width: 100%;
  }

  .home-compose .compose-select {
    justify-content: space-between;
  }

  .home-compose .file-summary {
    grid-column: 1 / -1;
    min-height: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .home-brief-panel > .production-actions {
    justify-content: flex-start;
  }
}
