:root {
  color-scheme: light;
  --ink: #141815;
  --muted: #5f6e66;
  --line: #d9e5dd;
  --soft: #f1f8f3;
  --paper: #fbfdf9;
  --accent: #218955;
  --accent-dark: #0e5d36;
  --sky: #3974ca;
  --rose: #ee3f75;
  --shadow: 0 24px 70px rgba(27, 70, 45, 0.15);
  --panel-shadow: 0 18px 44px rgba(23, 58, 38, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(33, 137, 85, 0.13), transparent 30%),
    radial-gradient(circle at 88% 6%, rgba(238, 63, 117, 0.10), transparent 24%),
    radial-gradient(circle at 78% 78%, rgba(57, 116, 202, 0.10), transparent 28%),
    var(--paper);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.app-shell {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 14px clamp(14px, 4vw, 30px) 32px;
}

.app-header {
  position: sticky;
  top: 10px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
  margin-bottom: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(217, 229, 221, 0.86);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 42px rgba(28, 62, 43, 0.10);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 950;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(31, 138, 82, 0.22);
  font-size: 0.84rem;
}

.local-pill {
  display: none;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.74);
  font-size: 0.84rem;
  font-weight: 900;
}

.header-style,
.dock-style {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 30px rgba(28, 62, 43, 0.08);
}

.header-style span,
.dock-style span {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 950;
}

.header-style select,
.dock-style select {
  width: min(240px, 32vw);
  min-height: 34px;
  padding: 0 30px 0 10px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(241, 248, 243, 0.9);
  font-size: 0.88rem;
  font-weight: 950;
}

.dock-style {
  display: none;
  margin-left: 0;
}

body .dock-style {
  display: none;
}

.dock-style select {
  width: 96px;
}

.quick-remix {
  display: none;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #1f8a52, #2f83d8);
  box-shadow: 0 14px 28px rgba(31, 138, 82, 0.22);
  font-size: 0.86rem;
  font-weight: 950;
  white-space: nowrap;
}

.quick-remix:disabled,
.quick-remix.is-hidden {
  display: none;
}

.quick-remix:active {
  transform: translateY(1px);
}

.install-app {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(31, 138, 82, 0.18);
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 22px rgba(28, 62, 43, 0.08);
  font-size: 0.8rem;
  font-weight: 950;
  white-space: nowrap;
}

.install-app.is-hidden {
  display: none;
}

.install-app:active {
  transform: translateY(1px);
}

.header-style select:focus,
.dock-style select:focus {
  outline: 3px solid rgba(31, 138, 82, 0.14);
}

.mode-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, minmax(76px, 1fr));
  gap: 8px;
  width: min(620px, 100%);
  margin: 0 auto 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 12px 30px rgba(28, 62, 43, 0.07);
}

.mode-shortcut {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  color: #314138;
  background: transparent;
  font-size: 0.86rem;
  font-weight: 950;
}

.mode-shortcut.is-active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(31, 138, 82, 0.2);
}

.mode-helper {
  width: min(620px, 100%);
  margin: 0 auto 14px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.35;
  text-align: center;
}

.flow-coach {
  display: none;
  align-items: center;
  gap: 8px;
  width: min(620px, 100%);
  margin: -10px 0 18px;
  overflow-x: auto;
  scrollbar-width: none;
}

.flow-coach::-webkit-scrollbar {
  display: none;
}

.flow-step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 4px 11px 4px 5px;
  border: 1px solid rgba(31, 138, 82, 0.18);
  border-radius: 999px;
  color: #284237;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 24px rgba(28, 62, 43, 0.06);
  font-size: 0.78rem;
  font-weight: 950;
  white-space: nowrap;
}

.flow-step span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: rgba(31, 138, 82, 0.1);
  font-size: 0.72rem;
}

.flow-step.is-done {
  border-color: rgba(31, 138, 82, 0.28);
  color: var(--accent-dark);
  background: rgba(248, 253, 250, 0.86);
}

.flow-step.is-done span {
  color: var(--accent-dark);
  background: rgba(31, 138, 82, 0.16);
}

.flow-step.is-next {
  border-color: rgba(31, 138, 82, 0.62);
  color: #fff;
  background: linear-gradient(135deg, #1f8a52, #2f83d8);
  box-shadow: 0 13px 28px rgba(31, 138, 82, 0.16);
  transform: translateY(-1px);
}

.flow-step.is-next span {
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.92);
}

.flow-step:active {
  transform: translateY(1px);
}

.starter-strip {
  display: none;
  grid-template-columns: repeat(6, minmax(112px, 1fr));
  gap: 10px;
  margin: 0 0 clamp(16px, 3vw, 26px);
}

.starter-intro {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 2px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.starter-intro strong {
  color: var(--green-dark);
  font-size: 0.88rem;
  font-weight: 950;
}

.starter-steps {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.starter-steps b {
  display: inline-grid;
  min-height: 28px;
  place-items: center;
  padding: 0 10px;
  border: 1px solid rgba(31, 138, 82, 0.16);
  border-radius: 999px;
  color: #174532;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
  font-weight: 950;
  white-space: nowrap;
}

.starter-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 82px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: #142019;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 12px 28px rgba(28, 62, 43, 0.07);
  text-align: left;
}

.starter-card:hover,
.starter-card.is-active {
  border-color: rgba(31, 138, 82, 0.48);
  background: rgba(242, 255, 248, 0.9);
  box-shadow: 0 16px 36px rgba(31, 138, 82, 0.14);
}

.starter-card strong,
.starter-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.starter-card strong {
  font-size: 0.9rem;
  font-weight: 950;
}

.starter-card small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.starter-thumb {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 18px;
  color: #fff;
  font-size: 1rem;
  font-weight: 950;
  box-shadow:
    0 12px 22px rgba(26, 64, 43, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

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

.starter-couple {
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  background: linear-gradient(145deg, #ffe1eb, #dff5ee);
}

.starter-couple img {
  min-width: 0;
  border-radius: 14px;
}

.starter-birthday,
.starter-sticker,
.starter-pet,
.starter-halloween,
.starter-grad {
  background: linear-gradient(145deg, #fff5f8, #e8f7ef);
}

.starter-birthday::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 2px;
  width: 26px;
  height: 26px;
  background: url("./assets/decor/decor-balloons.png") center / contain no-repeat;
  filter: drop-shadow(0 4px 6px rgba(24, 59, 40, 0.18));
}

.starter-sticker::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 2px dashed rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(31, 138, 82, 0.42);
}

.starter-id {
  padding: 4px;
  background: linear-gradient(145deg, #edf6ff, #ffffff);
}

.starter-id img {
  height: auto;
  border-radius: 7px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(31, 138, 82, 0.14);
}

.starter-frame {
  padding: 3px;
  background: linear-gradient(145deg, #3b2410, #f0c75a);
}

.starter-frame img {
  border-radius: 13px;
  object-fit: cover;
}

.starter-pet::after {
  content: "BFF";
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 2px 5px;
  border-radius: 999px;
  color: #fff;
  background: rgba(31, 138, 82, 0.88);
  font-size: 0.56rem;
  font-weight: 950;
}

.starter-halloween::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 2px;
  width: 30px;
  height: 30px;
  background: url("./assets/decor/decor-halloween-jackolantern.png") center / contain no-repeat;
  filter: drop-shadow(0 4px 7px rgba(24, 18, 40, 0.22));
}

.starter-grad::after {
  content: "★";
  position: absolute;
  right: 5px;
  bottom: 3px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: #5f3b00;
  background: #f2b84b;
  box-shadow: 0 6px 12px rgba(62, 47, 12, 0.18);
  font-size: 0.95rem;
  font-weight: 950;
}

.intro {
  display: none;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 0.78fr);
  gap: 10px;
  align-items: center;
  margin-bottom: clamp(18px, 4vw, 34px);
  min-height: 560px;
}

.intro-copy {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

.eyebrow {
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
p {
  margin: 0;
}

h1 {
  max-width: 720px;
  font-size: clamp(2.8rem, 8vw, 6.6rem);
  line-height: 0.94;
  letter-spacing: 0;
  text-wrap: balance;
}

.intro p:not(.eyebrow) {
  max-width: 58ch;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.22rem);
  line-height: 1.55;
}

.sample-board {
  position: relative;
  min-height: 500px;
  overflow: hidden;
}

.sample-card {
  position: absolute;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(220, 230, 223, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.sample-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
}

.sample-art {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 210px;
  border-radius: 14px;
  color: #fff;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 950;
  text-align: center;
  line-height: 1.05;
}

.sample-art img {
  display: block;
  max-width: 100%;
  object-fit: cover;
}

.sample-art b {
  position: relative;
  z-index: 2;
  padding: 5px 12px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(232, 63, 114, 0.9);
  box-shadow: 0 8px 18px rgba(96, 23, 48, 0.18);
  font-size: 0.78rem;
  line-height: 1;
}

.sample-card figcaption {
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 950;
}

.sample-frame {
  width: 42%;
  height: 360px;
}

.sample-heart,
.sample-birthday,
.sample-couple,
.sample-id-preview {
  width: 42%;
  height: 260px;
}

.sample-heart-art {
  background:
    radial-gradient(circle at 78% 18%, rgba(246, 180, 207, 0.72), transparent 32%),
    linear-gradient(145deg, #fff7fb, #ffe5ee);
}

.sample-heart-art::before {
  content: "";
  position: absolute;
  inset: 30px 38px 48px;
  z-index: 1;
  background: rgba(232, 63, 114, 0.92);
  clip-path: path("M 100 30 C 76 -10 8 0 8 62 C 8 122 100 178 100 178 C 100 178 192 122 192 62 C 192 0 124 -10 100 30 Z");
  transform: scale(1.05);
}

.sample-heart-art img {
  position: relative;
  z-index: 2;
  width: 48%;
  height: 58%;
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.86);
}

.sample-heart-art b {
  position: absolute;
  right: 14px;
  bottom: 14px;
}

.sample-birthday-art {
  background:
    radial-gradient(circle at 25% 24%, #f8c045 0 10%, transparent 11%),
    radial-gradient(circle at 70% 22%, #5aa6ff 0 12%, transparent 13%),
    radial-gradient(circle at 46% 76%, #ff7e8e 0 12%, transparent 13%),
    linear-gradient(145deg, #fff3cc, #d7f2ff);
  color: #18315c;
}

.sample-birthday-art::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 12px;
  width: 56px;
  height: 56px;
  background: url("./assets/decor/decor-balloons.png") center / contain no-repeat;
  filter: drop-shadow(0 8px 10px rgba(24, 59, 40, 0.18));
}

.sample-birthday-art img {
  width: 50%;
  height: 62%;
  border-radius: 22px;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.9);
}

.sample-couple-art {
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(232, 63, 114, 0.18) 50%, rgba(31, 138, 82, 0.15) 50%),
    linear-gradient(145deg, #fff8fb, #eefaf4);
}

.sample-couple-art::before {
  content: "";
  position: absolute;
  inset: 28px;
  border: 10px solid #e83f72;
  clip-path: path("M 100 30 C 76 -10 8 0 8 62 C 8 122 100 178 100 178 C 100 178 192 122 192 62 C 192 0 124 -10 100 30 Z");
}

.sample-couple-art img {
  z-index: 1;
  width: 100%;
  height: 70%;
  align-self: center;
  border-radius: 20px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.82);
}

.sample-couple-art b {
  position: absolute;
  left: 14px;
  bottom: 14px;
}

.sample-id-art {
  align-content: center;
  gap: 12px;
  padding: 18px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.92), rgba(239, 249, 244, 0.94)),
    #ffffff;
}

.sample-id-art img {
  width: 88%;
  height: 38%;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(31, 138, 82, 0.16),
    0 8px 18px rgba(28, 62, 43, 0.08);
}

.sample-ornate {
  left: 5%;
  top: 62px;
  z-index: 3;
  transform: rotate(-7deg);
}

.sample-straight {
  left: 31%;
  top: 20px;
  z-index: 2;
  transform: rotate(6deg);
}

.sample-heart {
  right: 5%;
  top: 74px;
  z-index: 4;
  transform: rotate(8deg);
}

.sample-birthday {
  right: 14%;
  bottom: 34px;
  z-index: 5;
  transform: rotate(-5deg);
}

.sample-couple {
  right: 0;
  bottom: 140px;
  z-index: 1;
  transform: rotate(3deg);
}

.sample-id-preview {
  left: 0;
  bottom: 24px;
  z-index: 2;
  transform: rotate(4deg);
}

.studio {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(320px, 0.7fr);
  gap: clamp(16px, 3vw, 24px);
  align-items: start;
  margin-top: 12px;
}

.preview-card,
.control-card,
.notes article {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 50px rgba(28, 62, 43, 0.07);
}

.preview-card {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 690px;
  padding: clamp(14px, 3vw, 24px);
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(220, 230, 223, 0.58) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(220, 230, 223, 0.58) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(220, 230, 223, 0.58) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(220, 230, 223, 0.58) 75%),
    #f9fcf7;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.preview-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: inline-grid;
  place-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(31, 138, 82, 0.18);
  border-radius: 999px;
  color: #0f5f38;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 24px rgba(20, 60, 36, 0.12);
  font-size: 0.75rem;
  font-weight: 950;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: none;
}

.preview-card::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 22px;
  pointer-events: none;
}

canvas {
  width: min(100%, 440px);
  height: auto;
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow);
  touch-action: none;
  cursor: grab;
}

canvas:active {
  cursor: grabbing;
}

.text-hotspot-layer {
  position: absolute;
  inset: 0;
  z-index: 38;
  pointer-events: none;
}

.text-hotspot-layer.is-hidden {
  display: none;
}

.text-hotspot {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 52px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(31, 138, 82, 0.34);
  border-radius: 999px;
  color: #0f5f38;
  background: rgba(255, 255, 255, 0.42);
  box-shadow:
    0 12px 28px rgba(20, 50, 34, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
  pointer-events: auto;
}

.text-hotspot:focus-visible {
  outline: 3px solid rgba(52, 202, 125, 0.22);
}

.text-hotspot:active {
  transform: translateY(1px) scale(0.98);
}

.inline-text-editor {
  position: absolute;
  z-index: 44;
  display: none;
  box-sizing: border-box;
  border: 1px solid rgba(31, 138, 82, 0.28);
  border-radius: 16px;
  padding: 9px 12px;
  color: #183123;
  background: rgba(255, 255, 255, 0.86);
  box-shadow:
    0 18px 44px rgba(20, 50, 34, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  font: 850 0.95rem/1.15 system-ui, sans-serif;
  outline: none;
}

.inline-text-editor.is-visible {
  display: block;
}

.inline-text-editor:focus {
  border-color: rgba(31, 138, 82, 0.72);
  box-shadow:
    0 20px 54px rgba(20, 50, 34, 0.2),
    0 0 0 4px rgba(52, 202, 125, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.drag-hint {
  max-width: 46ch;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
}

.motion-strip {
  display: flex;
  gap: 7px;
  justify-content: center;
  width: 100%;
  margin-top: 14px;
}

.motion-strip span {
  width: 34px;
  height: 7px;
  border-radius: 999px;
  background: rgba(31, 138, 82, 0.2);
}

.motion-strip.is-playing span {
  animation: pulse 0.9s ease-in-out infinite alternate;
}

.motion-strip.is-playing span:nth-child(2) { animation-delay: 0.08s; }
.motion-strip.is-playing span:nth-child(3) { animation-delay: 0.16s; }
.motion-strip.is-playing span:nth-child(4) { animation-delay: 0.24s; }
.motion-strip.is-playing span:nth-child(5) { animation-delay: 0.32s; }

.result-actions {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 5;
  display: grid;
  grid-template-columns: auto auto auto auto;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 40px rgba(31, 64, 43, 0.16);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.result-actions.is-hidden {
  display: none;
}

.result-caption {
  position: absolute;
  left: 50%;
  bottom: 82px;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: min(360px, calc(100% - 42px));
  padding: 10px 10px 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 22px;
  color: #17302a;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 42px rgba(31, 64, 43, 0.15);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  transform: translateX(-50%);
}

.result-caption.is-hidden {
  display: none;
}

.result-caption span,
.result-caption b,
.result-caption small {
  display: block;
  min-width: 0;
}

.result-caption b {
  color: var(--green-dark);
  font-size: 0.75rem;
  font-weight: 950;
}

.result-caption small {
  overflow: hidden;
  margin-top: 2px;
  color: #435044;
  font-size: 0.76rem;
  font-weight: 820;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-caption button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(31, 138, 82, 0.18);
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.76rem;
  font-weight: 950;
}

.result-actions button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(31, 138, 82, 0.18);
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.8rem;
  font-weight: 950;
  white-space: nowrap;
}

.result-actions button.is-primary-action {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #1f8a52, #2f83d8);
}

.result-actions.is-sample-result #resultEditBtn { order: 1; }
.result-actions.is-sample-result #resultRemixBtn { order: 2; }
.result-actions.is-sample-result #resultSaveBtn { order: 3; }
.result-actions.is-sample-result #resultShareBtn { order: 4; }

.result-actions.is-sample-result + .result-caption {
  border-color: rgba(47, 131, 216, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(239, 248, 255, 0.84)),
    rgba(255, 255, 255, 0.84);
}

.result-actions.is-sample-result + .result-caption b {
  color: #16578f;
}

.result-actions.is-sample-result + .result-caption small {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.result-actions.is-user-result:not(.is-sheet-result) #resultSaveBtn { order: 1; }
.result-actions.is-user-result:not(.is-sheet-result) #resultShareBtn { order: 2; }
.result-actions.is-user-result:not(.is-sheet-result) #resultEditBtn { order: 3; }
.result-actions.is-user-result:not(.is-sheet-result) #resultRemixBtn { order: 4; }

.result-actions.is-sheet-result:not(.is-sample-result) #resultRemixBtn { order: 1; }
.result-actions.is-sheet-result:not(.is-sample-result) #resultSaveBtn { order: 2; }
.result-actions.is-sheet-result:not(.is-sample-result) #resultEditBtn { order: 3; }
.result-actions.is-sheet-result:not(.is-sample-result) #resultShareBtn { order: 4; }

.result-actions button:active {
  transform: translateY(1px);
}

@keyframes pulse {
  from { opacity: 0.36; transform: scaleX(0.72); }
  to { opacity: 1; transform: scaleX(1.12); }
}

.control-card {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: clamp(16px, 3vw, 24px);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 90px;
}

.tool-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.tool-tab[data-panel-target="adjust"],
.tool-tabs .view-tab {
  display: none;
}

.tool-tab {
  display: grid;
  place-items: center;
  min-height: 40px;
  padding: 0 8px;
  border: 0;
  border-radius: 14px;
  color: #314138;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 950;
  line-height: 1;
}

.tool-tab span {
  display: block;
}

.tool-tab:hover {
  color: var(--accent-dark);
  background: rgba(33, 137, 85, 0.08);
}

.tool-tab.is-active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(31, 138, 82, 0.18);
}

.tool-panel {
  display: none;
  gap: 14px;
}

.tool-panel.is-active {
  display: grid;
}

.panel-rail {
  display: block;
}

.upload-box {
  display: grid;
  place-items: center;
  gap: 7px;
  min-height: 154px;
  padding: 18px;
  border: 1px dashed rgba(31, 138, 82, 0.38);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(241, 248, 243, 0.9)),
    var(--soft);
  text-align: center;
  cursor: pointer;
}

.secondary-upload {
  display: none;
  min-height: 122px;
}

.secondary-upload.is-visible {
  display: grid;
}

.background-upload {
  display: none;
  min-height: 116px;
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(145deg, var(--accent), var(--sky));
  font-size: 0.76rem;
  font-weight: 950;
}

.upload-box strong,
.field span {
  font-weight: 950;
}

.upload-box small {
  color: var(--muted);
  font-weight: 750;
}

.sample-button {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  min-height: 54px;
  border: 1px solid rgba(31, 138, 82, 0.2);
  border-radius: 18px;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.82);
  font-weight: 950;
  box-shadow: 0 12px 28px rgba(28, 62, 43, 0.08);
}

.sample-button-kicker {
  min-width: 44px;
  padding: 3px 10px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  font-size: 0.68rem;
  line-height: 1;
}

.sample-button strong {
  color: var(--accent-dark);
  font-size: 0.9rem;
  line-height: 1.12;
}

.sample-button small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.18;
}

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

.id-layout-strip.is-visible {
  display: grid;
}

.id-layout-chip {
  display: grid;
  place-items: center;
  gap: 2px;
  min-height: 58px;
  padding: 7px 6px;
  border: 1px solid rgba(31, 138, 82, 0.18);
  border-radius: 16px;
  color: #123d2b;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  white-space: normal;
}

.id-layout-chip strong {
  font-size: 0.86rem;
  font-weight: 950;
  line-height: 1;
}

.id-layout-chip span {
  color: #5e7167;
  font-size: 0.64rem;
  font-weight: 850;
  line-height: 1.1;
  text-align: center;
}

.id-layout-chip.is-active {
  border-color: rgba(31, 138, 82, 0.72);
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 12px 24px rgba(31, 138, 82, 0.2);
}

.id-layout-chip.is-active span {
  color: rgba(255, 255, 255, 0.86);
}

.capture-check {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(31, 138, 82, 0.18);
  border-radius: 16px;
  color: #425348;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.capture-check strong {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 950;
}

.capture-check span {
  color: #5d6d63;
  font-size: 0.74rem;
  font-weight: 780;
  line-height: 1.28;
}

.capture-check.needs-work {
  border-color: rgba(192, 106, 53, 0.35);
  background: rgba(255, 249, 241, 0.78);
}

.capture-check.needs-work strong {
  color: #8d4a21;
}

.capture-check.is-ok {
  border-color: rgba(31, 138, 82, 0.28);
  background: rgba(244, 255, 249, 0.82);
}

.photo-size-controls {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(31, 138, 82, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}

.photo-size-controls .adjust-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.photo-size-controls .reset-photo-action {
  width: 100%;
}

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

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.mode-tabs label {
  min-width: 0;
}

.mode-tabs input {
  position: absolute;
  opacity: 0;
}

.mode-tabs span {
  display: grid;
  place-items: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  color: #26332a;
  font-weight: 950;
  cursor: pointer;
}

.mode-tabs input:checked + span {
  border-color: rgba(31, 138, 82, 0.5);
  color: #fff;
  background: var(--accent);
  box-shadow: 0 12px 26px rgba(31, 138, 82, 0.18);
}

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

.toggle-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(31, 138, 82, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
}

.toggle-field input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.toggle-field span {
  display: grid;
  gap: 2px;
}

.toggle-field strong {
  color: var(--accent-dark);
  font-size: 0.86rem;
  font-weight: 950;
}

.toggle-field small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.text-chip-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: none;
}

.text-chip-strip::-webkit-scrollbar,
.occasion-chip-strip::-webkit-scrollbar {
  display: none;
}

.text-chip {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(31, 138, 82, 0.18);
  border-radius: 999px;
  color: var(--accent-dark);
  background: rgba(245, 255, 249, 0.88);
  font-size: 0.82rem;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(28, 62, 43, 0.06);
}

.text-chip:hover,
.text-chip:focus-visible {
  border-color: rgba(31, 138, 82, 0.48);
  background: #ffffff;
  outline: none;
  box-shadow:
    0 10px 22px rgba(31, 138, 82, 0.12),
    0 0 0 3px rgba(52, 202, 125, 0.12);
}

.occasion-chip-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  min-width: 0;
  overflow: visible;
  padding: 2px 2px 5px;
  scrollbar-width: none;
}

.chip-section-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(31, 138, 82, 0.28);
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #0f7f4c, #17955c);
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 20px rgba(31, 138, 82, 0.16);
}

.occasion-chip {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  max-width: 100%;
  min-height: 38px;
  padding: 0 12px 0 10px;
  border: 1px solid rgba(31, 138, 82, 0.18);
  border-radius: 999px;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(28, 62, 43, 0.06);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.occasion-chip span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  font-size: 1rem;
  line-height: 1;
}

.occasion-chip b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.occasion-chip:hover,
.occasion-chip:focus-visible {
  border-color: rgba(31, 138, 82, 0.5);
  background: #ffffff;
  outline: none;
  box-shadow:
    0 10px 22px rgba(31, 138, 82, 0.12),
    0 0 0 3px rgba(52, 202, 125, 0.12);
}

.occasion-chip:active {
  transform: scale(0.98);
}

.occasion-chip.is-active {
  border-color: rgba(31, 138, 82, 0.72);
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 12px 24px rgba(31, 138, 82, 0.2);
}

.occasion-chip.is-active span {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.86);
}

.sticker-chip-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding-top: 4px;
  border-top: 1px solid rgba(31, 138, 82, 0.12);
}

.sticker-choice-chip {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  min-height: 38px;
  max-width: 100%;
  padding: 0 12px 0 8px;
  border: 1px solid rgba(31, 138, 82, 0.18);
  border-radius: 999px;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.68);
  font-size: 0.76rem;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(28, 62, 43, 0.06);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.sticker-choice-chip span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #0f5f38;
  font-size: 1rem;
  line-height: 1;
}

.sticker-choice-chip b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sticker-choice-chip:hover,
.sticker-choice-chip:focus-visible {
  border-color: rgba(31, 138, 82, 0.5);
  background: #ffffff;
  outline: none;
  box-shadow:
    0 10px 22px rgba(31, 138, 82, 0.12),
    0 0 0 3px rgba(52, 202, 125, 0.12);
}

.sticker-choice-chip:active {
  transform: scale(0.98);
}

.sticker-choice-chip.is-active {
  border-color: rgba(31, 138, 82, 0.72);
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 12px 24px rgba(31, 138, 82, 0.2);
}

.sticker-choice-chip.is-active span {
  background: rgba(255, 255, 255, 0.95);
}

.sticker-size-field {
  min-width: 0;
  margin-top: 2px;
}

.sticker-size-field input[type="range"] {
  width: 100%;
}

.is-visual-hidden {
  display: none !important;
}

.tool-panel[data-panel="decor"] #decorCategoryField,
.tool-panel[data-panel="decor"] .adjust-grid,
.tool-panel[data-panel="decor"] .mini-actions {
  display: none;
}

.text-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.text-panel summary {
  color: var(--accent-dark);
  font-weight: 950;
  cursor: pointer;
}

.text-panel[open] {
  display: grid;
}

.text-panel[open] summary {
  margin-bottom: 10px;
}

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

#heartSizeField {
  display: none;
}

#heartSizeField.is-visible {
  display: grid;
}

#stickerLayoutField {
  display: none;
}

#stickerLayoutField.is-visible {
  display: grid;
}

#stickerOutputField {
  display: none;
}

#stickerOutputField.is-visible {
  display: grid;
}

.cleanup-preset-field select {
  min-height: 42px;
  border-radius: 14px;
}

#idGuideField {
  display: none;
}

#idGuideField.is-visible {
  display: grid;
}

#idLayoutField {
  display: none;
}

#idLayoutField.is-visible {
  display: grid;
}

.id-cut-action {
  display: none;
}

.id-cut-action.is-visible {
  display: block;
  min-height: 44px;
  border-radius: 999px;
}

.reset-photo-action {
  min-height: 44px;
  border-radius: 999px;
}

.clean-photo-action {
  min-height: 44px;
  border-radius: 999px;
  background: rgba(31, 138, 82, 0.1);
}

.id-cut-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

select,
input[type="text"],
input[type="range"] {
  width: 100%;
}

select,
input[type="text"] {
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 850;
}

input[type="text"]:focus,
select:focus {
  border-color: rgba(31, 138, 82, 0.55);
  outline: 3px solid rgba(31, 138, 82, 0.14);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.export-preset-field {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(31, 138, 82, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
}

.export-preset-field span {
  color: var(--accent-dark);
  font-size: 0.8rem;
}

.export-preset-field select {
  min-height: 40px;
  border-radius: 999px;
  font-size: 0.86rem;
}

.output-preview-card {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(31, 138, 82, 0.16);
  border-radius: 18px;
  background: rgba(247, 255, 250, 0.84);
}

.output-preview-card strong {
  color: var(--accent-dark);
  font-size: 0.88rem;
  font-weight: 950;
}

.output-preview-card img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border: 1px solid rgba(31, 138, 82, 0.12);
  border-radius: 16px;
  background: #fff;
}

.output-preview-card img.is-empty,
.output-preview-card img:not([src]) {
  display: none;
}

.output-preview-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.output-preview-card.is-loading {
  opacity: 0.72;
}

.music-field {
  margin-top: -2px;
}

.ecard-style-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(31, 138, 82, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.ecard-style-summary span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.ecard-style-summary strong {
  min-width: 0;
  color: var(--accent-dark);
  font-size: 0.88rem;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecard-style-summary button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.78rem;
}

.webm-note {
  display: none;
  grid-column: 1 / -1;
  margin: -3px 0 2px;
  color: rgba(20, 24, 21, 0.62);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.actions #generateBtn {
  grid-column: 1 / -1;
}

.actions #saveVideoBtn:not(.is-hidden) {
  grid-column: 1 / -1;
}

.actions #savePdfBtn:not(.is-hidden) {
  grid-column: 1 / -1;
}

.motion-field,
.music-field,
.ecard-style-summary,
.finish-actions,
.voice-recorder,
#saveVideoBtn.is-hidden,
#saveDraftBtn,
#loadDraftBtn {
  display: none !important;
}

.finish-actions {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(31, 138, 82, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.finish-actions strong {
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 950;
}

.finish-caption-preview {
  margin: 0;
  width: 100%;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid rgba(31, 138, 82, 0.13);
  border-radius: 14px;
  color: #315240;
  background: rgba(255, 255, 255, 0.58);
  resize: none;
  font-size: 0.78rem;
  font-weight: 820;
  font-family: inherit;
  line-height: 1.25;
}

.finish-actions div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.finish-actions button {
  min-height: 40px;
  border-radius: 999px;
  font-size: 0.82rem;
}

.ready-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(31, 138, 82, 0.16);
  border-radius: 18px;
  background: rgba(247, 255, 250, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.ready-card strong {
  color: var(--accent-dark);
  font-size: 0.88rem;
  font-weight: 950;
}

.ready-card ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ready-card li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  color: #526058;
  font-size: 0.78rem;
  font-weight: 820;
  line-height: 1.25;
}

.ready-card li b {
  min-width: 0;
  font: inherit;
}

.ready-card li span {
  min-width: 34px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  background: #8b9a91;
  font-size: 0.62rem;
  font-weight: 950;
  text-align: center;
}

.ready-card li.is-ok {
  color: var(--accent-dark);
}

.ready-card li.is-ok span {
  background: var(--accent);
}

.ready-card li.needs-work span {
  background: #c06a35;
}

.ready-card.is-ready {
  border-color: rgba(31, 138, 82, 0.34);
  background: rgba(242, 255, 248, 0.95);
}

button {
  min-height: 50px;
  padding: 0 16px;
  border-radius: 15px;
  font: inherit;
  font-weight: 950;
  white-space: nowrap;
  cursor: pointer;
}

button:hover {
  filter: saturate(1.04);
}

button:active {
  transform: translateY(1px);
}

.tool-tabs .tool-tab {
  min-height: 40px;
  padding: 0 8px;
}

.primary {
  border: 0;
  color: #fff;
  background: var(--accent);
}

.secondary {
  border: 1px solid var(--line);
  color: var(--accent-dark);
  background: #fff;
}

.status {
  min-height: 24px;
  color: var(--accent-dark);
  font-weight: 850;
}

.voice-recorder {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(31, 138, 82, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.voice-recorder button {
  min-height: 38px;
  border-radius: 999px;
  font-size: 0.82rem;
}

.voice-recorder span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-align: center;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.notes {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: clamp(16px, 3vw, 24px);
}

.notes article {
  display: grid;
  gap: 7px;
  padding: 18px;
}

.notes strong {
  font-size: 0.96rem;
}

.notes span {
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 900px) {
  .intro,
  .studio,
  .notes {
    grid-template-columns: 1fr;
  }

  .sample-board {
    min-height: 430px;
  }

  .preview-card {
    min-height: 560px;
  }
}

@media (max-width: 560px) {
  html,
  body {
    min-height: 100%;
    background:
      radial-gradient(circle at 12% 0%, rgba(33, 137, 85, 0.16), transparent 28%),
      radial-gradient(circle at 86% 0%, rgba(238, 63, 117, 0.12), transparent 24%),
      #f7fbf8;
  }

  .app-shell {
    width: 100%;
    padding: 8px 8px 0;
  }

  .app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 54px;
    margin-bottom: 8px;
    padding: 6px 8px;
    border: 1px solid rgba(217, 229, 221, 0.8);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 12px 32px rgba(28, 62, 43, 0.10);
    backdrop-filter: blur(18px);
  }

  .mode-shortcuts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    margin: 0 0 8px;
    padding: 4px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 10px 26px rgba(28, 62, 43, 0.08);
  }

  .mode-shortcut {
    min-height: 36px;
    font-size: 0.78rem;
  }

  .mode-helper {
    width: 100%;
    margin: -2px 0 8px;
    color: rgba(20, 24, 21, 0.66);
    font-size: 0.72rem;
    font-weight: 850;
    line-height: 1.25;
    text-align: center;
  }

  .flow-coach {
    display: flex;
    width: 100%;
    margin: -2px 0 8px;
    padding: 0 2px 2px;
    gap: 6px;
  }

  .flow-step {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 3px 9px 3px 4px;
    font-size: 0.7rem;
    box-shadow: 0 8px 18px rgba(28, 62, 43, 0.06);
  }

  .flow-step span {
    width: 23px;
    height: 23px;
    font-size: 0.64rem;
  }

  .starter-strip {
    display: flex;
    align-items: stretch;
    gap: 7px;
    margin: 0 0 8px;
    position: relative;
    padding: 24px 0 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .starter-intro {
    display: flex;
    position: absolute;
    inset: 0 0 auto;
    pointer-events: none;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    margin: 0;
    font-size: 0.68rem;
    letter-spacing: 0;
  }

  .starter-intro strong {
    font-size: 0.76rem;
    text-align: center;
  }

  .starter-steps {
    display: none;
  }

  .starter-steps b {
    min-height: 24px;
    padding: 0 7px;
    font-size: 0.62rem;
  }

  .starter-strip::-webkit-scrollbar {
    display: none;
  }

  .starter-card {
    flex: 0 0 126px;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 7px;
    min-height: 48px;
    padding: 6px 7px;
    border-radius: 15px;
    box-shadow: 0 10px 22px rgba(28, 62, 43, 0.07);
    scroll-snap-align: start;
  }

  .starter-featured {
    grid-row: auto;
    grid-template-columns: 34px minmax(0, 1fr);
    min-height: 54px;
    padding: 7px 8px;
  }

  .starter-thumb {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 0.68rem;
  }

  .starter-featured .starter-thumb {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .starter-card strong {
    font-size: 0.68rem;
  }

  .starter-card small {
    font-size: 0.53rem;
  }

  .starter-featured strong {
    margin-top: 0;
    font-size: 0.72rem;
  }

  .starter-featured small {
    font-size: 0.56rem;
  }

  .brand {
    gap: 8px;
    font-size: 0.96rem;
    min-width: 0;
  }

  .brand span:not(.brand-mark) {
    display: none;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }

  .local-pill {
    display: none;
  }

  .header-style,
  .dock-style {
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
    margin-left: 4px;
    padding: 4px;
    border-radius: 16px;
    background: rgba(244, 250, 246, 0.86);
    box-shadow: none;
  }

  .dock-style {
    display: none !important;
  }

  .header-style span,
  .dock-style span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .header-style select,
  .dock-style select {
    width: 100%;
    min-height: 38px;
    font-size: 0.78rem;
  }

  .quick-remix {
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.78rem;
  }

  .install-app {
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.72rem;
  }

  .dock-style select {
    padding-left: 8px;
    padding-right: 22px;
  }

  .app-shell {
    padding-bottom: 0;
  }

  h1 {
    font-size: 2.45rem;
  }

  .intro,
  .sample-board,
  .notes {
    display: none;
  }

  .studio {
    position: relative;
    min-height: calc(100dvh - 70px);
    gap: 10px;
  }

  .mode-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .sample-board {
    min-height: 360px;
  }

  .sample-card {
    padding: 7px;
    border-radius: 16px;
  }

  .sample-card figcaption {
    font-size: 0.7rem;
  }

  .sample-frame {
    width: 44%;
    height: 260px;
  }

  .sample-heart,
  .sample-birthday,
  .sample-couple {
    width: 46%;
    height: 168px;
  }

  .sample-ornate {
    left: 3%;
    top: 44px;
  }

  .sample-straight {
    left: 29%;
    top: 8px;
  }

  .sample-heart {
    right: 2%;
    top: 52px;
  }

  .sample-birthday {
    right: 10%;
    bottom: 30px;
  }

  .sample-couple {
    right: 0;
    bottom: 120px;
  }

  .sample-art {
    min-height: 126px;
  }

  .preview-card {
    min-height: calc(100dvh - 70px);
    align-content: start;
    padding: 12px 8px 18px 62px;
    border-radius: 24px;
    background:
      linear-gradient(45deg, rgba(218, 232, 223, 0.55) 25%, transparent 25%),
      linear-gradient(-45deg, rgba(218, 232, 223, 0.55) 25%, transparent 25%),
      linear-gradient(45deg, transparent 75%, rgba(218, 232, 223, 0.55) 75%),
      linear-gradient(-45deg, transparent 75%, rgba(218, 232, 223, 0.55) 75%),
      #fbfefb;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0;
    background-size: 18px 18px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  }

  body.dock-right .preview-card {
    padding: 12px 62px 18px 8px;
  }

  body.dock-bottom .preview-card {
    padding: 12px 8px 110px;
  }

  canvas {
    width: min(100%, 340px);
    border-radius: 22px;
    box-shadow: 0 18px 44px rgba(27, 70, 45, 0.16);
  }

  .drag-hint {
    max-width: 29ch;
    margin-top: 9px;
    padding: 7px 10px;
    border: 1px solid rgba(31, 138, 82, 0.12);
    border-radius: 999px;
    color: rgba(20, 24, 21, 0.68);
    background: rgba(255, 255, 255, 0.78);
    font-size: 0.72rem;
    pointer-events: none;
  }

  body.dock-bottom:not(.is-preview-only) .drag-hint {
    position: fixed;
    left: 50%;
    bottom: calc(70px + env(safe-area-inset-bottom));
    z-index: 34;
    width: min(310px, calc(100% - 92px));
    max-width: none;
    margin: 0;
    box-shadow: 0 12px 28px rgba(28, 62, 43, 0.12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transform: translateX(-50%);
  }

  .motion-strip {
    margin-top: 2px;
  }

  .result-actions {
    position: fixed;
    left: 50%;
    bottom: calc(72px + env(safe-area-inset-bottom));
    z-index: 36;
    max-width: calc(100% - 86px);
    grid-template-columns: auto auto auto auto;
    gap: 6px;
    padding: 7px;
    transform: translateX(-50%);
  }

  body.is-preview-only .tool-tabs {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px);
  }

  body.is-preview-only .quick-remix,
  body.is-preview-only .mode-shortcuts,
  body.is-preview-only .mode-helper,
  body.is-preview-only .flow-coach,
  body.is-preview-only .starter-strip,
  body.is-preview-only .drag-hint {
    display: none;
  }

  body.is-panel-open .drag-hint {
    display: none;
  }

  body.is-preview-only .preview-card {
    padding-bottom: 18px;
  }

  body.is-preview-only .result-actions {
    bottom: calc(14px + env(safe-area-inset-bottom));
    max-width: calc(100% - 26px);
    padding: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 46px rgba(28, 62, 43, 0.18);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  body.is-preview-only .result-caption {
    bottom: calc(96px + env(safe-area-inset-bottom));
    width: min(328px, calc(100% - 64px));
    padding: 9px 9px 9px 12px;
  }

  .result-actions button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.7rem;
  }

  .control-card {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: block;
    max-height: none;
    overflow: visible;
    gap: 10px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    pointer-events: none;
  }

  .tool-tabs {
    position: fixed;
    top: 76px;
    bottom: 12px;
    left: 8px;
    z-index: 12;
    display: grid;
    grid-template-columns: 1fr;
    align-content: center;
    gap: 8px;
    width: 54px;
    padding: 7px 6px;
    overflow: visible;
    border: 1px solid rgba(217, 229, 221, 0.92);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 18px 45px rgba(28, 62, 43, 0.18);
    backdrop-filter: blur(18px);
    pointer-events: auto;
  }

  body.dock-right .tool-tabs {
    right: 8px;
    left: auto;
  }

  body.dock-bottom .tool-tabs {
    top: auto;
    right: 8px;
    bottom: 8px;
    left: 8px;
    grid-template-columns: repeat(6, 1fr);
    width: auto;
    padding: 6px;
    border-radius: 999px;
  }

  body.dock-bottom .tool-tabs .tool-tab {
    width: auto;
    min-width: 0;
    min-height: 42px;
    padding: 0 2px;
    font-size: 0.62rem;
  }

  .tool-tab {
    font-size: 0.72rem;
  }

  .tool-tabs .tool-tab {
    display: grid;
    place-items: center;
    min-height: 42px;
    width: 42px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 999px;
    writing-mode: horizontal-tb;
    transform: none;
    line-height: 1;
    font-size: 0.72rem;
    letter-spacing: 0;
  }

  .tool-tabs .view-tab {
    display: grid;
  }

  .tool-tabs .tool-tab span {
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.dock-bottom .tool-tabs .tool-tab {
    width: auto !important;
    min-width: 0;
    padding: 0 2px;
  }

  body.dock-bottom .tool-tabs {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  body.dock-bottom .tool-tabs .tool-tab span {
    font-size: 0.64rem;
  }

  .tool-tabs .tool-tab.is-active {
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.28),
      0 10px 22px rgba(31, 138, 82, 0.24);
  }

  .upload-box {
    grid-template-columns: auto 1fr;
    place-items: center start;
    min-height: 74px;
    padding: 10px;
    text-align: left;
  }

  .tool-panel[data-panel="photos"],
  .tool-panel[data-panel="photos"].is-active {
    grid-template-columns: 52px;
    align-content: center;
    justify-content: center;
    gap: 10px;
    padding-left: 0;
  }

  .tool-panel[data-panel="photos"] .upload-box {
    grid-template-columns: 1fr;
    place-items: center;
    width: 52px;
    min-height: 52px;
    padding: 6px;
    text-align: center;
  }

  .secondary-upload {
    min-height: 56px;
  }

  .background-upload {
    min-height: 56px;
  }

  .upload-icon {
    grid-row: auto;
    width: 42px;
    height: 42px;
    border-radius: 15px;
    font-size: 0.76rem;
  }

  .upload-box strong {
    align-self: center;
    font-size: 0.74rem;
  }

  .tool-panel[data-panel="photos"] .upload-box strong {
    display: none;
  }

  .tool-panel[data-panel="photos"] .capture-check {
    display: none !important;
  }

  .upload-box small {
    display: none;
    align-self: center;
    font-size: 0.76rem;
    line-height: 1.25;
  }

  .panel-rail {
    position: fixed;
    top: 76px;
    bottom: 12px;
    left: 70px;
    width: min(286px, calc(100vw - 84px));
    display: flex;
    gap: 0;
    overflow-x: hidden;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding-top: 11px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(13, 53, 32, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-14px) scale(0.985);
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease, visibility 0s linear 160ms;
  }

  body.panel-text .panel-rail {
    top: var(--panel-top, 96px);
    bottom: auto;
    width: min(152px, calc(100vw - 92px));
    height: min(var(--panel-height, 214px), calc(100dvh - 88px));
    padding: 9px;
    border-radius: 22px;
  }

  body.panel-adjust .panel-rail {
    top: var(--panel-top, 264px);
    bottom: auto;
    width: min(152px, calc(100vw - 92px));
    height: min(var(--panel-height, 236px), calc(100dvh - 88px));
    min-height: 0;
    padding: 9px;
    border-radius: 22px;
    transform: translateX(-14px) scale(0.985);
  }

  body.panel-adjust.is-panel-open .panel-rail {
    transform: translateX(0) scale(1);
  }

  body.panel-decor .panel-rail {
    top: var(--panel-top, 218px);
    bottom: auto;
    width: min(152px, calc(100vw - 92px));
    height: min(var(--panel-height, 360px), calc(100dvh - 88px));
    min-height: 0;
    padding: 9px;
    border-radius: 22px;
    transform: translateX(-14px) scale(0.985);
  }

  body.panel-decor.is-panel-open .panel-rail {
    transform: translateX(0) scale(1);
  }

  body.panel-export .panel-rail {
    top: var(--panel-top, 327px);
    bottom: auto;
    width: min(190px, calc(100vw - 92px));
    height: min(var(--panel-height, 330px), calc(100dvh - 88px));
    min-height: 0;
    padding: 9px;
    border-radius: 22px;
    transform: translateX(-14px) scale(0.985);
  }

  body.panel-export.is-panel-open .panel-rail {
    transform: translateX(0) scale(1);
  }

  body.panel-photos .panel-rail {
    top: var(--panel-top, 310px);
    bottom: auto;
    left: 58px;
    width: 72px;
    height: min(var(--panel-height, 224px), calc(100dvh - 88px));
    min-height: 0;
    padding: 10px 8px;
    border-radius: 26px;
    transform: translateX(-14px) scale(0.985);
    overflow: hidden;
  }

  body.mode-id.panel-photos .panel-rail {
    width: 204px;
    height: min(var(--panel-height, 186px), calc(100dvh - 88px));
  }

  body.panel-photos .tool-panel,
  body.panel-photos .tool-panel.is-active {
    justify-content: center;
    min-height: 0;
    height: auto;
    overflow: hidden;
    padding: 0;
  }

  body.mode-id.panel-photos .tool-panel,
  body.mode-id.panel-photos .tool-panel.is-active {
    grid-template-columns: repeat(3, 52px);
    align-content: center;
    justify-content: center;
    gap: 8px;
  }

  body.mode-id.panel-photos .id-layout-strip {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
  }

  body.mode-id.panel-photos .id-layout-chip {
    min-height: 46px;
    padding: 5px 4px;
    border-radius: 14px;
  }

  body.mode-id.panel-photos .id-layout-chip strong {
    font-size: 0.72rem;
  }

  body.mode-id.panel-photos .id-layout-chip span {
    font-size: 0.52rem;
  }

  body.panel-photos.is-panel-open .panel-rail {
    transform: translateX(0) scale(1);
  }

  body.dock-right .panel-rail {
    right: 70px;
    left: auto;
    transform: translateX(14px) scale(0.985);
  }

  body.dock-right.is-panel-open .panel-rail {
    transform: translateX(0) scale(1);
  }

  body.dock-right.panel-photos .panel-rail {
    right: 58px;
    left: auto;
    transform: translateX(14px) scale(0.985);
  }

  body.dock-right.panel-photos.is-panel-open .panel-rail {
    transform: translateX(0) scale(1);
  }

  body.dock-right.panel-decor .panel-rail,
  body.dock-right.panel-adjust .panel-rail,
  body.dock-right.panel-export .panel-rail {
    transform: translateX(14px) scale(0.985);
  }

  body.dock-right.panel-decor.is-panel-open .panel-rail,
  body.dock-right.panel-adjust.is-panel-open .panel-rail,
  body.dock-right.panel-export.is-panel-open .panel-rail {
    transform: translateX(0) scale(1);
  }

  body.dock-bottom .panel-rail {
    top: auto;
    right: 8px;
    bottom: 66px;
    left: 8px;
    width: auto;
    height: min(390px, calc(100dvh - 152px));
    transform: translateY(14px) scale(0.985);
  }

  body.dock-bottom .tool-panel[data-panel="photos"],
  body.dock-bottom .tool-panel[data-panel="photos"].is-active {
    grid-template-columns: repeat(3, 1fr);
    align-content: start;
    padding-left: 0;
  }

  body.mode-couple.dock-bottom .tool-panel[data-panel="photos"],
  body.mode-couple.dock-bottom .tool-panel[data-panel="photos"].is-active,
  body.mode-id.dock-bottom .tool-panel[data-panel="photos"],
  body.mode-id.dock-bottom .tool-panel[data-panel="photos"].is-active {
    grid-template-columns: repeat(4, 1fr);
  }

  body.dock-bottom .tool-panel[data-panel="photos"] .upload-box {
    min-height: 86px;
  }

  body.dock-bottom .tool-panel[data-panel="photos"] .sample-button {
    align-self: stretch;
    min-height: 86px;
    padding: 0 6px;
    font-size: 0.72rem;
  }

  body.dock-bottom .tool-panel[data-panel="photos"] .sample-button-kicker {
    min-width: 0;
    padding: 3px 8px;
    font-size: 0.62rem;
  }

  body.dock-bottom .tool-panel[data-panel="photos"] .sample-button strong {
    font-size: 0.74rem;
  }

  body.dock-bottom .tool-panel[data-panel="photos"] .sample-button small {
    display: none;
  }

  body.dock-bottom.panel-photos .panel-rail {
    top: auto;
    width: auto;
    height: 112px;
    min-height: 0;
    padding: 10px;
    transform: translateY(14px) scale(0.985);
  }

  body.mode-id.dock-bottom.panel-photos .panel-rail {
    height: 176px;
  }

  body.mode-id.dock-bottom.panel-photos .tool-panel[data-panel="photos"],
  body.mode-id.dock-bottom.panel-photos .tool-panel[data-panel="photos"].is-active {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
  }

  body.mode-id.dock-bottom.panel-photos .id-layout-strip {
    order: -1;
    grid-column: 1 / -1;
  }

  body.mode-id.dock-bottom.panel-photos .tool-panel[data-panel="photos"] .upload-box,
  body.mode-id.dock-bottom.panel-photos .tool-panel[data-panel="photos"] .sample-button {
    min-height: 68px;
  }

  body.dock-bottom.panel-text .panel-rail {
    top: auto;
    right: 8px;
    bottom: 66px;
    left: 8px;
    width: auto;
    height: min(306px, calc(100dvh - 152px));
    transform: translateY(14px) scale(0.985);
  }

  body.dock-bottom.panel-decor .panel-rail {
    top: auto;
    right: 8px;
    bottom: 66px;
    left: 8px;
    width: auto;
    height: 252px;
    padding: 8px 10px;
    transform: translateY(14px) scale(0.985);
  }

  body.dock-bottom.panel-adjust .panel-rail {
    top: auto;
    right: 8px;
    bottom: 66px;
    left: 8px;
    width: auto;
    height: 278px;
    transform: translateY(14px) scale(0.985);
  }

  body.mode-id.dock-bottom.panel-adjust .panel-rail {
    height: 182px;
  }

  body.mode-sticker.dock-bottom.panel-adjust .panel-rail {
    height: 230px;
  }

  body.dock-bottom.panel-export .panel-rail {
    top: auto;
    right: 8px;
    bottom: 66px;
    left: 8px;
    width: auto;
    height: 372px;
    transform: translateY(14px) scale(0.985);
  }

  body.mode-id.dock-bottom.panel-export .panel-rail,
  body.mode-frame.dock-bottom.panel-export .panel-rail,
  body.mode-sticker.dock-bottom.panel-export .panel-rail {
    height: 292px;
  }

  body.dock-bottom.is-panel-open .panel-rail {
    transform: translateY(0) scale(1);
  }

  body.is-panel-open .panel-rail {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) scale(1);
    pointer-events: auto;
    transition-delay: 0s;
  }

  .panel-rail::-webkit-scrollbar {
    display: none;
  }

  .panel-rail::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 3;
    width: 18px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.5) 55%, rgba(255, 255, 255, 0));
    pointer-events: none;
  }

  .panel-rail::after {
    content: "";
    position: absolute;
    top: 5px;
    left: 50%;
    z-index: 4;
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: rgba(31, 138, 82, 0.22);
    transform: translateX(-50%);
    pointer-events: none;
  }

  .tool-panel,
  .tool-panel.is-active {
    box-sizing: border-box;
    align-content: start;
    width: 100%;
    min-height: 100%;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    background: transparent;
    scroll-snap-align: start;
    gap: 8px;
  }

  .tool-panel {
    display: none;
  }

  .tool-panel.is-active {
    display: grid;
  }

  body.panel-adjust .tool-panel,
  body.panel-adjust .tool-panel.is-active,
  body.panel-export .tool-panel,
  body.panel-export .tool-panel.is-active {
    min-height: 0;
    height: auto;
  }

  body.panel-export .tool-panel,
  body.panel-export .tool-panel.is-active {
    overflow-y: auto;
  }

  .tool-panel .field {
    gap: 4px;
  }

  .tool-panel .field span {
    color: rgba(20, 24, 21, 0.82);
    font-size: 0.72rem;
    line-height: 1;
  }

  .tool-panel .toggle-field {
    gap: 7px;
    padding: 8px 9px;
    border-radius: 15px;
  }

  .tool-panel .toggle-field input {
    width: 18px;
    height: 18px;
  }

  .tool-panel .toggle-field strong {
    font-size: 0.72rem;
  }

  .tool-panel .toggle-field small {
    font-size: 0.62rem;
    line-height: 1.15;
  }

  .tool-panel input[type="text"],
  .tool-panel select {
    min-height: 34px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    font-size: 0.78rem;
    padding: 0 9px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.42) inset;
  }

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

  .tool-panel[data-panel="text"],
  .tool-panel[data-panel="text"].is-active {
    gap: 6px;
  }

  .tool-panel[data-panel="text"] .text-chip-strip {
    margin: 0 -3px;
    padding-bottom: 3px;
  }

  .tool-panel[data-panel="text"] .text-chip {
    min-height: 30px;
    padding: 0 9px;
    font-size: 0.68rem;
  }

  .tool-panel[data-panel="text"] .adjust-grid {
    grid-template-columns: 1fr 1fr;
    gap: 7px 9px;
  }

  .tool-panel[data-panel="text"] .adjust-grid .field span {
    font-size: 0.66rem;
  }

  body.dock-bottom .tool-panel[data-panel="text"],
  body.dock-bottom .tool-panel[data-panel="text"].is-active {
    align-content: start;
    padding: 18px 12px 10px;
    gap: 6px;
  }

  body.dock-bottom .tool-panel[data-panel="text"] .text-value-field {
    grid-template-columns: 74px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
  }

  body.dock-bottom .tool-panel[data-panel="text"] .text-value-field span {
    overflow: hidden;
    color: rgba(22, 45, 32, 0.82);
    font-size: 0.7rem;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.dock-bottom .tool-panel[data-panel="text"] input[type="text"] {
    min-height: 34px;
    border-radius: 13px;
    font-size: 0.8rem;
  }

  body.dock-bottom .tool-panel[data-panel="text"] input[type="range"] {
    min-height: 18px;
  }

  .tool-panel[data-panel="adjust"],
  .tool-panel[data-panel="adjust"].is-active {
    gap: 10px;
  }

  body.mode-id .tool-panel[data-panel="adjust"],
  body.mode-id .tool-panel[data-panel="adjust"].is-active {
    grid-template-columns: 1fr 1fr;
    align-content: center;
    gap: 8px;
  }

  body.mode-id .tool-panel[data-panel="adjust"] > .field:first-child,
  body.mode-id .tool-panel[data-panel="adjust"] #heartSizeField,
  body.mode-id .tool-panel[data-panel="adjust"] #stickerLayoutField,
  body.mode-id .tool-panel[data-panel="adjust"] #stickerOutputField {
    display: none;
  }

  body.mode-id .tool-panel[data-panel="adjust"] .adjust-grid,
  body.mode-id .tool-panel[data-panel="adjust"] .id-cut-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-column: 1 / -1;
    gap: 8px;
  }

  body.mode-id .tool-panel[data-panel="adjust"] .id-cut-controls button {
    min-height: 42px;
    padding: 0 5px;
    font-size: 0.66rem;
  }

  body.mode-sticker .tool-panel[data-panel="adjust"] > .field:first-child {
    display: none;
  }

  body.mode-sticker .tool-panel[data-panel="adjust"],
  body.mode-sticker .tool-panel[data-panel="adjust"].is-active {
    align-content: center;
    gap: 8px;
  }

  .tool-panel[data-panel="decor"],
  .tool-panel[data-panel="decor"].is-active {
    gap: 7px;
    padding-top: 24px;
  }

  .tool-panel[data-panel="decor"] .occasion-chip-strip {
    order: 1;
    margin-top: 0;
    padding-bottom: 3px;
  }

  .tool-panel[data-panel="decor"] .occasion-chip {
    gap: 4px;
    min-height: 32px;
    padding: 0 9px 0 7px;
    font-size: 0.68rem;
  }

  .tool-panel[data-panel="decor"] .occasion-chip span {
    width: 22px;
    height: 22px;
    font-size: 0.92rem;
  }

  .tool-panel[data-panel="decor"] #decorCategoryField {
    display: none;
  }

  .tool-panel[data-panel="decor"] .sticker-chip-panel {
    order: 3;
    min-width: 0;
    gap: 5px;
  }

  .tool-panel[data-panel="decor"] .sticker-choice-chip {
    gap: 4px;
    min-height: 32px;
    padding: 0 8px 0 6px;
    font-size: 0.66rem;
  }

  .tool-panel[data-panel="decor"] .sticker-choice-chip span {
    width: 22px;
    height: 22px;
    font-size: 0.92rem;
  }

  .tool-panel[data-panel="decor"] input[type="color"] {
    width: 100%;
    min-height: 34px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
  }

  .tool-panel[data-panel="decor"] .adjust-grid {
    order: 5;
    grid-template-columns: minmax(94px, 0.62fr) minmax(0, 1fr);
    gap: 7px;
  }

  .tool-panel[data-panel="decor"] {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .tool-panel[data-panel="decor"] .occasion-chip-strip,
  .tool-panel[data-panel="decor"] .sticker-chip-panel,
  .tool-panel[data-panel="decor"] .sticker-size-field,
  .tool-panel[data-panel="decor"] .mini-actions,
  .tool-panel[data-panel="decor"] .adjust-grid {
    grid-column: 1 / -1;
  }

  .mini-actions {
    order: 2;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  .mini-actions button {
    min-height: 34px;
    padding: 0 4px;
    border: 1px solid rgba(20, 40, 28, 0.14);
    border-radius: 999px;
    color: #0f5f38;
    background: rgba(255, 255, 255, 0.62);
    font-size: 0.62rem;
    font-weight: 900;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .tool-panel[data-panel="export"],
  .tool-panel[data-panel="export"].is-active {
    align-content: start;
    gap: 7px;
    padding-top: 7px;
  }

  .tool-panel[data-panel="export"] {
    grid-template-areas:
      "actions"
      "preview"
      "voice"
      "status"
      "preset"
      "motion"
      "music"
      "summary"
      "ready"
      "finish";
  }

  .tool-panel[data-panel="export"] .ready-card {
    grid-area: ready;
    gap: 4px;
    padding: 8px 9px;
    border-radius: 16px;
  }

  .tool-panel[data-panel="export"] .ready-card strong {
    font-size: 0.76rem;
  }

  .tool-panel[data-panel="export"] .ready-card ul {
    gap: 3px;
  }

  .tool-panel[data-panel="export"] .ready-card li {
    gap: 5px;
    font-size: 0.66rem;
    line-height: 1.08;
  }

  .tool-panel[data-panel="export"] .ready-card li span {
    min-width: 28px;
    padding: 2px 5px;
    font-size: 0.56rem;
  }

  .tool-panel[data-panel="export"] .export-preset-field {
    gap: 7px;
    padding: 7px 8px;
    border-radius: 15px;
  }

  .tool-panel[data-panel="export"] #exportPresetField {
    grid-area: preset;
  }

  .tool-panel[data-panel="export"] #outputPreviewCard {
    grid-area: preview;
  }

  .tool-panel[data-panel="export"] #motionStyleField {
    grid-area: motion;
  }

  .tool-panel[data-panel="export"] #musicField {
    grid-area: music;
  }

  .tool-panel[data-panel="export"] .export-preset-field span {
    font-size: 0.66rem;
  }

  .tool-panel[data-panel="export"] .export-preset-field select {
    min-height: 36px;
    padding: 0 9px;
    font-size: 0.72rem;
  }

  .tool-panel[data-panel="export"] .ecard-style-summary {
    grid-area: summary;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 6px;
    padding: 8px;
    border-radius: 15px;
  }

  .tool-panel[data-panel="export"] .ecard-style-summary span {
    font-size: 0.58rem;
  }

  .tool-panel[data-panel="export"] .ecard-style-summary strong {
    font-size: 0.72rem;
  }

  .tool-panel[data-panel="export"] .ecard-style-summary button {
    min-height: 32px;
    padding: 0 9px;
    font-size: 0.66rem;
  }

  .tool-panel[data-panel="export"] .actions {
    grid-area: actions;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .tool-panel[data-panel="export"] .actions .webm-note {
    grid-column: 1 / -1;
    margin: -4px 7px 0;
    font-size: 0.62rem;
    line-height: 1.12;
  }

  .tool-panel[data-panel="export"] .actions #saveDraftBtn,
  .tool-panel[data-panel="export"] .actions #loadDraftBtn {
    display: none;
  }

  .tool-panel[data-panel="export"] .finish-actions {
    grid-area: finish;
    gap: 6px;
    padding: 8px;
    border-radius: 16px;
  }

  .tool-panel[data-panel="export"] .voice-recorder {
    grid-area: voice;
    padding: 7px;
  }

  .tool-panel[data-panel="export"] .status {
    grid-area: status;
    margin: 0;
    padding: 6px 2px;
    font-size: 0.72rem;
    line-height: 1.16;
  }

  .tool-panel[data-panel="export"] .finish-actions.is-hidden {
    display: none;
  }

  .tool-panel[data-panel="export"] .finish-actions strong {
    font-size: 0.72rem;
  }

  .tool-panel[data-panel="export"] .finish-caption-preview {
    padding: 7px 8px;
    border-radius: 13px;
    font-size: 0.66rem;
    line-height: 1.16;
  }

  .tool-panel[data-panel="export"] .finish-actions div {
    gap: 6px;
  }

  .tool-panel[data-panel="export"] .finish-actions button {
    min-height: 36px;
    padding: 0 8px;
    font-size: 0.66rem;
  }

  .tool-panel[data-panel="export"] .voice-recorder {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
  }

  .tool-panel[data-panel="export"] .voice-recorder #recordVoiceBtn {
    grid-column: auto;
  }

  .tool-panel[data-panel="export"] button {
    min-height: 40px;
    border-radius: 999px;
  }

  .tool-panel[data-panel="export"] .voice-recorder button {
    min-height: 36px;
    padding: 0 9px;
    font-size: 0.68rem;
  }

  .tool-panel[data-panel="export"] .voice-recorder span {
    grid-column: 1 / -1;
    font-size: 0.68rem;
    line-height: 1.2;
  }

  .tool-panel[data-panel="export"] .status {
    color: rgba(15, 95, 56, 0.92);
    font-size: 0.78rem;
    line-height: 1.3;
    text-align: center;
  }

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

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

/* Simplified studio experience: homepage carries the examples, this page focuses on making the card. */
.intro,
.starter-strip,
.flow-coach,
.notes,
.quick-remix,
.install-app,
.local-pill,
.background-upload,
.tool-tab[data-panel-target="adjust"],
.tool-tabs .view-tab,
.motion-field,
.music-field,
.ecard-style-summary,
.finish-actions,
.voice-recorder,
#saveDraftBtn,
#loadDraftBtn,
.webm-note,
.tool-panel[data-panel="decor"] #decorCategoryField,
.tool-panel[data-panel="decor"] .adjust-grid,
.tool-panel[data-panel="decor"] .mini-actions {
  display: none !important;
}

.tool-panel[data-panel="adjust"] > .field:first-child,
.tool-panel[data-panel="adjust"] .cleanup-preset-field,
.tool-panel[data-panel="adjust"] #brightnessField,
.tool-panel[data-panel="adjust"] #idGuideField,
.tool-panel[data-panel="adjust"] #idLayoutField,
.tool-panel[data-panel="adjust"] .id-cut-controls {
  display: none !important;
}

.tool-panel[data-panel="adjust"].is-active {
  display: grid;
  gap: 12px;
}

.tool-panel[data-panel="adjust"] .adjust-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tool-panel[data-panel="adjust"] .reset-photo-action {
  display: block;
  width: 100%;
}

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

  .control-card {
    position: static;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 8px;
  }

  .app-header {
    top: 6px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    min-height: auto;
    margin-bottom: 8px;
  }

  .brand span:not(.brand-mark) {
    display: inline;
    max-width: 108px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-style {
    margin-left: 0;
  }

  .header-style span {
    display: none;
  }

  .header-style select {
    width: 100%;
    font-size: 0.82rem;
  }

  .mode-shortcuts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 18px;
  }

  .mode-helper {
    margin-bottom: 10px;
    padding: 0 6px;
    font-size: 0.78rem;
  }

  .studio {
    gap: 10px;
    margin-top: 8px;
  }

  .preview-card {
    min-height: auto;
    padding: 12px;
  }

  body.dock-bottom .preview-card,
  body.dock-right .preview-card {
    padding: 12px !important;
  }

  canvas {
    width: min(100%, 360px);
    border-radius: 22px;
  }

  .control-card {
    padding: 12px;
    border-radius: 20px;
  }

  body.dock-bottom:not(.is-preview-only) .drag-hint,
  body.dock-right:not(.is-preview-only) .drag-hint {
    position: static !important;
    width: auto !important;
    max-width: 30ch !important;
    margin: 10px auto 0 !important;
    transform: none !important;
    box-shadow: none !important;
  }

  .tool-tabs {
    grid-template-columns: repeat(4, 1fr);
  }

  body.dock-bottom .control-card,
  body.dock-right .control-card {
    display: grid;
    height: auto;
    min-height: 0;
    padding: 12px;
    pointer-events: auto !important;
    background: rgba(255, 255, 255, 0.78) !important;
  }

  body.dock-bottom .tool-tabs,
  body.dock-right .tool-tabs {
    position: static;
    inset: auto;
    width: 100%;
    transform: none;
  }

  body.dock-bottom .panel-rail,
  body.dock-right .panel-rail,
  body.panel-photos .panel-rail,
  body.panel-export .panel-rail {
    position: static !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  body.dock-bottom .tool-panel,
  body.dock-bottom .tool-panel.is-active,
  body.dock-right .tool-panel,
  body.dock-right .tool-panel.is-active,
  body.panel-photos .tool-panel.is-active,
  body.panel-export .tool-panel.is-active {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  .tool-panel:not(.is-active) {
    display: none !important;
  }

  body.dock-bottom .tool-panel.is-active,
  body.dock-right .tool-panel.is-active {
    display: grid !important;
  }

  body.dock-bottom .tool-panel[data-panel="photos"].is-active,
  body.dock-right .tool-panel[data-panel="photos"].is-active {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  body.dock-bottom .tool-panel[data-panel="photos"] .upload-box,
  body.dock-right .tool-panel[data-panel="photos"] .upload-box,
  body.dock-bottom .tool-panel[data-panel="photos"] .sample-button,
  body.dock-right .tool-panel[data-panel="photos"] .sample-button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 118px;
  }

  .photo-size-controls .adjust-grid {
    grid-template-columns: 1fr;
  }
}
