:root {
  color-scheme: light;
  --ink: #222326;
  --muted: #6c6f76;
  --paper: #fffaf8;
  --panel: #ffffff;
  --line: #eadfda;
  --rose: #f06f8f;
  --rose-deep: #b93659;
  --mint: #8fc7b5;
  --sky: #8fb5e8;
  --sun: #f3bd5c;
  --shadow: 0 18px 48px rgba(89, 54, 45, 0.14);
  --soft-shadow: 0 12px 30px rgba(59, 43, 39, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(255, 250, 248, 0.82), rgba(242, 251, 247, 0.78)),
    radial-gradient(circle at 10% 12%, rgba(240, 111, 143, 0.16), transparent 30%),
    radial-gradient(circle at 88% 4%, rgba(143, 199, 181, 0.22), transparent 28%),
    #fffaf8;
  color: var(--ink);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 48px;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #222326;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

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

.brand strong {
  font-size: 1rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(234, 223, 218, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.top-actions a,
.top-button {
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4c4d52;
  font-size: 0.9rem;
}

.top-actions a:hover,
.top-button:hover {
  background: #fff1f4;
  color: var(--rose-deep);
}

.top-button {
  font-weight: 800;
}

.service-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin: -10px 0 18px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.88rem;
}

.service-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--sun);
  box-shadow: 0 0 0 4px rgba(243, 189, 92, 0.16);
}

.service-strip[data-state="ready"] .service-dot {
  background: #4da17d;
  box-shadow: 0 0 0 4px rgba(77, 161, 125, 0.16);
}

.service-strip[data-state="down"] .service-dot,
.service-strip[data-state="setup"] .service-dot {
  background: var(--rose);
  box-shadow: 0 0 0 4px rgba(240, 111, 143, 0.16);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(340px, 1fr);
  gap: 28px;
  align-items: stretch;
  min-height: 650px;
}

.intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  min-height: 560px;
  padding: clamp(30px, 5vw, 64px);
  border: 1px solid rgba(234, 223, 218, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.42), rgba(255, 246, 248, 0.72)),
    url("data:image/svg+xml,%3Csvg width='820' height='980' viewBox='0 0 820 980' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop stop-color='%23ffe5ec'/%3E%3Cstop offset='.46' stop-color='%23f5f0dd'/%3E%3Cstop offset='1' stop-color='%23d5ede5'/%3E%3C/linearGradient%3E%3Cfilter id='blur'%3E%3CfeGaussianBlur stdDeviation='18'/%3E%3C/filter%3E%3C/defs%3E%3Crect width='820' height='980' fill='url(%23a)'/%3E%3Cg opacity='.74' filter='url(%23blur)'%3E%3Cellipse cx='210' cy='300' rx='138' ry='190' fill='%23fff8fb'/%3E%3Cellipse cx='565' cy='180' rx='160' ry='118' fill='%23dff5ee'/%3E%3Cellipse cx='570' cy='650' rx='220' ry='260' fill='%23ffd4df'/%3E%3Cellipse cx='240' cy='760' rx='180' ry='140' fill='%23ffe9bc'/%3E%3C/g%3E%3Cg opacity='.44'%3E%3Cpath d='M95 675c108-82 207-116 319-76 86 31 165 17 264-56v276H95V675z' fill='%23fffaf8'/%3E%3Cpath d='M404 214c59 66 73 139 45 219-41 118-11 193 97 251' fill='none' stroke='%23a1707b' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M261 243c28 12 50 45 49 79-33-5-61-31-70-64 7-9 13-13 21-15z' fill='%23f06f8f'/%3E%3Cpath d='M318 211c30 24 38 64 20 100-31-19-44-60-30-94 4-3 7-5 10-6z' fill='%238fc7b5'/%3E%3Cpath d='M491 744c42-29 87-23 122 12-31 31-83 37-124 15-4-9-3-18 2-27z' fill='%23f3bd5c'/%3E%3C/g%3E%3C/svg%3E");
  background-position: center;
  background-size: cover;
  box-shadow: var(--soft-shadow);
}

.intro::after {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: min(36%, 180px);
  aspect-ratio: 9 / 16;
  border: 8px solid rgba(255, 255, 255, 0.76);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0)),
    linear-gradient(145deg, #222326 0%, #453240 38%, #f06f8f 100%);
  box-shadow: 0 18px 36px rgba(71, 42, 56, 0.24);
  content: "";
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--rose-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.08;
}

h1 {
  max-width: 560px;
  font-size: clamp(2.25rem, 5vw, 5rem);
}

h2 {
  font-size: clamp(1.65rem, 3vw, 2.45rem);
}

.lede {
  max-width: 470px;
  margin: 18px 0 0;
  color: #4f4547;
  font-size: clamp(1rem, 1.6vw, 1.12rem);
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.trust-row span {
  padding: 8px 10px;
  border: 1px solid rgba(34, 35, 38, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  font-weight: 650;
}

.creator-panel {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend,
.field-group label,
.slider-field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  font-size: 0.92rem;
  font-weight: 800;
}

.drop-card {
  position: relative;
  display: grid;
  min-height: 170px;
  place-items: center;
  padding: 22px;
  border: 1.5px dashed #d8bfc5;
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(255, 244, 247, 0.82), rgba(246, 255, 251, 0.9)),
    #fff;
  color: #4d4346;
  text-align: center;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.drop-card:hover,
.drop-card.dragging {
  border-color: var(--rose);
  box-shadow: 0 12px 28px rgba(240, 111, 143, 0.16);
  transform: translateY(-1px);
}

.drop-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 8px;
  background: #222326;
  color: #fff;
}

.upload-icon svg,
.primary-button svg,
.ghost-button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-title {
  margin-top: 12px;
  font-weight: 800;
}

.drop-hint {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
}

.thumb-preview {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.thumb-preview.is-visible {
  display: flex;
}

.thumb-preview img {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.thumb-preview b,
.thumb-preview small {
  display: block;
}

.thumb-preview b {
  color: var(--ink);
  font-size: 0.86rem;
}

.palette-row {
  display: flex;
  gap: 5px;
  margin-top: 6px;
}

.palette-row canvas {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(34, 35, 38, 0.12);
  border-radius: 999px;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 108px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.field-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.82rem;
}

.field-meta output {
  flex: 0 0 auto;
  color: #4d4f55;
  font-weight: 850;
}

.field-meta output.is-warning {
  color: var(--rose-deep);
}

input[type="email"],
input[type="password"],
input[type="text"],
input[name="nickname"] {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

textarea:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus,
input[type="range"]:focus-visible,
.template-strip button:focus-visible,
.copy-card:focus-visible,
.download-button:focus-visible,
.ghost-button:focus-visible,
.text-button:focus-visible,
.auth-tab:focus-visible,
.primary-button:focus-visible,
.top-button:focus-visible,
.top-actions a:focus-visible {
  outline: 3px solid rgba(240, 111, 143, 0.34);
  outline-offset: 3px;
}

.template-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: -8px;
}

.template-strip button {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #4a4d54;
  font-size: 0.86rem;
  font-weight: 750;
}

.template-strip button:hover {
  border-color: var(--rose);
  background: #fff4f6;
  color: var(--rose-deep);
}

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

.segmented legend,
.preset-grid legend {
  grid-column: 1 / -1;
}

.segmented label,
.preset-grid label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #4a4d54;
  font-size: 0.9rem;
  font-weight: 700;
}

.segmented input,
.preset-grid input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.segmented label:has(input:checked),
.preset-grid label:has(input:checked) {
  border-color: var(--rose);
  background: #fff2f5;
  color: var(--rose-deep);
  box-shadow: inset 0 0 0 1px rgba(240, 111, 143, 0.18);
}

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

.preset-grid label {
  justify-content: flex-start;
}

.swatch {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(34, 35, 38, 0.1);
}

.swatch.clean {
  background: linear-gradient(135deg, #fff8f5, #f3d3dc, #cfe8dc);
}

.swatch.night {
  background: linear-gradient(135deg, #111217, #364255, #e0b86f);
}

.swatch.flower {
  background: linear-gradient(135deg, #ffd7df, #e75078, #9dcfb9);
}

.swatch.desk {
  background: linear-gradient(135deg, #f6edd8, #8fb5e8, #24262c);
}

.slider-field output {
  color: var(--rose-deep);
  font-weight: 900;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--rose);
}

.safety-panel {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(143, 199, 181, 0.56);
  border-radius: 8px;
  background: linear-gradient(120deg, rgba(246, 255, 251, 0.92), rgba(255, 250, 248, 0.82));
}

.safety-panel strong {
  font-size: 0.92rem;
}

.safety-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.safety-tags span {
  padding: 5px 8px;
  border: 1px solid rgba(34, 35, 38, 0.08);
  border-radius: 999px;
  background: #fff;
  color: #47534f;
  font-size: 0.78rem;
  font-weight: 750;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 8px;
  border: 0;
  font-weight: 850;
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.primary-button {
  width: 100%;
  background: #222326;
  color: #fff;
  box-shadow: 0 14px 28px rgba(34, 35, 38, 0.2);
}

.primary-button:hover {
  background: #111215;
}

.account-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #f0d5dc;
  border-radius: 8px;
  background: #fff3f5;
  color: #63323f;
  font-size: 0.9rem;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--rose-deep);
  font-weight: 850;
  padding: 0;
}

.text-button:hover {
  color: #7b2038;
}

.fine-print {
  margin: -5px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.results-section,
.billing-section,
.notes-band {
  margin-top: 42px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  color: var(--muted);
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.progress-panel {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--soft-shadow);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.92rem;
}

.progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #eadfda;
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), var(--sun), var(--mint));
  transition: width 260ms ease;
}

.progress-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.ghost-button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: #313238;
}

.ghost-button:hover {
  border-color: #d8bfc5;
  background: #fff;
}

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

.wallpaper-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--soft-shadow);
}

.wallpaper-frame {
  display: grid;
  place-items: center;
  min-height: 460px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 246, 248, 0.78), rgba(242, 251, 247, 0.72)),
    #fbf4f2;
}

.wallpaper-card canvas {
  display: block;
  width: min(100%, 260px);
  height: auto;
  border-radius: 26px;
  box-shadow: 0 22px 50px rgba(47, 32, 32, 0.24);
}

.wallpaper-card[data-ratio="square"] canvas {
  border-radius: 18px;
}

.wallpaper-card[data-ratio="desktop"] canvas {
  width: min(100%, 360px);
  border-radius: 16px;
}

.wallpaper-card img {
  display: block;
  width: min(100%, 260px);
  height: auto;
  border-radius: 26px;
  box-shadow: 0 22px 50px rgba(47, 32, 32, 0.24);
}

.wallpaper-card[data-ratio="square"] img {
  border-radius: 18px;
}

.wallpaper-card[data-ratio="desktop"] img {
  width: min(100%, 360px);
  border-radius: 16px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.card-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
}

.card-footer strong {
  display: block;
  font-size: 0.92rem;
}

.card-footer span {
  color: var(--muted);
  font-size: 0.8rem;
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #222326;
}

.download-button:hover {
  border-color: var(--rose);
  color: var(--rose-deep);
}

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

.billing-section {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--soft-shadow);
}

.redeem-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #f0d5dc;
  border-radius: 8px;
  background: #fff6f8;
}

.redeem-panel label {
  display: block;
  margin-bottom: 4px;
  font-weight: 850;
}

	.redeem-panel p {
	  margin: 0;
	  color: var(--muted);
	  font-size: 0.88rem;
	}

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

	.redeem-steps span {
	  min-height: 34px;
	  padding: 8px 9px;
	  border: 1px solid rgba(240, 213, 220, 0.94);
	  border-radius: 8px;
	  background: #fff;
	  color: #63323f;
	  font-size: 0.82rem;
	  font-weight: 850;
	  text-align: center;
	}

.redeem-row {
  display: grid;
  grid-template-columns: 1fr 116px;
  gap: 10px;
}

.compact-button {
  width: auto;
  min-height: 46px;
  box-shadow: none;
}

.balance-pill {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: #222326;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 850;
}

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

.purchase-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  grid-column: 1 / -1;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.purchase-card div {
  display: grid;
  gap: 6px;
}

.purchase-card strong {
  color: var(--ink);
}

.purchase-card span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.package-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.package-card:hover {
  border-color: var(--rose);
  box-shadow: 0 12px 26px rgba(240, 111, 143, 0.12);
}

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

.package-card .price {
  font-size: 1.55rem;
  font-weight: 900;
}

.package-card span {
  color: var(--muted);
  font-size: 0.86rem;
}

.history-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf8;
}

.recent-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--soft-shadow);
}

.history-head,
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.recent-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(234, 223, 218, 0.86);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.recent-item:hover {
  border-color: var(--rose);
  background: #fff5f7;
}

.recent-item b,
.recent-item small {
  display: block;
}

.recent-item small,
.empty-state {
  color: var(--muted);
  font-size: 0.84rem;
}

.recent-item strong {
  flex: 0 0 auto;
  color: var(--rose-deep);
  font-size: 0.88rem;
}

.history-item {
  padding: 9px 0;
  border-top: 1px solid rgba(234, 223, 218, 0.74);
}

.history-item b {
  color: var(--ink);
}

.history-item .positive {
  color: #25745a;
  font-weight: 850;
}

.history-item .negative {
  color: var(--rose-deep);
  font-weight: 850;
}

.notes-band {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) 1fr;
  gap: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #222326;
  color: #fff;
}

.notes-band .eyebrow {
  color: #ffc6d2;
}

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

.copy-card {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-align: left;
}

.copy-card:hover {
  background: rgba(255, 255, 255, 0.14);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  max-width: calc(100% - 28px);
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(34, 35, 38, 0.92);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.auth-dialog {
  width: min(430px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.auth-dialog::backdrop {
  background: rgba(23, 18, 19, 0.42);
  backdrop-filter: blur(4px);
}

.auth-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf8;
  box-shadow: var(--shadow);
}

.auth-card h2 {
  font-size: 1.75rem;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.auth-tab {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.auth-tab.is-active {
  background: #222326;
  color: #fff;
}

.admin-page {
  background:
    linear-gradient(120deg, rgba(255, 250, 248, 0.9), rgba(245, 251, 248, 0.82)),
    #fffaf8;
}

.admin-login {
  display: grid;
  gap: 14px;
  max-width: 680px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--soft-shadow);
}

.admin-login h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.admin-secret-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.admin-secret-form label {
  font-weight: 850;
}

.admin-secret-row {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 10px;
}

.admin-dashboard {
  display: grid;
  gap: 18px;
}

.key-form {
  display: grid;
  grid-template-columns: 1.2fr 1fr 120px 120px 130px 130px;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.key-form .field-group {
  min-width: 0;
}

.key-form .field-group label {
  margin-bottom: 7px;
}

.generated-key-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(234, 223, 218, 0.86);
  border-radius: 8px;
  background: #fffaf8;
}

.generated-key-panel textarea {
  min-height: 138px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
}

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

.metric-card,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--soft-shadow);
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 96px;
  padding: 16px;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.metric-card strong {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.funnel-list,
.event-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.funnel-item {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(140px, 1fr) 64px;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(234, 223, 218, 0.82);
  border-radius: 8px;
  background: #fff;
}

.funnel-item b,
.event-item b {
  display: block;
}

.funnel-item small,
.event-item small {
  color: var(--muted);
  font-size: 0.82rem;
}

.funnel-meter {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #eadfda;
}

.funnel-meter span {
  display: block;
  min-width: 8px;
  width: 5%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), var(--sun), var(--mint));
}

.funnel-meter .meter-5 {
  width: 5%;
}

.funnel-meter .meter-10 {
  width: 10%;
}

.funnel-meter .meter-15 {
  width: 15%;
}

.funnel-meter .meter-20 {
  width: 20%;
}

.funnel-meter .meter-25 {
  width: 25%;
}

.funnel-meter .meter-30 {
  width: 30%;
}

.funnel-meter .meter-35 {
  width: 35%;
}

.funnel-meter .meter-40 {
  width: 40%;
}

.funnel-meter .meter-45 {
  width: 45%;
}

.funnel-meter .meter-50 {
  width: 50%;
}

.funnel-meter .meter-55 {
  width: 55%;
}

.funnel-meter .meter-60 {
  width: 60%;
}

.funnel-meter .meter-65 {
  width: 65%;
}

.funnel-meter .meter-70 {
  width: 70%;
}

.funnel-meter .meter-75 {
  width: 75%;
}

.funnel-meter .meter-80 {
  width: 80%;
}

.funnel-meter .meter-85 {
  width: 85%;
}

.funnel-meter .meter-90 {
  width: 90%;
}

.funnel-meter .meter-95 {
  width: 95%;
}

.funnel-meter .meter-100 {
  width: 100%;
}

	.event-item {
	  display: grid;
	  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
	  gap: 12px;
	  padding: 10px 0;
	  border-top: 1px solid rgba(234, 223, 218, 0.78);
	}

	.event-filters {
	  display: flex;
	  flex-wrap: wrap;
	  gap: 7px;
	  margin-top: 12px;
	}

	.event-filters button {
	  min-height: 34px;
	  padding: 7px 10px;
	  border: 1px solid var(--line);
	  border-radius: 8px;
	  background: #fff;
	  color: #4a4d54;
	  font-size: 0.82rem;
	  font-weight: 850;
	}

	.event-filters button:hover,
	.event-filters button.is-active {
	  border-color: var(--rose);
	  background: #fff2f5;
	  color: var(--rose-deep);
	}

.export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.export-row .ghost-button {
  min-width: 118px;
}

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

.admin-panel {
  overflow: hidden;
  padding: 16px;
}

.admin-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

th,
td {
  padding: 11px 10px;
  border-top: 1px solid rgba(234, 223, 218, 0.78);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td {
  font-size: 0.9rem;
}

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

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

  .intro {
    min-height: 480px;
  }

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

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

  .metric-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .key-form,
  .redeem-row {
    grid-template-columns: 1fr;
  }

  .funnel-item,
  .event-item {
    grid-template-columns: 1fr;
  }

  .wallpaper-frame {
    min-height: 410px;
  }

  .notes-band {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 12px;
  }

  .topbar {
    align-items: center;
  }

  .top-actions {
    flex: 0 0 auto;
    padding: 3px;
  }

  .top-actions a {
    display: none;
  }

  .top-button {
    max-width: 132px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 8px 10px;
    font-size: 0.84rem;
  }

  .service-strip {
    margin-top: -4px;
  }

  .brand small {
    max-width: 190px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .intro {
    min-height: 440px;
    padding: 26px 22px;
  }

  .intro::after {
    width: 112px;
    right: 18px;
    bottom: 18px;
    border-radius: 22px;
  }

  h1 {
    max-width: 310px;
    font-size: 2.55rem;
  }

  .lede {
    max-width: 300px;
  }

  .creator-panel {
    padding: 18px;
  }

  .admin-secret-row {
    grid-template-columns: 1fr;
  }

  .segmented,
  .preset-grid,
  .template-strip {
    grid-template-columns: 1fr;
  }

  .result-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
  }

  .ghost-button {
    width: 100%;
  }

  .wallpaper-frame {
    min-height: 380px;
  }

  .wallpaper-card canvas {
    width: min(100%, 230px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
