:root {
  --ink: #17231f;
  --muted: #65706b;
  --paper: #f4f1e8;
  --cream: #fbfaf5;
  --white: #fff;
  --mint: #b9e7d0;
  --mint-dark: #2d6b54;
  --coral: #f07b63;
  --line: rgba(23, 35, 31, 0.13);
  --shadow: 0 24px 70px rgba(28, 52, 43, 0.13);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.modal-open {
  position: fixed;
  right: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.topbar {
  height: 76px;
  padding: 0 clamp(20px, 4vw, 68px);
  display: flex;
  align-items: center;
  gap: 48px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(244, 241, 232, 0.9);
  border-bottom: 1px solid rgba(23, 35, 31, 0.09);
  backdrop-filter: blur(18px);
  transition: transform .22s ease;
  will-change: transform;
}
body.editor-mode .topbar.editor-nav-hidden { transform: translateY(calc(-100% - 2px)); }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.05; }
.brand small { font: 650 8px/1.4 ui-monospace, monospace; letter-spacing: .2em; color: var(--muted); margin-top: 4px; }
.brand-mark { width: 37px; height: 37px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; transform: rotate(-4deg); flex: none; }
.brand-mark i { display: block; border-radius: 5px; background: var(--mint-dark); }
.brand-mark i:nth-child(2) { background: var(--coral); }
.brand-mark i:nth-child(3) { background: #f3bd54; }
.brand-mark i:nth-child(4) { background: #78b5cb; }
.nav-links { display: flex; align-items: center; gap: 30px; margin-right: auto; font-size: 14px; font-weight: 650; }
.nav-links a, .nav-plain { opacity: .72; transition: opacity .2s; }
.nav-links a:hover, .nav-plain:hover { opacity: 1; }
.nav-plain, footer button, .text-link { border: 0; background: transparent; padding: 0; cursor: pointer; }
.account-actions { display: flex; gap: 10px; }
.editor-nav-context { display: none; min-width: 0; flex: 1; align-items: center; gap: 12px; }
.editor-nav-context h2 { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 20px/1.2 "STSong", "Songti SC", Georgia, serif; }
body.editor-mode .nav-links { display: none; }
body.editor-mode .editor-nav-context { display: flex; }
.btn { border: 0; border-radius: 10px; padding: 11px 18px; font-weight: 750; cursor: pointer; transition: transform .18s, box-shadow .18s, background .18s; }
.btn:hover { transform: translateY(-1px); }
.btn-dark { color: white; background: var(--ink); box-shadow: 0 8px 20px rgba(23,35,31,.18); }
.btn-dark:hover { background: #29453b; }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-light { background: white; border: 1px solid var(--line); }
.btn-danger { color: #963f38; background: #fff8f6; border: 1px solid #e8c4bf; }
.btn-danger:hover { background: #fff0ed; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.full, .full { width: 100%; }

.hero {
  min-height: 0;
  padding: clamp(34px, 5vw, 64px) clamp(20px, 6vw, 96px) clamp(48px, 6vw, 76px);
  display: grid;
  grid-template-columns: minmax(0, 680px);
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}
.hero::before { content: ""; position: absolute; width: 460px; height: 460px; border-radius: 50%; right: -160px; top: -190px; border: 80px solid rgba(185,231,208,.22); pointer-events: none; }
.hero::after { content: ""; position: absolute; width: 220px; height: 220px; left: -100px; bottom: -110px; background-image: radial-gradient(#2d6b54 1.6px, transparent 1.6px); background-size: 14px 14px; opacity: .11; }
.maker-card { position: relative; z-index: 1; }
.eyebrow, .kicker { font: 750 11px/1.4 ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--mint-dark); }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; background: rgba(185,231,208,.45); border: 1px solid rgba(45,107,84,.18); padding: 8px 12px; border-radius: 99px; }
.live-dot, .status-dot { width: 7px; height: 7px; border-radius: 50%; background: #46a777; box-shadow: 0 0 0 4px rgba(70,167,119,.14); }
h1 { font-family: "STSong", "Songti SC", Georgia, serif; font-size: clamp(54px, 6.3vw, 94px); line-height: .99; letter-spacing: -.055em; margin: 25px 0; font-weight: 900; }
h1 em { color: var(--mint-dark); font-style: normal; position: relative; }
h1 em::after { content: ""; position: absolute; height: 8px; left: 4px; right: 0; bottom: -5px; background: repeating-linear-gradient(90deg, var(--coral) 0 8px, transparent 8px 12px); opacity: .6; }
.hero-lede { max-width: 570px; color: var(--muted); font-size: 17px; line-height: 1.9; }
.trust-row { display: flex; align-items: center; gap: 16px; margin-top: 34px; color: var(--muted); font-size: 13px; }
.trust-row b { color: var(--ink); }
.trust-row i { width: 1px; height: 14px; background: var(--line); }

.maker-card { width: 100%; background: rgba(255,255,255,.86); border: 1px solid rgba(255,255,255,.75); padding: 28px; border-radius: 24px; box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.maker-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }
.step-label { color: var(--coral); font: 800 10px/1 ui-monospace, monospace; letter-spacing: .15em; }
.maker-head h2 { font-size: 22px; margin: 8px 0 0; }
.privacy-pill { padding: 6px 9px; border-radius: 99px; color: var(--mint-dark); background: #eaf7f0; font-size: 11px; font-weight: 700; }
.dropzone { min-height: 230px; border: 1.5px dashed #9faaa5; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; background: linear-gradient(135deg, rgba(185,231,208,.1), rgba(255,255,255,.4)); transition: border .2s, background .2s, transform .2s; }
.dropzone:hover, .dropzone.dragging { border-color: var(--mint-dark); background: #f1faf5; transform: translateY(-2px); }
.dropzone.disabled { cursor: not-allowed; opacity: .52; filter: grayscale(.25); border-color: #c9ccc9; background: #f1f1ed; transform: none; }
.dropzone.disabled .upload-button { background: #d8dad7; color: #7c827f; }
.dropzone.busy { cursor: wait; border-color: var(--mint-dark); background: #eef8f2; transform: none; }
.dropzone.busy .upload-glyph { animation: upload-pulse 1s ease-in-out infinite alternate; }
@keyframes upload-pulse { to { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(23,35,31,.28); } }
.upload-glyph { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; background: var(--ink); color: white; font-size: 27px; box-shadow: 0 8px 18px rgba(23,35,31,.18); margin-bottom: 4px; }
.dropzone strong { font-size: 17px; }
.dropzone > span:nth-of-type(2) { font-size: 12px; color: var(--muted); }
.upload-status { min-height: 34px; margin: 8px 0; padding: 8px 10px; border-radius: 9px; background: #f1f0ea; color: var(--muted); font-size: 10px; line-height: 1.55; }
.upload-status[data-tone="working"] { background: #eaf6ef; color: var(--mint-dark); }
.upload-status[data-tone="success"] { background: #e7f5ed; color: #246246; font-weight: 700; }
.upload-status[data-tone="error"] { background: #fff0ec; color: #a04430; font-weight: 700; }
.upload-progress { display: grid; grid-template-columns: minmax(0, 1fr) 38px; align-items: center; gap: 9px; margin: 7px 2px 10px; color: var(--mint-dark); }
.upload-progress-track { height: 9px; overflow: hidden; border-radius: 99px; background: #dfe4e0; box-shadow: inset 0 1px 2px rgba(23,35,31,.12); }
.upload-progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint-dark), #55ad83); transition: width .35s ease; }
.upload-progress > b { font-size: 10px; text-align: right; font-variant-numeric: tabular-nums; }
.upload-progress[data-tone="error"] { color: #a04430; }
.upload-progress[data-tone="error"] .upload-progress-track i { background: #c45d45; }
.upload-progress[data-tone="success"] .upload-progress-track i { background: #2d8a61; }
.generation-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 3px 0 14px; }
.generation-mode button { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 9px; border: 1px solid var(--line); border-radius: 12px; background: white; padding: 12px; text-align: left; cursor: pointer; }
.generation-mode button > span { grid-row: 1 / 3; align-self: center; min-width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; background: #ecebe5; color: var(--muted); font: 900 10px ui-monospace, monospace; }
.generation-mode button b { font-size: 12px; }
.generation-mode button small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.generation-mode button.active { border-color: var(--mint-dark); background: #eef8f2; box-shadow: 0 0 0 3px rgba(45,107,84,.08); }
.generation-mode button.active > span { background: var(--mint); color: var(--mint-dark); }
.ai-subject-select { display: grid; gap: 9px; margin: 12px 0; padding: 12px; border: 1px solid #d9d1ef; border-radius: 14px; background: #fbf9ff; }
.ai-classification-preview { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 12px; align-items: stretch; padding: 10px; border: 1px solid #d9d1ef; border-radius: 12px; background: white; }
.ai-classification-preview figure { margin: 0; height: 112px; overflow: hidden; border-radius: 10px; background: #f2f1ec; }
.ai-classification-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ai-classification-preview > div { min-width: 0; display: grid; align-content: center; gap: 5px; }
.ai-classification-preview > div > b { color: var(--ink); font-size: 14px; }
.ai-classification-preview p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.ai-detected-result { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 7px; }
.ai-detected-result strong { padding: 5px 9px; border-radius: 99px; background: #dff2e8; color: var(--mint-dark); font-size: 11px; }
.ai-detected-result > span { color: #5c497e; font-size: 9px; font-weight: 800; }
.ai-detected-result small { flex-basis: 100%; color: var(--muted); font-size: 9px; }
.ai-manual-toggle { width: max-content; min-height: 32px; padding: 0; border: 0; background: transparent; color: var(--mint-dark); font: inherit; font-size: 9px; font-weight: 800; text-decoration: underline; cursor: pointer; }
#aiManualCategoryWrap { display: grid; gap: 7px; }
.ai-classification-confirm, .ai-generation-next { width: 100%; min-height: 46px; font-size: 13px; }
.ai-subject-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ai-subject-heading b { color: var(--ink); font-size: 12px; }
.ai-subject-heading small { color: var(--muted); font-size: 9px; }
.ai-subject-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.ai-subject-cards button { min-height: 88px; display: grid; place-items: center; align-content: center; gap: 3px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink); cursor: pointer; }
.ai-subject-cards button > span { font-size: 18px; line-height: 1; }
.ai-subject-cards button > b { font-size: 11px; }
.ai-subject-cards button > small { color: var(--muted); font-size: 8px; }
.ai-subject-cards button.active { border-color: var(--mint-dark); background: #eaf7f0; box-shadow: 0 0 0 3px rgba(45,107,84,.09); }
.pet-type-select { display: grid; gap: 7px; padding: 9px 10px; border: 1px solid #d9d1ef; border-radius: 10px; background: white; }
.pet-type-select > div:first-child { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.pet-type-select > div:first-child b { font-size: 10px; }
.pet-type-select > div:first-child small { color: var(--muted); font-size: 8px; }
.pet-type-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pet-type-cards button { min-height: 48px; display: flex; justify-content: center; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 9px; background: #faf9f5; color: var(--ink); cursor: pointer; }
.pet-type-cards button span { font-size: 18px; }
.pet-type-cards button b { font-size: 10px; }
.pet-type-cards button.active { border-color: var(--mint-dark); background: #eaf7f0; box-shadow: 0 0 0 3px rgba(45,107,84,.08); }
.pet-feature-description { display: grid; gap: 6px; padding: 9px 10px; border: 1px dashed #b7cfc4; border-radius: 10px; background: #f5fbf8; }
.pet-feature-description > span { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pet-feature-description b { color: var(--ink); font-size: 10px; }
.pet-feature-description small { color: var(--muted); font-size: 8px; }
.pet-feature-description input { width: 100%; min-height: 36px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font: inherit; font-size: 11px; outline: none; }
.pet-feature-description input:focus { border-color: var(--mint-dark); box-shadow: 0 0 0 3px rgba(45,107,84,.1); }
.person-style-select { display: grid; gap: 8px; padding: 9px; border: 1px solid #c5d9cf; border-radius: 12px; background: #f5fbf8; }
.person-style-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.person-style-heading b { color: var(--ink); font-size: 11px; }
.person-style-heading small { color: var(--muted); font-size: 8px; }
.person-style-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.person-style-cards button { min-width: 0; min-height: 82px; display: grid; grid-template-columns: 66px minmax(0, 1fr); align-items: center; gap: 8px; padding: 7px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink); text-align: left; cursor: pointer; }
.person-style-cards button > span:last-child { min-width: 0; display: grid; gap: 3px; }
.person-style-cards button b { font-size: 10px; line-height: 1.25; }
.person-style-cards button small { color: var(--muted); font-size: 7px; line-height: 1.35; }
.person-style-cards button.active { border-color: var(--mint-dark); background: #eaf7f0; box-shadow: 0 0 0 3px rgba(45,107,84,.09); }
.person-style-preview { position: relative; width: 64px; height: 64px; overflow: hidden; display: block; border: 1px solid #d9ddd8; border-radius: 10px; background: #fff; }
.person-style-preview::before { content: ""; position: absolute; z-index: 2; left: 50%; top: 9px; width: 31px; height: 34px; translate: -50% 0; border: 3px solid #26332e; border-radius: 48% 48% 45% 45%; background: #f7c9aa; box-sizing: border-box; }
.person-style-preview::after { content: "••"; position: absolute; z-index: 3; left: 50%; top: 19px; translate: -50% 0; color: #26332e; font: 900 11px/1 monospace; letter-spacing: 7px; white-space: nowrap; }
.person-style-preview i { position: absolute; z-index: 4; left: 50%; top: 35px; width: 9px; height: 4px; translate: -50% 0; border-bottom: 2px solid #26332e; border-radius: 50%; }
.person-style-preview em { position: absolute; z-index: 1; left: 50%; bottom: -12px; width: 43px; height: 35px; translate: -50% 0; border: 3px solid #26332e; border-radius: 15px 15px 0 0; background: #78bca1; box-sizing: border-box; }
.preview-flat { background: #fff; }
.preview-flat::before { box-shadow: inset 0 8px 0 #3c2c2a; }
.preview-pixel { border-radius: 3px; background-image: linear-gradient(90deg, rgba(38,51,46,.07) 1px, transparent 1px), linear-gradient(rgba(38,51,46,.07) 1px, transparent 1px); background-size: 8px 8px; image-rendering: pixelated; }
.preview-pixel::before, .preview-pixel em { border-radius: 2px; box-shadow: 3px 0 0 #26332e, -3px 0 0 #26332e; }
.preview-chibi::before { top: 5px; width: 39px; height: 41px; box-shadow: inset 0 9px 0 #563c34; }
.preview-chibi::after { top: 19px; }
.preview-chibi i { top: 36px; }
.preview-chibi em { width: 34px; height: 26px; background: #e9a875; }
.preview-handdrawn { background: linear-gradient(145deg, #fff 55%, #f3f8f5); }
.preview-handdrawn::before, .preview-handdrawn em { border-color: #53645d; border-width: 2px; }
.preview-handdrawn::before { box-shadow: inset 0 7px 0 #6b5146; }
.preview-handdrawn em { background: #a8cabd; }
.ai-subject-hint { margin: 0; color: #b34d42; font-size: 10px; font-weight: 800; text-align: center; }
.ai-subject-hint.ready { color: var(--mint-dark); }
.ai-cost-notice { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 8px; padding: 8px 10px; border-radius: 9px; background: #f1ecff; color: #5c497e; font-size: 9px; }
.subject-card-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #edf6f1; color: var(--mint-dark); font-weight: 900; }
.ai-mixed-notice { margin: 0; padding: 9px 11px; border-radius: 10px; background: #fff2df; color: #8a5a19; font-size: 11px; font-weight: 750; }
.ai-style-step { display: grid; gap: 10px; margin-top: 4px; padding-top: 12px; border-top: 1px solid #ddd7ed; }
.ai-style-step-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ai-style-step-head h3 { margin: 5px 0 0; font-size: 17px; }
.ai-style-context { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 10px; background: white; border: 1px solid var(--line); }
.ai-style-context img { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; background: #f3f2ed; }
.ai-style-context span { min-width: 0; color: var(--mint-dark); font-size: 11px; font-weight: 800; }
.style-card-media { position: relative; width: 64px; height: 64px; overflow: hidden; display: grid; place-items: center; border: 1px solid #d9ddd8; border-radius: 10px; background: linear-gradient(145deg, #fff, #edf6f1); }
.style-card-media img { width: 100%; height: 100%; display: block; object-fit: contain; padding: 5px; }
.style-card-media.missing img { display: none; }
.style-card-media::after { content: "预览图"; display: none; padding: 8px; color: var(--muted); font-size: 8px; font-weight: 750; text-align: center; }
.style-card-media.missing::after { display: block; }
.style-card-check { position: absolute; z-index: 2; right: 5px; top: 5px; width: 20px; height: 20px; display: none; place-items: center; border-radius: 50%; color: white; background: var(--mint-dark); font-size: 12px; }
.person-style-cards button.active .style-card-check { display: grid; }
.person-style-cards button:focus-visible, .ai-subject-cards button:focus-visible, .pet-type-cards button:focus-visible { outline: 3px solid rgba(45,107,84,.25); outline-offset: 2px; }
.classification-stats { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.classification-stats > div { min-width: 0; display: grid; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #faf9f5; }
.classification-stats small { color: var(--muted); font-size: 9px; }
.classification-stats b { font-size: 14px; }
.upload-button { margin-top: 10px; background: var(--mint); color: #244e3e; border-radius: 8px; padding: 9px 18px; font-size: 13px; font-weight: 800; }
.or { display: flex; align-items: center; color: #98a09d; font-size: 11px; margin: 17px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.or span { margin: 0 13px; }
.blank-action { border: 0; width: 100%; padding: 13px; display: flex; align-items: center; gap: 13px; border-radius: 12px; background: #f4f2ea; text-align: left; cursor: pointer; }
.blank-action:hover { background: #ece9df; }
.blank-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: #fff; color: var(--coral); }
.blank-action > span:nth-child(2) { display: flex; flex-direction: column; gap: 3px; }
.blank-action small { color: var(--muted); }
.blank-action b:last-child { margin-left: auto; }

.section-wrap { max-width: 1440px; margin: 0 auto; padding: 100px clamp(20px, 4vw, 64px); }
.workspace { display: none; padding-top: 10px; }
body.editor-mode .hero,
body.editor-mode .membership,
body.editor-mode .workflow,
body.editor-mode footer { display: none; }
body.editor-mode .workspace { display: block; }
body.editor-mode .floating-service { display: none; }

.editor-emergency-nav { display: none; }
body.editor-mode .editor-emergency-nav {
  position: fixed;
  z-index: 2200;
  top: max(6px, env(safe-area-inset-top, 0px));
  left: max(6px, env(safe-area-inset-left, 0px));
  gap: 5px;
  pointer-events: none;
}
body.editor-mode .editor-emergency-nav button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid rgba(73,48,86,.18);
  border-radius: 10px;
  background: rgba(255,252,248,.94);
  color: #4f395e;
  box-shadow: 0 5px 16px rgba(49,34,58,.14);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  pointer-events: auto;
  backdrop-filter: blur(9px);
}
body.editor-mode:not(.canvas-fullscreen) .editor-emergency-nav { display: none; }
body.canvas-fullscreen .editor-emergency-nav { display: flex; }
body.editor-mode { -webkit-text-size-adjust: 100%; }

@media (max-width: 720px) {
  body.editor-mode:not(.canvas-fullscreen) .editor-emergency-nav.is-needed { display: flex; }
}
.editor-layout-bar { min-height: 50px; margin: 0 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 7px 9px 7px 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.94); box-shadow: 0 8px 26px rgba(26,45,38,.06); }
.editor-layout-copy { min-width: 0; display: grid; gap: 2px; }
.editor-layout-copy b { font-size: 12px; }
.editor-layout-copy small { overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 9px; white-space: nowrap; }
.editor-layout-switch { flex: none; display: inline-grid; grid-template-columns: repeat(3, auto); gap: 3px; padding: 3px; border-radius: 11px; background: #eeece5; }
.editor-layout-switch button { min-height: 36px; border: 0; border-radius: 8px; padding: 6px 12px; background: transparent; color: #65716c; font-size: 11px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.editor-layout-switch button.active { background: #fff; color: var(--mint-dark); box-shadow: 0 2px 8px rgba(23,35,31,.12); }
.workspace-top { display: flex; align-items: center; gap: 22px; margin-bottom: 18px; }
.conversion-source-bar { display: flex; align-items: center; gap: 9px; margin: -7px 0 10px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 11px; background: #f7f6f0; }
.conversion-source-bar > span { color: var(--muted); font-size: 10px; font-weight: 800; }
.conversion-source-bar > b { padding: 5px 9px; border-radius: 99px; background: #e6e5df; font-size: 11px; }
.conversion-source-bar[data-source="ai"] { border-color: #b7a6e8; background: #f4efff; }
.conversion-source-bar[data-source="ai"] > b { color: #5d429f; background: #e3d8ff; }
.conversion-source-bar[data-source="original"] { border-color: #9ccab4; background: #edf8f2; }
.conversion-source-bar[data-source="original"] > b { color: var(--mint-dark); background: #d9efe4; }
.back-home { flex: none; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 10px; background: white; font-weight: 750; cursor: pointer; }
.editor-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.editor-title h2 { margin: 0; font: 800 24px/1.25 "STSong", "Songti SC", Georgia, serif; white-space: nowrap; }
.editor-title p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 40px; margin-bottom: 34px; }
.section-heading h2 { font-family: "STSong", "Songti SC", Georgia, serif; font-size: clamp(34px, 4vw, 54px); letter-spacing: -.035em; margin: 8px 0 0; }
.section-heading > p { max-width: 390px; color: var(--muted); line-height: 1.75; font-size: 14px; }
.editor-shell { width: 100%; min-width: 0; display: grid; grid-template-columns: 245px minmax(430px, 1fr) 245px; background: white; border-radius: 20px; border: 1px solid var(--line); overflow: hidden; box-shadow: 0 18px 60px rgba(26,45,38,.09); }
.tool-panel, .count-panel { padding: 24px 20px; background: #fbfaf7; }
.tool-panel { border-right: 1px solid var(--line); }
.count-panel { border-left: 1px solid var(--line); }
.panel-group { padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.panel-group:last-child { border: 0; margin: 0; }
.panel-group label, .panel-title { display: flex; justify-content: space-between; font-weight: 750; font-size: 13px; margin-bottom: 15px; }
.panel-group output { color: var(--mint-dark); font-size: 12px; }
input[type="range"] { width: 100%; accent-color: var(--mint-dark); }
.range-labels { display: flex; justify-content: space-between; color: #9ba29f; font: 10px ui-monospace, monospace; }
.pattern-size-summary { flex: 1; max-width: 340px; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, .75fr); gap: 7px; margin: 0; padding: 6px 9px; border: 1px solid #d8e8e1; border-radius: 11px; background: #f1f8f5; }
.pattern-size-summary span { min-width: 0; display: grid; gap: 3px; }
.pattern-size-summary span:last-child { justify-items: end; text-align: right; }
.pattern-size-summary b { overflow: hidden; text-overflow: ellipsis; color: #234c3f; font-size: 11px; white-space: nowrap; }
.pattern-size-summary small { overflow: hidden; text-overflow: ellipsis; color: #6d827b; font-size: 8px; white-space: nowrap; }
.board-size-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.board-size-heading > label { margin: 0; font-size: 13px; white-space: nowrap; }
.board-effect-pills { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.board-canvas-size { min-width: 0; display: flex; align-items: baseline; gap: 5px; color: #315e4f; white-space: nowrap; }
.board-canvas-size small { color: #71817b; font-size: 9px; font-weight: 750; }
.board-canvas-size b { font-size: 11px; }
.board-canvas-size em { color: #8b6372; font-size: 9px; font-style: normal; font-weight: 800; }
.board-effect-actions { display: flex; justify-content: flex-end; gap: 5px; }
.board-effect-pills button { min-height: 32px; border: 1px solid #d7e5df; border-radius: 999px; padding: 5px 10px; background: #edf6f2; color: #376557; font-size: 9px; font-weight: 800; cursor: pointer; }
.board-effect-actions button:nth-child(2) { background: #f1eef9; border-color: #ded6ee; color: #65527e; }
.board-effect-actions button:nth-child(3) { background: #fff1ed; border-color: #f0d8d1; color: #945846; }
.board-effect-pills button.active { border-color: #2f7a62; background: #2f7a62; color: #fff; box-shadow: 0 3px 8px rgba(47,122,98,.16); }
.board-range-control { display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; align-items: center; gap: 8px; margin: 4px 0 12px; }
.board-range-control > button { width: 42px; height: 42px; border: 1px solid #d8d4ce; border-radius: 50%; background: #fff; color: #4b313b; font-size: 24px; line-height: 1; cursor: pointer; }
.board-range-track { position: relative; min-width: 0; padding-top: 21px; }
.board-range-track > output { --size-progress: .2778; position: absolute; z-index: 2; top: -4px; left: calc(17px + var(--size-progress) * (100% - 34px)); min-width: 34px; height: 34px; display: grid; place-items: center; transform: translateX(-50%); border: 2px solid #285e4d; border-radius: 12px; background: #8fd0b5; color: #163d31; font-size: 13px; font-weight: 900; box-shadow: 0 3px 0 rgba(40,94,77,.16); pointer-events: none; }
.board-range-track input[type="range"] { display: block; height: 24px; margin: 0; accent-color: #3b9677; }
.board-range-track .range-labels { margin-top: -1px; display: grid; grid-template-columns: auto 1fr 1fr auto; gap: 4px; font-size: 8px; }
.board-range-track .range-labels span:nth-child(2) { text-align: left; }
.board-range-track .range-labels span:nth-child(3) { text-align: right; }
.board-size-shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: -3px 0 12px; }
.board-size-shortcuts button { min-height: 42px; display: grid; place-content: center; gap: 1px; border: 1px solid #e4ddd8; border-radius: 10px; background: #fff; color: #4d3a42; cursor: pointer; }
.board-size-shortcuts b { font-size: 11px; }
.board-size-shortcuts small { color: #8d8582; font-size: 8px; font-weight: 700; }
.board-size-shortcuts button.active { border-color: #2f7a62; background: #e7f5ee; color: #245b48; box-shadow: inset 0 0 0 1px rgba(47,122,98,.12); }
.board-size-shortcuts button.active small { color: #2f7a62; }
.board-compact-settings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid #e6e2dc; border-radius: 12px; background: #e6e2dc; }
.board-compact-settings > label, .board-compact-settings > button { min-width: 0; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 4px; border: 0; padding: 6px 5px; background: #f7f7f5; color: #3b2630; text-align: center; cursor: pointer; }
.board-compact-settings small { flex: none; color: #8a8084; font-size: 9px; }
.board-compact-settings b { overflow: hidden; text-overflow: ellipsis; font-size: 10px; white-space: nowrap; }
.board-compact-settings i { flex: none; font-style: normal; font-size: 10px; }
.board-compact-settings select { min-width: 0; max-width: 74px; border: 0; padding: 0 14px 0 0; background-color: transparent; color: #3b2630; font-size: 10px; font-weight: 850; outline: 0; }
#openColorSettings { background: #f2eef9; color: #604d79; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
.palette-settings { padding-bottom: 0; }
.palette-settings > summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; cursor: pointer; font-size: 13px; font-weight: 800; }
.palette-settings > summary::-webkit-details-marker, .materials-details > summary::-webkit-details-marker { display: none; }
.palette-settings > summary::after { content: "展开"; color: var(--mint-dark); font-size: 11px; }
.palette-settings[open] > summary::after { content: "收起"; }
.palette-settings > summary b { margin-left: auto; color: var(--muted); font-size: 11px; }
.palette-settings-body { padding: 14px 0 18px; border-top: 1px solid var(--line); }
.palette-brand-field { min-width: 0; margin-bottom: 14px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.palette-brand-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.palette-brand-head small { color: var(--mint-dark); font-size: 11px; font-weight: 800; white-space: nowrap; }
.palette-brand-options { display: flex; min-width: 0; gap: 7px; overflow-x: auto; padding: 2px 1px 6px; scrollbar-width: thin; overscroll-behavior-x: contain; }
.palette-brand-options button { flex: 0 0 auto; min-height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 750; cursor: pointer; }
.palette-brand-options button.active { border-color: var(--mint-dark); background: var(--mint-pale); color: var(--mint-dark); box-shadow: inset 0 0 0 1px var(--mint-dark); }
.palette-brand-field p { margin: 2px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.color-settings-trigger { width: 100%; min-height: 46px; margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 11px; padding: 8px 11px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.color-settings-trigger span { min-width: 0; display: grid; gap: 3px; }
.color-settings-trigger b { font-size: 12px; }
.color-settings-trigger small { overflow: hidden; text-overflow: ellipsis; color: var(--mint-dark); font-size: 9px; white-space: nowrap; }
.color-settings-trigger i { color: var(--mint-dark); font: normal 800 24px/1 system-ui, sans-serif; }
.merge-range-label { margin: 15px 0 8px !important; }
.color-fidelity-hint { display: block; margin-top: 7px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.color-diagnostics { padding-bottom: 0; }
.color-diagnostics > summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; list-style: none; cursor: pointer; font-size: 12px; font-weight: 800; }
.color-diagnostics > summary::-webkit-details-marker { display: none; }
.color-diagnostics > summary b { color: var(--mint-dark); font-size: 9px; text-align: right; }
.color-diagnostics-body { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 12px 0 16px; border-top: 1px solid var(--line); }
.color-diagnostic-column { min-width: 0; }
.color-diagnostic-column > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 800; }
.color-diagnostic-list { display: grid; gap: 5px; }
.color-diagnostic-list > small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.color-diagnostic-item { min-width: 0; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 6px; align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.color-diagnostic-item i { width: 16px; height: 16px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.color-diagnostic-item span { min-width: 0; display: grid; gap: 1px; }
.color-diagnostic-item b { overflow: hidden; text-overflow: ellipsis; color: var(--ink); font: 8px/1.2 ui-monospace, monospace; }
.color-diagnostic-item em { overflow: hidden; text-overflow: ellipsis; color: var(--muted); font: normal 7px/1.2 ui-monospace, monospace; }
.color-diagnostics-body > p { grid-column: 1 / -1; margin: 2px 0 0; padding: 8px; border-radius: 8px; background: #eef7f1; color: var(--mint-dark); font-size: 9px; line-height: 1.55; }
.color-diagnostic-sizes { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.color-diagnostic-sizes span { padding: 6px 2px; border-radius: 6px; background: #f3f2ec; color: var(--muted); text-align: center; font-size: 7px; font-weight: 800; }
.color-diagnostic-sizes span.ok { background: #e8f5ed; color: var(--mint-dark); }
.color-diagnostic-sizes span.warn { background: #fff1e7; color: #a65028; }
.render-setting-card { min-width: 0; }
.render-setting-card label { margin-bottom: 8px; }
.enhance-group select { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: white; padding: 10px; font-size: 11px; outline: 0; }
.enhance-group .sub-setting-label { display: block; margin-top: 12px; }
.enhance-action { width: 100%; margin-top: 9px; border: 1px solid rgba(45,107,84,.22); border-radius: 9px; background: #eaf6ef; color: var(--mint-dark); padding: 10px; display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; }
.enhance-action > span:first-child { font-size: 17px; }
.enhance-action > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.enhance-action b { font-size: 11px; }
.enhance-action small { font-size: 8px; opacity: .72; }
.enhance-action.active { background: var(--mint-dark); color: white; }
.enhance-action.ai-enhance { border-color: rgba(119, 79, 171, .28); background: #f2ecfb; color: #684394; }
.enhance-action.ai-enhance > span:first-child { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: #684394; color: white; font: 800 9px/1 ui-monospace, monospace; }
.enhance-action.ai-enhance:disabled { cursor: wait; opacity: .68; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool { border: 1px solid var(--line); background: white; border-radius: 9px; padding: 11px 6px; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; cursor: pointer; }
.tool span { font-size: 16px; }
.tool.active { border-color: var(--mint-dark); color: var(--mint-dark); background: #eef8f2; font-weight: 750; }
.palette { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; max-height: 132px; padding: 2px 4px 2px 2px; overflow-y: auto; scrollbar-width: thin; }
.swatch { aspect-ratio: 1; border: 2px solid white; box-shadow: 0 0 0 1px rgba(0,0,0,.1); border-radius: 50%; cursor: pointer; position: relative; }
.swatch.active::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: white; font-size: 11px; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.selected-color { display: flex; gap: 10px; align-items: center; margin-top: 15px; padding: 10px; border-radius: 9px; background: white; border: 1px solid var(--line); }
.selected-color > span { width: 30px; height: 30px; border-radius: 8px; background: var(--coral); }
.selected-color div { display: flex; flex-direction: column; gap: 2px; }
.selected-color small { color: var(--muted); font-size: 9px; }
.selected-color b { font-size: 11px; }
.compact { padding: 0; }

.canvas-column { width: 100%; min-width: 0; max-width: 100%; background: #e7e8e1; overflow: hidden; }
.canvas-toolbar, .canvas-foot { min-height: 48px; padding: 5px 12px; display: flex; align-items: center; justify-content: space-between; background: white; }
.canvas-primary-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 14px; background: white; border-bottom: 1px solid var(--line); }
.canvas-primary-actions .btn { width: 100%; min-height: 44px; padding: 10px 12px; font-size: 14px; }
.canvas-primary-actions .ios-download-note { grid-column: 1 / -1; margin: 0; text-align: center; }
.editor-bottom-tools { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); background: #f7f6f0; }
.editor-bottom-tools .tool-grid { display: flex; min-width: 0; gap: 6px; overflow-x: auto; scrollbar-width: thin; }
.editor-bottom-tools .tool { flex: 1 0 74px; min-height: 44px; padding: 8px 7px; white-space: nowrap; }
.editor-tools-label { color: var(--muted); font-size: 10px; white-space: nowrap; }
.canvas-toolbar { border-bottom: 1px solid var(--line); }
.canvas-toolbar b { font-size: 12px; }
.canvas-toolbar-actions { width: 100%; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.canvas-source-label { min-width: 0; margin-right: auto; display: inline-flex; align-items: center; gap: 6px; }
.canvas-source-label b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canvas-palette-toggle { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #cfe2da; border-radius: 9px; padding: 0 9px; background: #eef7f3; color: #275c4b; font-size: 10px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.canvas-palette-toggle i { width: 15px; height: 15px; flex: none; border: 2px solid #fff; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 1px rgba(23,35,31,.18); }
.zoom-controls { display: flex; align-items: center; gap: 4px; }
.zoom-controls button { border: 1px solid var(--line); background: #faf9f5; min-width: 30px; height: 30px; border-radius: 7px; cursor: pointer; }
.zoom-controls output { min-width: 52px; text-align: center; font: 11px ui-monospace, monospace; }
.zoom-controls .reset-zoom { padding: 0 10px; font-size: 10px; }
.zoom-controls .fullscreen-canvas { padding: 0 9px; font-size: 10px; background: #173d31; color: #fff; border-color: #173d31; }
.display-strip { min-height: 44px; padding: 3px 6px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; gap: 4px; background: white; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 11px; }
.display-row { display: contents; }
.display-strip label { min-width: 0; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 3px; border-radius: 7px; background: #f4f2ea; cursor: pointer; font-weight: 700; white-space: nowrap; }
.display-strip input { accent-color: var(--mint-dark); }
.canvas-viewport { width: 100%; height: 590px; display: block; overflow: hidden; position: relative; touch-action: none; user-select: none; background-image: radial-gradient(rgba(23,35,31,.11) 1px, transparent 1px); background-size: 16px 16px; }
.pinch-tip { display: none; position: absolute; z-index: 2; top: 12px; left: 50%; transform: translateX(-50%); padding: 6px 10px; border-radius: 99px; background: rgba(23,35,31,.78); color: white; font-size: 9px; pointer-events: none; }
.bead-grid { width: 100%; height: 100%; display: block; background: #e7e8e1; border: 0; box-shadow: none; cursor: crosshair; contain: layout paint style; image-rendering: auto; }
.canvas-foot { min-height: 68px; border-top: 1px solid var(--line); }
.canvas-foot span { color: var(--muted); font-size: 11px; }
.canvas-foot-actions { display: flex; gap: 8px; }
.ios-download-note { display: block; flex-basis: 100%; margin-top: 7px; color: var(--muted); font-size: 9px; line-height: 1.5; }

.more-tools-panel { grid-column: 1 / -1; padding: 7px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.more-tools-panel .tool { width: 100%; min-height: 44px; }
.more-tools-panel[hidden] { display: none !important; }
.source-layer-opacity { width: 100%; min-height: 44px; padding: 6px 10px; display: grid; grid-template-columns: auto minmax(80px, 1fr) 42px; align-items: center; gap: 9px; color: var(--ink); font-size: 13px; }
.source-layer-opacity input { width: 100%; min-width: 0; accent-color: #8d67b8; }
.source-layer-opacity b { text-align: right; color: #75519f; font-variant-numeric: tabular-nums; }

.materials-details > summary { list-style: none; cursor: pointer; }
.count-head { display: grid; grid-template-columns: 1fr auto; justify-content: space-between; align-items: center; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.count-head h3 { margin: 3px 0 0; font-size: 19px; }
.count-head > span { border-radius: 99px; background: var(--ink); color: white; padding: 6px 9px; font-size: 9px; }
.materials-toggle-label { grid-column: 1 / -1; min-height: 36px; display: grid; place-items: center; border-radius: 8px; background: white; border: 1px solid var(--line); color: var(--mint-dark); font-size: 11px; }
.materials-toggle-label::before { content: "查看完整清单"; }
.materials-details[open] .materials-toggle-label::before { content: "收起清单"; }
.materials-body { padding-top: 6px; }
.materials-meta { margin-bottom: 8px; color: var(--mint-dark); font-size: 11px; font-weight: 800; }
.materials-export-actions { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 7px; margin-top: 10px; }
.materials-export-actions .full-link { min-height: 42px; padding: 8px; justify-content: center; font-size: 11px; }

.palette-switch-modal { width: min(440px, calc(100vw - 24px)); }
.palette-switch-modal > p { margin: 12px 0; color: var(--muted); line-height: 1.75; }
.palette-switch-modal > small { display: block; margin-bottom: 16px; color: var(--mint-dark); font-weight: 800; }
.palette-switch-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.palette-picker-modal { width: min(520px, calc(100vw - 20px)); max-height: min(88vh, 88dvh); overflow: auto; padding: 24px 22px calc(20px + env(safe-area-inset-bottom, 0px)); border-radius: 22px; background: #f8fbfa; overscroll-behavior: contain; }
.palette-picker-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.palette-picker-head h2 { margin: 5px 0 0; font-size: 25px; }
.palette-picker-head output { padding: 6px 10px; border-radius: 999px; background: #dcefe7; color: #285e4d; font-size: 11px; font-weight: 850; }
.palette-picker-modal .palette-brand-field { margin-bottom: 12px; padding: 9px 11px; border: 1px solid #dbe9e3; border-radius: 11px; background: #fff; }
.palette-picker-modal .palette-brand-head { margin: 0; }
.palette-picker-modal .palette { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 9px; max-height: 42dvh; padding: 4px; }
.palette-picker-modal .selected-color { display: flex; }
.palette-picker-done { width: 100%; min-height: 48px; margin-top: 14px; }
.color-settings-modal { width: min(720px, calc(100vw - 24px)); max-height: min(92vh, 92dvh); overflow-x: hidden; overflow-y: auto; padding: 30px 30px calc(24px + env(safe-area-inset-bottom, 0px)); border: 1px solid #d5e7df; border-radius: 24px; background: #f7fbf9; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.color-settings-modal h2 { margin: 0 0 20px; color: #183f33; font-size: 26px; }
.color-settings-section { padding: 19px 0; border-top: 1px solid #dce9e4; }
.color-settings-section:first-of-type { padding-top: 7px; border-top: 0; }
.color-settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.color-settings-heading b { color: #315f50; font-size: 16px; }
.color-settings-heading small { color: #7b9189; font-size: 11px; }
.color-settings-tier-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
.color-settings-brand-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.color-settings-brand-grid button, .color-settings-tier-grid button, .color-settings-fidelity button { min-height: 58px; border: 1px solid #d9e6e1; border-radius: 15px; background: #fff; color: #3d5e53; font-size: 14px; font-weight: 850; cursor: pointer; }
.color-settings-brand-grid button.active { border-color: #286d57; background: #286d57; color: #fff; box-shadow: 0 6px 14px rgba(40,109,87,.16); }
.color-settings-tier-grid button.active { border-color: #e78c75; background: #fff0ec; color: #874835; box-shadow: inset 0 0 0 1px rgba(231,140,117,.18); }
.color-settings-fidelity button.active { border-color: #8a76a8; background: #eee9f7; color: #58456f; box-shadow: inset 0 0 0 1px rgba(138,118,168,.14); }
.color-settings-tier-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.color-settings-section > p { margin: 8px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.color-settings-fidelity { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.color-settings-fidelity button { display: grid; align-content: center; gap: 3px; padding: 8px 5px; }
.color-settings-fidelity button b { font-size: 12px; }
.color-settings-fidelity button small { color: var(--muted); font-size: 8px; }
.color-settings-fidelity button.active small { color: rgba(88,69,111,.72); }
.color-settings-limit { margin-top: 12px; padding: 11px; border: 1px solid #d9e6e1; border-radius: 11px; background: #fff; }
.color-settings-limit label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 11px; font-weight: 800; }
.color-settings-limit output { color: var(--mint-dark); font-size: 10px; }
.color-settings-limit.is-disabled { opacity: .52; }
.color-settings-note { margin: 0 0 15px !important; padding: 10px 11px; border-radius: 10px; background: #eaf4f0; color: #527367 !important; font-size: 9px !important; }
.color-settings-actions { position: sticky; bottom: calc(-24px - env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: 1fr; margin: 0; padding: 14px 0 calc(4px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, rgba(247,251,249,0), #f7fbf9 24%); }
.color-settings-actions .btn { min-height: 58px; font-size: 17px; }
.color-settings-confirm { border: 0; border-radius: 18px; background: #245f4d; color: #fff; font-weight: 900; cursor: pointer; box-shadow: 0 10px 24px rgba(36,95,77,.2); }

.palette-admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.palette-admin-grid section { display: grid; gap: 10px; align-content: start; min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #faf9f4; }
.palette-admin-grid h4 { margin: 0; font-size: 15px; }
.palette-admin-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.palette-admin-grid input, .palette-admin-grid select { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--ink); font-size: 13px; }
.palette-admin-grid small { color: var(--muted); font-size: 10px; line-height: 1.55; }
.count-list { padding: 14px 0; }
.count-row { width: 100%; display: grid; grid-template-columns: 19px 1fr auto; align-items: center; gap: 9px; padding: 7px 6px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: inherit; text-align: left; font-size: 10px; cursor: pointer; }
.count-row:hover { background: #f3f0f8; }
.count-row.active { border-color: #9a76c7; background: #f1eaff; box-shadow: 0 0 0 2px rgba(154,118,199,.1); }
.count-row i { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 -1px 2px rgba(0,0,0,.2); }
.count-row b { font-weight: 700; }
.count-row span:last-child { color: var(--muted); font: 10px ui-monospace, monospace; }
.full-link { width: 100%; display: flex; justify-content: space-between; border: 1px solid var(--line); background: white; border-radius: 8px; padding: 10px; font-size: 11px; font-weight: 700; cursor: pointer; }
.save-note { display: flex; gap: 9px; margin-top: 18px; padding: 13px; border-radius: 10px; background: #eaf6ef; color: var(--mint-dark); }
.save-note > span { font-size: 20px; }
.save-note div { display: flex; flex-direction: column; gap: 5px; }
.save-note b { font-size: 11px; }
.save-note small { line-height: 1.55; font-size: 9px; }

.compact-heading { margin-bottom: 26px; }
.text-link { color: var(--mint-dark); font-weight: 750; cursor: pointer; }
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.work-card, .new-work { min-height: 270px; border: 1px solid var(--line); border-radius: 16px; background: white; padding: 14px; }
.work-card { position: relative; }
.work-card > div:nth-child(2) { display: flex; flex-direction: column; gap: 4px; margin-top: 13px; }
.work-card span, .work-card > small, .new-work small { color: var(--muted); font-size: 11px; }
.work-card > small { position: absolute; right: 14px; bottom: 20px; }
.mini-pattern { height: 190px; border-radius: 11px; background-color: #e8eee9; background-size: 13px 13px; image-rendering: pixelated; }
.pattern-cat { background-image: linear-gradient(45deg, rgba(255,255,255,.18) 25%, transparent 25%), radial-gradient(circle at 50% 45%, #e88458 0 16%, transparent 17%), radial-gradient(circle at 42% 43%, #263a32 0 2%, transparent 2.5%), radial-gradient(circle at 58% 43%, #263a32 0 2%, transparent 2.5%), radial-gradient(circle at 50% 53%, #f5c4a8 0 4%, transparent 4.5%), linear-gradient(135deg, #c9e6d6, #f0d9bd); }
.pattern-flower { background-image: radial-gradient(circle at 50% 36%, #f07770 0 12%, transparent 12.5%), radial-gradient(circle at 38% 48%, #f09c83 0 12%, transparent 12.5%), radial-gradient(circle at 62% 48%, #ee6d67 0 12%, transparent 12.5%), linear-gradient(100deg, transparent 49%, #4f8a65 50% 53%, transparent 54%), linear-gradient(135deg, #dfeee6, #f7edd3); }
.new-work { border-style: dashed; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.new-work:hover { background: #eef8f2; border-color: var(--mint-dark); }
.new-work > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); font-size: 23px; }

.membership { background: var(--ink); color: white; position: relative; overflow: hidden; }
.membership::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1px); background-size: 18px 18px; mask-image: linear-gradient(90deg, black, transparent 45%); }
.membership-inner { position: relative; padding-top: 62px; padding-bottom: 62px; }
.light-heading .kicker { color: var(--mint); }
.light-heading > p { color: rgba(255,255,255,.58); }
.plan-grid { display: grid; grid-template-columns: 1.35fr .9fr .95fr; gap: 14px; }
.plan { min-height: 0; position: relative; padding: 20px; border: 1px solid rgba(255,255,255,.15); border-radius: 16px; background: rgba(255,255,255,.055); display: flex; flex-direction: column; }
.plan-days { font: 800 12px ui-monospace, monospace; color: var(--mint); letter-spacing: .12em; }
.plan h3 { font-size: 19px; margin: 0 0 5px; }
.plan p { color: rgba(255,255,255,.52); font-size: 11px; margin: 0; }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; font-size: 12px; }
.plan li::before { content: "✓"; color: var(--mint); margin-right: 8px; }
.plan button { border: 1px solid rgba(255,255,255,.2); border-radius: 9px; padding: 11px; color: white; background: rgba(255,255,255,.05); font-weight: 750; cursor: pointer; }
.plan button:hover { background: rgba(255,255,255,.12); }
.plan.featured { background: var(--mint); color: var(--ink); border-color: var(--mint); }
.plan.featured .plan-days, .plan.featured li::before { color: var(--mint-dark); }
.plan.featured p { color: rgba(23,35,31,.6); }
.plan.featured button { background: var(--ink); color: white; }
.recommend { position: absolute; right: 14px; top: 14px; background: var(--coral); color: white; border-radius: 99px; padding: 5px 8px; font-size: 9px; font-weight: 800; }
.plan-compact-head { display: flex; align-items: center; gap: 14px; }
.plan-compact-head .plan-days { min-width: 58px; min-height: 54px; padding: 8px; display: grid; place-items: center; text-align: center; border-radius: 12px; background: rgba(185,231,208,.13); }
.plan-vip .plan-compact-head .plan-days { background: rgba(23,35,31,.1); }
.day-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.day-options button { margin: 0; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; }
.day-options button b { font-size: 14px; }
.day-options button small { color: rgba(255,255,255,.55); font-size: 9px; }
.plan-vip { justify-content: space-between; gap: 16px; }
.plan-vip > button, .plan-super > button { min-height: 46px; margin-top: auto; }
.plan-super { gap: 16px; background: linear-gradient(145deg, rgba(196,82,59,.28), rgba(255,255,255,.06)); border-color: rgba(255,179,153,.42); }
.plan-super .plan-days { color: #ffc1ad; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.steps li { display: flex; gap: 22px; padding: 30px 30px 10px 0; border-right: 1px solid var(--line); }
.steps li + li { padding-left: 30px; }
.steps li:last-child { border: 0; }
.steps > li > span { font: 800 12px ui-monospace, monospace; color: var(--coral); }
.steps b { font-size: 17px; }
.steps p { color: var(--muted); line-height: 1.7; font-size: 12px; }

footer { max-width: 1440px; margin: 0 auto; padding: 38px clamp(20px, 4vw, 64px); border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand .brand-mark { width: 30px; height: 30px; }
.footer-brand div { display: flex; flex-direction: column; gap: 3px; }
.footer-brand small, footer p { color: var(--muted); font-size: 10px; }
.footer-links { display: flex; gap: 18px; font-size: 11px; }
.footer-links button, .footer-links a { cursor: pointer; color: var(--muted); text-decoration: none; }
.footer-links button:hover, .footer-links a:hover { color: var(--ink); }
footer p { grid-column: 1 / -1; margin: 4px 0 0; }
.floating-service { position: fixed; right: 20px; bottom: 20px; z-index: 15; border: 0; border-radius: 99px; background: var(--coral); color: white; padding: 11px 16px; box-shadow: 0 8px 26px rgba(196,82,59,.32); font-weight: 800; cursor: pointer; }
.floating-service span { margin-right: 5px; }
.toast { position: fixed; z-index: 9999; inset: auto auto 30px 50%; margin: 0; border: 0; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 11px 18px; border-radius: 9px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 12px; transition: .25s; }
.toast.show, .toast:popover-open { opacity: 1; transform: translate(-50%, 0); }

dialog { border: 0; padding: 0; background: transparent; max-width: calc(100vw - 28px); overscroll-behavior: contain; }
dialog::backdrop { position: fixed; inset: 0; background: rgba(16,25,22,.58); backdrop-filter: blur(5px); }
.modal { width: 460px; border-radius: 20px; background: var(--cream); color: var(--ink); padding: 30px; box-shadow: 0 30px 90px rgba(0,0,0,.3); position: relative; }
.modal-close { position: absolute; right: 18px; top: 18px; width: 31px; height: 31px; border-radius: 50%; border: 1px solid var(--line); background: white; cursor: pointer; font-size: 20px; line-height: 1; }
.modal-brand { display: flex; align-items: center; gap: 9px; font-weight: 850; }
.modal-brand .brand-mark { width: 28px; height: 28px; }
.modal h2 { font-family: "STSong", "Songti SC", Georgia, serif; font-size: 32px; margin: 24px 0 6px; }
.modal > p { margin: 0 0 22px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.auth-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; padding: 4px; border-radius: 10px; background: #eae9e3; margin: 22px 0; }
.auth-tabs button { border: 0; border-radius: 7px; background: transparent; padding: 9px 4px; font-size: 11px; cursor: pointer; }
.auth-tabs button.active { background: white; font-weight: 800; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.auth-modal form { display: grid; gap: 15px; }
.auth-modal form > label:not(.agree), .admin-form label { display: grid; gap: 7px; font-size: 11px; font-weight: 700; }
.auth-modal input, .admin-form input, .admin-form select { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: white; padding: 12px; outline: 0; }
.auth-modal input:focus, .admin-form input:focus, .admin-form select:focus { border-color: var(--mint-dark); box-shadow: 0 0 0 3px rgba(45,107,84,.1); }
.agree { display: flex; align-items: flex-start; gap: 7px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.agree input { width: auto; margin-top: 3px; }
.agree button { border: 0; background: transparent; padding: 0; color: var(--mint-dark); cursor: pointer; font-size: inherit; }
.submit-auth { margin-top: 2px; }
.prototype-note, .admin-footnote { margin-top: 15px; padding: 10px; border-radius: 8px; background: #f0eee7; color: var(--muted); font-size: 9px; line-height: 1.6; }
.small-modal { text-align: center; }
.dialog-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto; border-radius: 16px; background: var(--mint); color: var(--mint-dark); font-size: 28px; }
.service-qr { width: min(320px, 100%); aspect-ratio: 1; margin: 18px auto 12px; overflow: hidden; border: 8px solid white; border-radius: 16px; background: white; box-shadow: 0 0 0 1px var(--line), 0 14px 32px rgba(31, 50, 42, .12); }
.service-qr img { display: block; width: 100%; height: 100%; object-fit: contain; }
.contact-line { display: block; margin: 12px 0 4px; }
.small-modal > small { color: var(--muted); font-size: 9px; display: block; margin-bottom: 20px; }
.legal-modal { width: 620px; }
.legal-content { max-height: 52vh; overflow: auto; color: var(--muted); font-size: 12px; line-height: 1.85; padding-right: 8px; }
.legal-content h3 { color: var(--ink); margin: 18px 0 5px; font-size: 14px; }
.account-modal {
  --account-side: 30px;
  width: 650px;
  position: fixed;
  top: calc(84px + env(safe-area-inset-top, 0px));
  right: 0;
  bottom: auto;
  left: 0;
  height: calc(100vh - 96px - env(safe-area-inset-top, 0px));
  height: calc(100dvh - 96px - env(safe-area-inset-top, 0px));
  margin: 0 auto;
  max-height: none;
  overflow-x: hidden;
  overflow-y: scroll;
  padding: 0 var(--account-side) 30px;
  overscroll-behavior-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
.account-modal-head {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 calc(var(--account-side) * -1);
  padding: 16px var(--account-side) 13px;
  border-bottom: 1px solid var(--line);
  background: rgba(251,250,245,.97);
  backdrop-filter: blur(14px);
}
.account-modal-head .modal-close { position: static; flex: 0 0 auto; }
.account-head-actions { display: flex; align-items: center; gap: 8px; }
.account-head-actions #goAdmin { min-height: 38px; padding: 8px 13px; border-radius: 9px; font-size: 10px; }
.account-hero { display: flex; align-items: center; gap: 18px; }
.account-hero h2 { margin: 2px 0; font-size: 27px; }
.account-hero p { margin: 0; }
.account-title-line { display: flex; align-items: center; gap: 9px; }
.account-title-line > b { flex: none; padding: 5px 8px; border-radius: 999px; background: var(--mint); color: var(--mint-dark); font-size: 9px; line-height: 1; }
.vip-seal { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; background: var(--ink); color: var(--mint); font: 900 18px ui-monospace, monospace; box-shadow: inset 0 0 0 4px rgba(185,231,208,.15); }
.member-status { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin: 12px 0; padding: 9px; border: 1px solid #dfe6e2; border-radius: 14px; background: #f1f6f3; }
.member-status div { border: 0; background: transparent; border-radius: 8px; padding: 7px 8px; display: flex; flex-direction: column; gap: 4px; }
.member-status small { color: var(--muted); font-size: 9px; }
.member-status b { font-size: 12px; }
.member-ai-status button { align-self: flex-start; margin-top: 1px; padding: 3px 7px; border: 1px solid #d7c8ef; border-radius: 999px; background: #f4edff; color: #67459a; font-size: 8px; font-weight: 800; cursor: pointer; }
.redeem-card { margin: 13px 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.redeem-card h3 { margin: 3px 0; font-size: 17px; }
.redeem-card p { margin: 0; color: var(--muted); font-size: 10px; }
.redeem-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 13px 0 8px; }
.redeem-form input { min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 11px; outline: 0; text-transform: uppercase; }
.redeem-form input:focus { border-color: var(--mint-dark); box-shadow: 0 0 0 3px rgba(45,107,84,.1); }
.redeem-form button { border: 0; border-radius: 9px; padding: 0 17px; background: var(--ink); color: white; font-weight: 800; cursor: pointer; }
.redeem-card > small { display: block; color: var(--muted); font-size: 9px; line-height: 1.55; }
.share-reward-card { margin: 10px 0 13px; padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px 14px; align-items: center; border: 1px solid #ecd9a6; border-radius: 12px; background: #fff8e8; }
.share-reward-card b, .share-reward-card small { display: block; }
.share-reward-card b { font-size: 13px; }
.share-reward-card small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.share-reward-actions { display: flex; gap: 6px; align-items: center; }
.share-reward-actions button, .share-evidence-picker { min-height: 38px; display: inline-grid; place-items: center; border: 1px solid #e0c987; border-radius: 9px; padding: 7px 10px; background: white; color: #765412; font-size: 10px; font-weight: 800; cursor: pointer; }
.share-reward-actions button:last-child { border-color: #8a68b8; background: #8a68b8; color: white; }
.share-reward-actions button:disabled { opacity: .5; cursor: not-allowed; }
.share-evidence-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.share-reward-card > p { grid-column: 1 / -1; margin: 0; color: #765412; font-size: 9px; }
.member-plan-card { margin: 13px 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.member-plan-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.member-plan-head h3 { margin: 3px 0 0; font-size: 17px; }
.member-plan-head > small { color: var(--muted); font-size: 9px; }
.member-plan-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.member-plan-options button { border: 1px solid var(--line); border-radius: 9px; background: var(--cream); padding: 10px 6px; cursor: pointer; }
.member-plan-options b, .member-plan-options span { display: block; }
.member-plan-options b { font-size: 10px; }
.member-plan-options span { margin-top: 4px; color: var(--coral); font-size: 9px; font-weight: 800; }
.gift-card { border: 0; width: 100%; border-radius: 12px; background: var(--mint); padding: 16px; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer; }
.gift-card > span { font-size: 25px; color: var(--mint-dark); }
.gift-card div { display: flex; flex-direction: column; gap: 4px; }
.gift-card small { font-size: 9px; color: rgba(23,35,31,.62); }
.gift-card strong { margin-left: auto; font-size: 11px; }
.ai-bean-card { margin-top: 13px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(135deg, #f4efff, white); }
.ai-bean-card h3 { margin: 3px 0; font-size: 17px; }
.ai-bean-card p { margin: 0; color: var(--muted); font-size: 10px; }
.member-service-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
.member-service-grid .gift-card, .member-service-grid .ai-bean-card { min-width: 0; min-height: 92px; margin: 0; padding: 13px; }
.member-service-grid .gift-card { background: #e5f4ed; }
.member-service-grid .gift-card > span { font-size: 20px; }
.member-service-grid .gift-card strong { font-size: 10px; white-space: nowrap; }
.member-service-grid .ai-bean-card { background: #f1edf8; }
.member-service-grid .ai-bean-card .btn { min-height: 38px; padding: 8px 10px; font-size: 10px; }
.member-access-module { margin-top: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.member-redeem-compact { padding: 10px 12px; }
.member-redeem-compact .redeem-card { display: grid; grid-template-columns: auto minmax(220px, 1fr); align-items: center; gap: 7px 12px; margin: 0; padding: 0; border: 0; background: transparent; }
.member-redeem-compact .redeem-card > label { font-size: 12px; font-weight: 900; white-space: nowrap; }
.member-redeem-compact .redeem-form { margin: 0; }
.member-redeem-compact .redeem-form input { min-height: 40px; padding: 9px 11px; }
.member-redeem-compact .redeem-form button { min-height: 40px; white-space: nowrap; }
.member-redeem-compact .redeem-card > small { grid-column: 2; }
.member-redeem-compact #memberPlans { display: none !important; }
.member-access-module > summary, .member-history-details > summary { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; list-style: none; cursor: pointer; }
.member-access-module > summary::-webkit-details-marker, .member-history-details > summary::-webkit-details-marker { display: none; }
.member-access-module > summary span, .member-history-details > summary span { display: grid; gap: 3px; }
.member-access-module > summary b, .member-history-details > summary b { font-size: 13px; }
.member-access-module > summary small, .member-history-details > summary small { color: var(--muted); font-size: 9px; }
.member-access-module > summary i, .member-history-details > summary i { font-style: normal; color: var(--mint-dark); font-size: 10px; font-weight: 800; }
.member-access-module[open] > summary, .member-history-details[open] > summary { border-bottom: 1px solid var(--line); background: #f7faf8; }
.member-access-module[open] > summary i::before, .member-history-details[open] > summary i::before { content: ""; }
.member-access-body { padding: 0 13px 13px; }
.member-access-body .redeem-card, .member-access-body .member-plan-card { margin: 12px 0 0; }
.member-history-details { display: block; }
.member-history-details:not([open]) .member-history-body { display: none; }
.member-history-details .member-works-head { justify-content: flex-end; padding: 7px 12px; }
.member-history-details .member-work-list { max-height: 190px; }
.member-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px; align-items: stretch; }
.member-dashboard-grid > .member-works { min-width: 0; margin-top: 10px; }
.member-dashboard-grid .member-works-head { min-height: 54px; padding: 10px 11px; }
.member-dashboard-grid .member-works-head h3 { font-size: 14px; }
.member-dashboard-grid .member-works-head button { min-height: 34px; padding: 6px 8px; font-size: 9px; }
.member-dashboard-grid .member-work-list { max-height: 230px; }
.member-dashboard-grid .member-work-row { grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 9px 10px; }
.member-dashboard-grid .member-work-actions { justify-content: flex-start; }
.member-dashboard-grid .member-work-actions button { min-height: 32px; padding: 5px 7px; font-size: 8px; }
.member-dashboard-grid .member-history-details > summary { min-height: 54px; padding: 10px 11px; }
.member-dashboard-grid .member-history-details .member-works-head { min-height: 42px; padding: 5px 9px; }
.member-service-grid:not(:has(> :not([hidden]))) { display: none; }
.member-service-grid:has(> :not([hidden])) { grid-template-columns: 1fr; }
.member-service-grid .gift-card { min-height: 58px; }
.auth-contact { width: 100%; margin-top: 10px; border: 0; background: transparent; color: var(--mint-dark); cursor: pointer; font-size: 10px; }
.super-code-card { background: linear-gradient(135deg, #ffd9cc, var(--mint)); }
.super-code-card > span { min-width: 38px; font: 900 17px ui-monospace, monospace; }
.gift-code-modal { width: 430px; text-align: center; }
.gift-dialog-icon { width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto; border-radius: 17px; background: var(--mint); color: var(--mint-dark); font-size: 27px; }
.gift-code-modal h2 { margin-top: 14px; }
.gift-code-modal > p { margin-bottom: 14px; }
.gift-code-modal code { display: block; padding: 15px 10px; border: 1px dashed var(--mint-dark); border-radius: 11px; background: white; font: 800 18px ui-monospace, monospace; letter-spacing: .08em; overflow-wrap: anywhere; user-select: all; }
.gift-code-modal > small { display: block; margin: 9px 0 15px; color: var(--muted); font-size: 9px; }
.inline-copy-status { display: block; min-height: 18px; margin-top: 9px; color: var(--mint-dark); font-size: 10px; }
.super-code-modal { width: 560px; }
.super-code-modal h2 { margin: 7px 0; }
.super-code-modal > p { margin-bottom: 13px; }
.super-code-modal textarea { width: 100%; height: 280px; resize: vertical; border: 1px solid var(--line); border-radius: 11px; background: white; padding: 13px; font: 11px/1.65 ui-monospace, monospace; }
.super-code-modal > small { display: block; margin: 9px 0 14px; color: var(--muted); font-size: 9px; }

.legal-page { min-height: 100vh; background: var(--cream); color: var(--ink); }
.legal-page-shell { width: min(820px, calc(100% - 28px)); margin: 28px auto 60px; }
.legal-page-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.legal-page-top a { color: var(--mint-dark); text-decoration: none; font-weight: 800; font-size: 12px; }
.legal-page-card { border: 1px solid var(--line); border-radius: 20px; background: white; padding: clamp(24px, 5vw, 54px); box-shadow: var(--shadow); }
.legal-page-card h1 { margin: 7px 0 8px; font-family: "STSong", "Songti SC", Georgia, serif; font-size: clamp(30px, 5vw, 46px); }
.legal-page-card > p { color: var(--muted); line-height: 1.8; }
.legal-page-card section { padding: 18px 0; border-top: 1px solid var(--line); }
.legal-page-card h2 { margin: 0 0 8px; font-size: 18px; }
.legal-page-card section p, .legal-page-card li { color: var(--muted); font-size: 13px; line-height: 1.85; }
.legal-page-card ul { margin: 7px 0 0; padding-left: 20px; }
.legal-contact-grid { display: grid; grid-template-columns: 1fr minmax(180px, 280px); gap: 28px; align-items: center; }
.legal-contact-grid img { width: 100%; border-radius: 14px; border: 1px solid var(--line); }
.storage-rule { display: flex; gap: 10px; align-items: center; padding: 11px 12px; margin: 10px 0; border-radius: 11px; background: #f3f2ed; }
.storage-rule > span { font: 900 25px ui-monospace, monospace; color: var(--coral); }
.storage-rule p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.member-works { margin-top: 13px; border: 1px solid var(--line); border-radius: 12px; background: white; overflow: hidden; }
.member-works-head { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.member-works-head h3 { margin: 2px 0 0; font-size: 17px; }
.member-works-head button { border: 1px solid var(--line); border-radius: 8px; background: var(--cream); padding: 7px 11px; cursor: pointer; }
.member-work-list { max-height: 190px; overflow: auto; }
.member-work-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 16px; align-items: center; border-bottom: 1px solid var(--line); }
.member-work-row:last-child { border: 0; }
.member-work-row b, .member-work-row small { display: block; }
.member-work-row small { color: var(--muted); margin-top: 4px; font-size: 9px; }
.member-work-main { min-width: 0; display: flex; align-items: center; gap: 10px; }
.member-work-row.is-busy { opacity: .7; }
.member-work-main img { width: 100%; height: 100%; object-fit: cover; }
.member-work-main > div { min-width: 0; }
.protected-image-shell { position: relative; display: grid; place-items: center; overflow: hidden; background: #f4f2eb; }
.protected-image-shell > img { display: block; opacity: 1; transition: opacity .16s ease; }
.protected-image-shell.is-loading > img, .protected-image-shell.has-error > img { opacity: 0; }
.protected-image-loading { display: none; position: absolute; inset: 0; place-items: center; padding: 6px; color: var(--muted); background: linear-gradient(100deg, #f1efe8 20%, #faf9f4 45%, #f1efe8 70%); background-size: 220% 100%; animation: image-loading-shimmer 1.2s linear infinite; text-align: center; font-size: 9px; }
.protected-image-shell.is-loading > .protected-image-loading { display: grid; }
.protected-image-retry { position: absolute; inset: 0; width: 100%; min-height: 44px; padding: 6px; border: 0; border-radius: inherit; color: #80523b; background: #fff4eb; font-size: 9px; line-height: 1.35; }
.work-thumbnail, .work-thumbnail-empty { width: 48px; height: 48px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 9px; }
.work-thumbnail-empty { display: grid; place-items: center; padding: 4px; color: var(--muted); background: #f4f2eb; text-align: center; font-size: 8px; }
@keyframes image-loading-shimmer { to { background-position: -220% 0; } }
.member-work-actions { display: flex; gap: 6px; }
.member-work-actions button { border: 1px solid var(--line); border-radius: 7px; background: var(--cream); padding: 7px 10px; cursor: pointer; font-size: 10px; }
.member-work-actions button[data-delete-work] { color: #a33d3d; }
.ai-history-row > button { border: 1px solid var(--line); border-radius: 8px; background: var(--cream); padding: 7px 10px; cursor: pointer; }
.history-only-badge { max-width: 128px; color: var(--muted); font-size: 8px; line-height: 1.35; text-align: right; }
.bean-log-list { padding: 10px 16px; background: #faf9f5; }
.bean-log-list h4 { margin: 3px 0 8px; font-size: 11px; }
.bean-log-row { display: grid; grid-template-columns: 120px 70px 1fr; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); align-items: center; font-size: 9px; }
.bean-log-row small { margin: 0; }
.ai-waiting-modal { width: 460px; text-align: center; }
.ai-wait-icon { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto; border-radius: 19px; background: linear-gradient(135deg, var(--mint), #d9c9ff); color: var(--ink); font: 900 19px ui-monospace, monospace; }
.ai-progress { height: 9px; margin: 20px 0 16px; overflow: hidden; border-radius: 99px; background: #e5e4df; }
.ai-progress i { display: block; width: 4%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint-dark), #8267c7); transition: width .45s ease; }
.ai-wait-tip { display: grid; gap: 4px; margin-bottom: 16px; padding: 13px; border-radius: 11px; background: white; text-align: left; }
.ai-wait-tip small { color: var(--muted); line-height: 1.55; }
.ai-preflight-modal { width: min(430px, calc(100vw - 24px)); max-height: min(90vh, 90dvh); overflow: hidden; padding: 0; }
.ai-preflight-shell { max-height: min(90vh, 90dvh); display: flex; flex-direction: column; overflow: hidden; }
.ai-preflight-scroll { min-height: 0; flex: 1 1 auto; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; padding: 24px 24px 14px; }
.ai-preflight-head h2 { margin: 0 0 16px; font-size: 25px; text-align: center; }
.ai-preflight-preview { margin: 0 auto; width: min(100%, 330px); height: clamp(190px, 40dvh, 300px); overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: repeating-conic-gradient(#f0f0ec 0 25%, #fff 0 50%) 50% / 20px 20px; }
.ai-preflight-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ai-preflight-summary { margin: 13px 0 0; text-align: center; color: var(--ink); font-size: 13px; font-weight: 850; }
.ai-preflight-footer { flex: 0 0 auto; padding: 10px 24px calc(18px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: rgba(251,250,245,.98); }
.ai-bean-pill { width: fit-content; max-width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 auto 10px; padding: 7px 12px; border-radius: 999px; background: #fff0d8; color: #865018; font-size: 11px; font-weight: 800; }
.ai-preflight-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 9px; }
.ai-preflight-actions .btn { min-height: 46px; }
.ai-preflight-actions .btn:disabled { cursor: wait; opacity: .72; }
.ai-compare-modal { width: min(900px, calc(100vw - 28px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.ai-compare-head { padding-right: 34px; }
.ai-compare-head h2 { margin: 7px 0 5px; font-size: 25px; }
.ai-compare-head p { margin: 0; color: var(--muted); font-size: 12px; }
.ai-compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 12px; }
.compare-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; }
.compare-card > div { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 12px; }
.compare-card span { font-size: 12px; font-weight: 850; }
.compare-card small { color: var(--muted); font-size: 9px; }
.compare-card figure { position: relative; margin: 0; aspect-ratio: 1 / 1; overflow: hidden; background: repeating-conic-gradient(#f0f0ec 0 25%, #fff 0 50%) 50% / 20px 20px; }
.compare-card img { width: 100%; height: 100%; object-fit: contain; }
.ai-card { border-color: #ad98df; box-shadow: 0 0 0 3px rgba(130,103,199,.09); }
.ai-card > div { background: #f5f0ff; }
.ai-compare-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.ai-compare-meta span { display: grid; gap: 3px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #f7f6f0; color: var(--muted); font-size: 9px; }
.ai-compare-meta b { color: var(--ink); font-size: 11px; }
.ai-background-option { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border-radius: 11px; background: #f7f6f0; cursor: pointer; }
.ai-background-option input { width: 18px; height: 18px; accent-color: var(--mint-dark); }
.ai-background-option span { display: grid; gap: 3px; }
.ai-background-option b { font-size: 11px; }
.ai-background-option small { color: var(--muted); font-size: 9px; }
.ai-legacy-person-warning { display: grid; gap: 4px; margin-top: 10px; padding: 11px 12px; border: 1px solid #e3a29b; border-radius: 11px; background: #fff0ed; color: #8d342d; }
.ai-legacy-person-warning[hidden] { display: none; }
.ai-legacy-person-warning b { font-size: 11px; }
.ai-legacy-person-warning span { font-size: 9px; line-height: 1.6; }
.ai-source-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 9px; margin-top: 14px; }
.ai-source-confirmation { margin-top: 10px; text-align: center; color: var(--muted); font-size: 10px; }
.ai-source-confirmation b { color: var(--ink); }
.empty-state { padding: 24px 16px; text-align: center; color: var(--muted); font-size: 11px; }
.account-bottom-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.account-bottom-actions .btn:only-child { grid-column: 1 / -1; }
.admin-modal {
  --admin-side: 30px;
  width: 1080px;
  position: fixed;
  top: calc(84px + env(safe-area-inset-top, 0px));
  right: 12px;
  bottom: auto;
  left: 12px;
  height: calc(100vh - 96px - env(safe-area-inset-top, 0px));
  height: calc(100dvh - 96px - env(safe-area-inset-top, 0px));
  margin: 0 auto;
  max-height: none;
  overflow-x: hidden;
  overflow-y: scroll;
  padding: 0 var(--admin-side) 30px;
  overscroll-behavior-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
.admin-modal-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 0 calc(var(--admin-side) * -1);
  padding: 14px var(--admin-side) 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(251,250,245,.97);
  backdrop-filter: blur(14px);
}
.admin-modal-head .modal-close { position: static; flex: 0 0 auto; }
.admin-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.admin-heading h2 { margin: 2px 0; font-size: 27px; }
.admin-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.admin-heading .btn { align-self: center; }
.admin-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 22px 0 15px; }
.admin-stats > div { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.admin-stats small { display: block; min-height: 24px; color: var(--muted); font-size: 9px; }
.admin-stats b { display: block; margin-top: 4px; font: 850 23px ui-monospace, monospace; }
.admin-stats .warning { border-color: #d98a2b; background: #fff2df; }
.admin-stats .warning b { color: #a85d10; }
.admin-tabs { display: flex; gap: 6px; padding: 5px; border-radius: 11px; background: #e8e7e0; }
.admin-tabs button { flex: 1; border: 0; border-radius: 8px; background: transparent; padding: 10px; cursor: pointer; font-size: 11px; }
.admin-tabs button.active { background: white; font-weight: 800; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.admin-pane { display: none; }
.admin-pane.active { display: block; }
.admin-form { display: grid; grid-template-columns: 1.3fr .7fr auto; align-items: end; gap: 10px; margin: 20px 0; }
.code-result { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: white; }
.code-result > div { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 10px; }
.code-result > div span { color: var(--muted); }
.code-result textarea { width: 100%; height: 135px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; resize: vertical; background: #f8f7f2; font: 11px/1.6 ui-monospace, monospace; margin-bottom: 9px; }
.code-export-actions { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 7px; }
.admin-table-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }
.admin-table-head h3 { margin: 0; font-size: 17px; }
.admin-table-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.admin-table-head select { border: 1px solid var(--line); border-radius: 8px; background: white; padding: 8px 10px; }
.admin-member-search, .admin-share-filter { display: flex; gap: 6px; align-items: center; }
.admin-member-search input { width: 210px; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: white; }
.admin-member-search button, .admin-share-filter button { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; background: white; cursor: pointer; font-weight: 750; }
.admin-share-claims { display: grid; gap: 10px; }
.admin-share-claim { display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(240px, auto); gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.share-claim-image { width: 150px; height: 110px; border-radius: 9px; overflow: hidden; }
.share-claim-image img { width: 100%; height: 100%; object-fit: contain; background: #f1f0eb; }
.admin-share-claim-info > div { display: flex; align-items: center; gap: 8px; }
.admin-share-claim-info small { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; }
.admin-share-claim-info p { margin: 7px 0 0; color: #983e3e; font-size: 10px; }
.admin-share-review-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.admin-share-review-actions input { grid-column: 1 / -1; min-width: 0; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.admin-share-review-actions button { min-height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #f7f5ef; cursor: pointer; }
.admin-share-review-actions button:first-of-type { background: #e5f3ed; color: var(--mint-dark); }
.admin-table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: auto; background: white; }
.admin-code-table-wrap { max-height: 430px; overscroll-behavior: contain; }
.admin-table { width: 100%; min-width: 780px; border-collapse: collapse; font-size: 10px; }
.admin-table th { padding: 11px 12px; text-align: left; color: var(--muted); background: #f4f2eb; white-space: nowrap; }
.admin-table td { padding: 11px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.admin-table code { font: 10px ui-monospace, monospace; }
.admin-table select { min-width: 105px; border: 1px solid var(--line); border-radius: 7px; background: var(--cream); padding: 7px; }
.admin-table button { border: 1px solid var(--line); border-radius: 7px; background: var(--cream); padding: 6px 9px; cursor: pointer; font-size: 9px; }
.admin-table .member-days-input { width: 72px; margin: 4px; border: 1px solid var(--line); border-radius: 7px; padding: 7px; }
.bean-adjust { display: grid; grid-template-columns: 80px 160px auto; gap: 5px; min-width: 315px; }
.bean-adjust input, .settings-grid input, .settings-grid select { min-width: 0; border: 1px solid var(--line); border-radius: 7px; background: white; padding: 7px; }
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.settings-grid label { display: grid; gap: 6px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--muted); font-size: 10px; font-weight: 800; }
.status-chip { display: inline-flex; align-items: center; border-radius: 99px; padding: 4px 7px; background: #eeeee9; color: var(--muted); white-space: nowrap; }
.status-chip.unused { background: #e2f3e9; color: var(--mint-dark); }
.status-chip.redeemed { background: #fff0df; color: #9b5f22; }
.status-chip.expired, .status-chip.revoked { background: #f3e6e6; color: #983e3e; }
.admin-locked { display: inline-block; color: var(--muted); font-size: 9px; white-space: nowrap; }
.prompt-lab-admin-only { display: inline-flex; align-items: center; min-height: 32px; padding: 0 11px; border-radius: 999px; background: #eee6ff; color: #6342a4; font-size: 10px; font-weight: 850; white-space: nowrap; }
.prompt-lab-composer { display: grid; grid-template-columns: minmax(220px, 310px) minmax(0, 1fr); gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.prompt-lab-upload { position: relative; display: grid; place-items: center; min-height: 330px; overflow: hidden; border: 1px dashed #a8aaa4; border-radius: 13px; background: #f5f4ef; cursor: pointer; text-align: center; }
.prompt-lab-upload input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.prompt-lab-upload img { width: 100%; height: 100%; max-height: 430px; object-fit: contain; background: repeating-conic-gradient(#eeeeea 0 25%, #fff 0 50%) 50% / 20px 20px; }
.prompt-lab-upload span { display: grid; gap: 7px; padding: 24px; }
.prompt-lab-upload b { font-size: 15px; }
.prompt-lab-upload small { color: var(--muted); font-size: 10px; line-height: 1.6; }
.prompt-lab-fields { min-width: 0; display: grid; align-content: start; gap: 11px; }
.prompt-lab-fields > label:not(.prompt-lab-cost-confirm) { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 800; }
.prompt-lab-fields select, .prompt-lab-fields textarea, .prompt-lab-save-name { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: #fbfaf5; padding: 10px 11px; color: var(--ink); font: inherit; }
.prompt-lab-fields select { min-height: 44px; font-size: 13px; }
.prompt-lab-fields textarea { min-height: 174px; resize: vertical; font-size: 13px; line-height: 1.65; }
.prompt-lab-prompt-label small { text-align: right; color: var(--muted); font-size: 9px; }
.prompt-lab-rules { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.prompt-lab-rules span { display: grid; gap: 3px; padding: 9px; border-radius: 9px; background: #f0eee7; color: var(--muted); font-size: 9px; }
.prompt-lab-rules b { color: var(--ink); font-size: 10px; }
.prompt-lab-person-defaults { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; padding: 9px; border: 1px solid #cfc0ef; border-radius: 10px; background: #f6f1ff; }
.prompt-lab-person-defaults[hidden] { display: none; }
.prompt-lab-person-defaults > span { min-width: 0; display: grid; gap: 3px; padding: 7px; border-radius: 8px; background: rgba(255,255,255,.72); }
.prompt-lab-person-defaults small { overflow: hidden; text-overflow: ellipsis; color: #765fa8; font: 8px/1.2 ui-monospace, monospace; }
.prompt-lab-person-defaults b { color: #4f367f; font-size: 10px; }
.prompt-lab-person-defaults p { grid-column: 1 / -1; margin: 0; color: #725f92; font-size: 8px; line-height: 1.55; }
.prompt-lab-run-parameters { display: flex; flex-wrap: wrap; gap: 5px; margin: 9px 0 0; }
.prompt-lab-run-parameters span { padding: 5px 7px; border-radius: 99px; background: #f2edff; color: #624592; font: 8px/1.2 ui-monospace, monospace; }
.prompt-lab-cost-confirm { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 9px 11px; border-radius: 10px; background: #fff0d8; color: #865018; font-size: 11px; font-weight: 800; cursor: pointer; }
.prompt-lab-cost-confirm input { width: 19px; height: 19px; accent-color: var(--mint-dark); }
.prompt-lab-fields > .btn { min-height: 46px; font-size: 14px; }
.prompt-lab-fields > .btn:disabled { opacity: .52; cursor: not-allowed; }
.prompt-lab-status { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.prompt-lab-status.running { color: #76510d; }
.prompt-lab-status.success { color: var(--mint-dark); }
.prompt-lab-status.error { color: #9e3c35; }
.prompt-lab-runs { display: grid; gap: 12px; }
.prompt-lab-run { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.prompt-lab-run.saved { border-color: #9c84d6; box-shadow: 0 0 0 3px rgba(130,103,199,.08); }
.prompt-lab-run-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.prompt-lab-run-head > div { display: grid; gap: 4px; }
.prompt-lab-run-head b { font-size: 13px; }
.prompt-lab-run-head small { color: var(--muted); font-size: 9px; }
.prompt-lab-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prompt-lab-image { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #f5f4ef; }
.prompt-lab-image > span { display: block; padding: 8px 10px; color: var(--muted); font-size: 9px; font-weight: 800; }
.prompt-lab-image figure { margin: 0; aspect-ratio: 1 / 1; background: repeating-conic-gradient(#eeeeea 0 25%, #fff 0 50%) 50% / 20px 20px; }
.prompt-lab-image img { width: 100%; height: 100%; object-fit: contain; }
.prompt-lab-media { width: 100%; height: 100%; }
.prompt-lab-media .protected-image-loading { background-color: rgba(250,249,244,.94); }
.prompt-lab-result-placeholder { display: grid; place-items: center; height: 100%; padding: 18px; text-align: center; color: var(--muted); font-size: 11px; line-height: 1.6; }
.prompt-lab-prompt { margin: 11px 0 0; padding: 11px; border-radius: 10px; background: #f6f4ed; }
.prompt-lab-prompt summary { cursor: pointer; font-size: 10px; font-weight: 850; }
.prompt-lab-prompt pre { margin: 10px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: #414844; font: 11px/1.7 ui-monospace, monospace; }
.prompt-lab-actions { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto auto; gap: 8px; margin-top: 11px; }
.prompt-lab-actions .prompt-lab-save-name { min-height: 42px; font-size: 11px; }
.prompt-lab-actions button { min-height: 42px; }

@media (max-width: 1100px) {
  .nav-links { display: none; }
  .account-actions { margin-left: auto; }
  .hero { grid-template-columns: minmax(0, 680px); }
  .editor-shell { grid-template-columns: 210px 1fr; }
  .count-panel { grid-column: 1 / -1; border: 0; border-top: 1px solid var(--line); }
  .count-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .save-note { max-width: 340px; }
}

@media (max-width: 820px) {
  .topbar { height: 66px; padding: 0 17px; }
  .brand small { display: none; }
  .editor-nav-context { gap: 8px; }
  .editor-nav-context h2 { font-size: 17px; }
  .editor-nav-context .back-home { min-height: 44px; padding: 0 11px; }
  .account-actions .btn { padding: 9px 12px; font-size: 12px; }
  .hero { min-height: 0; grid-template-columns: 1fr; padding: 30px 18px 48px; }
  h1 { font-size: clamp(48px, 15vw, 76px); }
  .maker-card { max-width: 560px; width: 100%; justify-self: center; padding: 20px; }
  .dropzone { min-height: 220px; }
  .section-wrap { width: 100%; max-width: 100%; padding: 58px 18px; }
  body.editor-mode { overflow-x: hidden; }
  body.editor-mode .workspace { padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); font-size: 14px; }
  .workspace { padding: 10px 8px 28px; }
  .workspace-top { align-items: center; gap: 9px; padding: 0 2px; margin-bottom: 8px; }
  .conversion-source-bar { margin: 0 2px 8px; padding: 6px 9px; }
  .editor-title { display: block; }
  .editor-title .kicker, .editor-title p { display: none; }
  .editor-title h2 { margin: 0; font-size: 20px; white-space: normal; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 12px; }
  .editor-shell { grid-template-columns: 1fr; }
  .canvas-column { order: 1; }
  .tool-panel { order: 2; width: 100%; min-width: 0; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr; gap: 0; padding: 14px; }
  .count-panel { order: 3; padding: 14px; }
  .panel-group { width: 100%; min-width: 0; margin: 0; padding: 14px 0; }
  .panel-group:first-child { padding-top: 0; }
  .render-settings-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .render-settings-group .render-setting-card, .render-settings-group .enhance-action { min-width: 0; margin: 0; }
  .render-settings-group .enhance-action { min-height: 64px; }
  .render-settings-group select { display: block; width: 100%; max-width: 100%; min-height: 44px; font-size: 14px; }
  .canvas-viewport { height: 72vw; min-height: 390px; max-height: 580px; }
  .pinch-tip { display: block; }
  .canvas-primary-actions { padding: 8px; }
  .canvas-primary-actions .btn { min-height: 46px; font-size: 16px; }
  .canvas-toolbar { min-height: 34px; padding: 2px 7px; }
  .canvas-toolbar b { font-size: 11px; }
  .zoom-controls { gap: 3px; }
  .zoom-controls button { min-width: 32px; height: 32px; font-size: 14px; }
  .zoom-controls output { min-width: 39px; font-size: 10px; }
  .display-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 3px 5px; }
  .display-row { display: contents; }
  .display-strip label { min-width: 0; min-height: 42px; justify-content: center; padding: 0 2px; font-size: 12px; }
  .editor-bottom-tools { grid-template-columns: 1fr; gap: 7px; padding: 9px 8px; }
  .editor-tools-label { display: block; font-size: 14px; }
  .editor-bottom-tools .tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; overflow: visible; }
  .editor-bottom-tools .tool { width: 100%; min-width: 0; min-height: 44px; padding: 7px 3px; font-size: 13px; }
  .more-tools-panel { grid-column: 1 / -1; }
  .more-tools-panel .tool { font-size: 14px; }
  .count-list { grid-template-columns: repeat(3, 1fr); }
  .plan-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li + li { padding: 22px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  footer { grid-template-columns: 1fr; }
  .footer-links { flex-wrap: wrap; }
  .admin-form { grid-template-columns: 1fr 1fr; }
  .admin-form button { grid-column: 1 / -1; }
  .admin-stats { grid-template-columns: repeat(3, 1fr); }
  .settings-grid { grid-template-columns: repeat(2, 1fr); }
  .prompt-lab-composer { grid-template-columns: minmax(180px, .7fr) minmax(0, 1.3fr); }
  .prompt-lab-upload { min-height: 280px; }
  .prompt-lab-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prompt-lab-person-defaults { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-modal {
    top: calc(74px + env(safe-area-inset-top, 0px));
    height: calc(100vh - 84px - env(safe-area-inset-top, 0px));
    height: calc(100dvh - 84px - env(safe-area-inset-top, 0px));
  }
  .account-modal {
    top: calc(74px + env(safe-area-inset-top, 0px));
    height: calc(100vh - 84px - env(safe-area-inset-top, 0px));
    height: calc(100dvh - 84px - env(safe-area-inset-top, 0px));
  }
}

@media (max-width: 540px) {
  .topbar { padding: 0 10px; gap: 8px; }
  body.editor-mode .brand { display: none; }
  body.editor-mode .editor-nav-context { gap: 5px; }
  body.editor-mode .editor-nav-context h2 { font-size: 15px; }
  body.editor-mode .editor-nav-context .back-home { padding: 0 8px; font-size: 12px; }
  .brand > span:last-child { font-size: 13px; }
  .brand-mark { width: 31px; height: 31px; }
  .account-actions { gap: 5px; }
  .account-actions .btn { min-height: 40px; padding: 8px 10px; font-size: 11px; }
  .account-actions .btn-dark span { display: none; }
  .hero { padding-top: 18px; }
  .hero-lede { font-size: 14px; }
  .trust-row { gap: 9px; font-size: 10px; }
  .maker-card { padding: 15px; border-radius: 18px; }
  .maker-head { align-items: center; margin-bottom: 14px; }
  .maker-head h2 { font-size: 19px; }
  .privacy-pill { display: none; }
  .dropzone { min-height: 178px; }
  .generation-mode { gap: 6px; }
  .generation-mode button { padding: 9px 7px; column-gap: 6px; }
  .generation-mode button > span { min-width: 31px; height: 31px; }
  .generation-mode button small { font-size: 8px; line-height: 1.35; }
  .ai-subject-select { padding: 10px 8px; }
  .ai-classification-preview { grid-template-columns: 92px minmax(0, 1fr); gap: 9px; padding: 8px; }
  .ai-classification-preview figure { height: 104px; }
  .ai-classification-preview > div > b { font-size: 13px; }
  .ai-manual-toggle { min-height: 36px; }
  .ai-subject-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
  .ai-subject-cards { gap: 5px; }
  .ai-subject-cards button { min-height: 78px; padding: 6px 2px; }
  .ai-subject-cards button > span { font-size: 15px; }
  .ai-subject-cards button > small { font-size: 7px; }
  .pet-feature-description > span { align-items: flex-start; flex-direction: column; gap: 2px; }
  .pet-type-select > div:first-child { align-items: flex-start; flex-direction: column; gap: 2px; }
  .pet-type-cards button { min-height: 44px; gap: 3px; padding: 5px 2px; }
  .pet-type-cards button span { font-size: 16px; }
  .person-style-select { padding: 7px; }
  .person-style-cards { gap: 5px; }
  .person-style-cards button { min-height: 72px; grid-template-columns: 52px minmax(0, 1fr); gap: 6px; padding: 5px; }
  .person-style-preview { width: 50px; height: 56px; }
  .style-card-media { width: 50px; height: 56px; }
  .person-style-cards button b { font-size: 9px; }
  .person-style-cards button small { font-size: 6.5px; }
  .ai-style-step-head { align-items: flex-start; }
  .ai-style-step-head h3 { font-size: 15px; }
  .classification-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload-progress { margin-inline: 0; }
  .upload-glyph { width: 44px; height: 44px; }
  .blank-action { min-height: 62px; }
  .section-heading h2 { font-size: 36px; }
  .tool-panel { grid-template-columns: 1fr; }
  .tool-panel .panel-group { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
  .pattern-size-summary { padding: 10px; }
  .pattern-size-summary b { font-size: 11px; }
  .pattern-size-summary small { font-size: 8px; }
  .board-size-heading > label { font-size: 14px; }
  .board-effect-pills { gap: 5px; }
  .board-canvas-size { display: grid; gap: 0; }
  .board-canvas-size small { font-size: 8px; }
  .board-canvas-size b { font-size: 10px; }
  .board-effect-actions { gap: 3px; }
  .board-effect-pills button { min-height: 31px; padding-inline: 7px; font-size: 9px; }
  .board-range-control { grid-template-columns: 46px minmax(0, 1fr) 46px; gap: 10px; }
  .board-range-control > button { width: 46px; height: 46px; }
  .board-compact-settings > label, .board-compact-settings > button { min-height: 50px; }
  .board-compact-settings small { font-size: 10px; }
  .board-compact-settings b, .board-compact-settings select { font-size: 11px; }
  .palette { grid-template-columns: repeat(12, 1fr); gap: 5px; max-height: 82px; }
  .palette-brand-options { width: 100%; }
  .palette-brand-options button { min-height: 44px; padding-inline: 11px; }
  .selected-color { display: none; }
  .color-settings-modal { width: calc(100vw - 12px); max-height: min(94vh, 94dvh); padding: 24px 18px calc(18px + env(safe-area-inset-bottom, 0px)); border-radius: 22px 22px 12px 12px; }
  .color-settings-modal h2 { margin-top: 4px; font-size: 25px; }
  .color-settings-brand-grid, .color-settings-tier-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
  .color-settings-brand-grid button, .color-settings-tier-grid button { min-height: 54px; padding: 5px 2px; font-size: 12px; }
  .color-settings-fidelity { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .color-settings-fidelity button { min-height: 48px; padding: 6px 3px; text-align: center; }
  .color-diagnostics-body { grid-template-columns: 1fr 1fr; }
  .color-diagnostic-item { padding: 5px; }
  .canvas-toolbar { align-items: center; flex-wrap: nowrap; gap: 4px; }
  .canvas-toolbar-actions { flex: 1 1 auto; gap: 4px; }
  .canvas-source-label { max-width: 92px; gap: 4px; }
  .canvas-palette-toggle { min-height: 32px; padding-inline: 7px; font-size: 9px; }
  .canvas-palette-toggle i { width: 12px; height: 12px; }
  .palette-picker-modal .palette { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; max-height: 46dvh; }
  .ai-preflight-modal { width: calc(100vw - 16px); max-height: min(90vh, 90dvh); }
  .ai-preflight-scroll { padding: 20px 14px 12px; }
  .ai-preflight-head h2 { margin-bottom: 13px; font-size: 22px; }
  .ai-preflight-preview { height: clamp(180px, 38dvh, 270px); }
  .ai-preflight-footer { padding: 9px 14px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .ai-preflight-actions .btn { min-height: 48px; padding-inline: 8px; }
  .ai-compare-modal { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); padding: 18px 14px; }
  .ai-compare-grid { grid-template-columns: 1fr; }
  .compare-card figure { aspect-ratio: 4 / 3; max-height: 260px; }
  .ai-source-actions { grid-template-columns: 1fr; }
  .zoom-controls .reset-zoom { display: none; }
  .display-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 3px 4px; gap: 3px; }
  .display-row { display: contents; }
  .display-strip label { min-height: 42px; border-radius: 7px; background: #f4f2ea; font-size: 11px; white-space: nowrap; }
  .canvas-viewport { height: calc(100vw - 22px); min-height: 310px; max-height: 520px; }
  .editor-bottom-tools { grid-template-columns: 1fr; gap: 6px; padding: 8px; }
  .editor-tools-label { display: block; }
  .editor-bottom-tools .tool-grid { gap: 5px; padding-bottom: 0; }
  .editor-bottom-tools .tool { min-height: 44px; padding: 7px 2px; gap: 3px; font-size: 12px; }
  .editor-bottom-tools .tool span { font-size: 15px; }
  .canvas-primary-actions { padding: 7px; gap: 6px; }
  .canvas-primary-actions .btn { min-width: 0; padding-inline: 6px; }
  .canvas-primary-actions .ios-download-note { display: none; }
  .count-list { grid-template-columns: repeat(2, 1fr); }
  .materials-export-actions { grid-template-columns: 1fr 1fr 1fr; }
  .materials-export-actions .full-link { min-width: 0; font-size: 10px; }
  .membership-inner { padding: 28px 14px; }
  .light-heading { margin-bottom: 12px; }
  .light-heading .kicker, .light-heading > p { display: none; }
  .light-heading h2, .section-heading.light-heading h2 { margin: 0; font-size: 24px; }
  .plan-grid { gap: 8px; }
  .plan { padding: 12px; border-radius: 12px; }
  .plan h3 { font-size: 15px; }
  .plan p { font-size: 9px; line-height: 1.5; }
  .plan-compact-head { gap: 10px; padding-right: 54px; }
  .plan-short .plan-compact-head { padding-right: 0; }
  .plan-compact-head .plan-days { min-width: 48px; min-height: 44px; padding: 6px; border-radius: 9px; font-size: 10px; }
  .day-options { gap: 6px; margin-top: 10px; }
  .day-options button { min-height: 40px; padding: 7px; }
  .day-options button b { font-size: 12px; }
  .plan-vip { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 9px; }
  .plan-vip > button { min-height: 40px; min-width: 92px; padding: 8px; font-size: 10px; }
  .recommend { right: 8px; top: 8px; padding: 4px 7px; font-size: 8px; }
  .modal { padding: 24px 18px; }
  .ai-preflight-modal { padding: 0; }
  .modal h2 { font-size: 28px; }
  .account-modal {
    --account-side: 16px;
    width: auto;
    max-width: none;
    top: calc(72px + env(safe-area-inset-top, 0px));
    right: 7px;
    bottom: auto;
    left: 7px;
    height: calc(100vh - 80px - env(safe-area-inset-top, 0px));
    height: calc(100dvh - 80px - env(safe-area-inset-top, 0px));
    margin: 0;
    padding: 0 var(--account-side) 18px;
    border-radius: 15px;
  }
  .account-modal-head { padding-top: 11px; padding-bottom: 10px; }
  .account-modal-head .modal-close { width: 38px; height: 38px; font-size: 23px; }
  .account-head-actions { gap: 5px; }
  .account-head-actions #goAdmin { min-height: 36px; padding: 7px 9px; font-size: 9px; }
  .account-hero { gap: 10px; }
  .account-hero h2 { font-size: 21px; line-height: 1.2; }
  .account-title-line { gap: 6px; }
  .account-title-line > b { max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 6px; font-size: 8px; }
  .account-hero .kicker { font-size: 7px; }
  .account-hero p { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
  .member-status { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; padding: 6px; }
  .member-status > div:first-child { grid-column: auto; }
  .member-status div { min-width: 0; padding: 6px 5px; }
  .member-status small, .member-status b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .member-ai-status button { align-self: center; min-height: 24px; padding: 3px 6px; }
  .member-redeem-compact { padding: 9px; }
  .member-redeem-compact .redeem-card { grid-template-columns: 1fr; gap: 6px; }
  .member-redeem-compact .redeem-card > label { font-size: 11px; }
  .member-redeem-compact .redeem-form { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  .member-redeem-compact .redeem-form button { min-height: 40px; padding-inline: 10px; }
  .member-redeem-compact .redeem-card > small { grid-column: 1; }
  .member-dashboard-grid { gap: 6px; }
  .member-dashboard-grid .member-works-head { min-height: 50px; padding: 8px; }
  .member-dashboard-grid .member-works-head h3 { font-size: 12px; }
  .member-dashboard-grid .member-works-head .kicker { display: none; }
  .member-dashboard-grid .member-works-head button { min-height: 30px; padding: 4px 6px; }
  .member-dashboard-grid .member-history-details > summary { min-height: 50px; padding: 8px; gap: 4px; }
  .member-dashboard-grid .member-history-details > summary b { font-size: 11px; }
  .member-dashboard-grid .member-history-details > summary small { display: none; }
  .member-dashboard-grid .member-work-main { align-items: flex-start; gap: 6px; }
  .member-dashboard-grid .member-work-main b { font-size: 10px; }
  .member-dashboard-grid .member-work-main small { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.35; }
  .member-dashboard-grid .work-thumbnail,
  .member-dashboard-grid .work-thumbnail-empty { width: 36px; height: 36px; }
  .member-dashboard-grid .history-only-badge { text-align: left; }
  .member-dashboard-grid .bean-log-list { padding: 8px; }
  .member-dashboard-grid .bean-log-row { grid-template-columns: 1fr; gap: 2px; }
  .member-service-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .member-service-grid .gift-card, .member-service-grid .ai-bean-card { min-height: 84px; padding: 10px; }
  .share-reward-card { grid-template-columns: 1fr; }
  .share-reward-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .share-reward-actions button, .share-evidence-picker { min-width: 0; padding-inline: 5px; }
  .member-service-grid .gift-card { align-items: flex-start; flex-wrap: wrap; gap: 6px; }
  .member-service-grid .gift-card strong { width: 100%; margin: 0; }
  .member-service-grid .ai-bean-card { align-items: flex-start; gap: 7px; }
  .member-status div { min-width: 0; padding: 9px 7px; text-align: center; }
  .member-status b { overflow-wrap: anywhere; font-size: 11px; }
  .redeem-card { padding: 13px; }
  .account-hero { align-items: center; }
  .vip-seal { width: 43px; height: 43px; border-radius: 12px; font-size: 14px; }
  .gift-card strong { display: none; }
  .member-plan-options { grid-template-columns: repeat(2, 1fr); }
  .legal-contact-grid { grid-template-columns: 1fr; }
  .admin-form { grid-template-columns: 1fr; }
  .admin-form button { grid-column: auto; }
  .admin-modal {
    --admin-side: 14px;
    width: auto;
    max-width: none;
    top: calc(72px + env(safe-area-inset-top, 0px));
    right: 7px;
    bottom: auto;
    left: 7px;
    height: calc(100vh - 80px - env(safe-area-inset-top, 0px));
    height: calc(100dvh - 80px - env(safe-area-inset-top, 0px));
    margin: 0;
    padding: 0 var(--admin-side) 18px;
    border-radius: 15px;
  }
  .admin-modal-head { padding-top: 10px; padding-bottom: 9px; }
  .admin-modal-head .modal-close { width: 38px; height: 38px; font-size: 23px; }
  .admin-heading { align-items: center; gap: 8px; }
  .admin-heading h2 { font-size: 20px; white-space: nowrap; }
  .admin-heading p, .admin-heading .kicker { display: none; }
  .admin-heading .btn { min-height: 36px; padding: 7px 9px; font-size: 10px; white-space: nowrap; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-tabs { overflow-x: auto; justify-content: flex-start; }
  .admin-tabs button { flex: 0 0 auto; min-width: 90px; min-height: 42px; }
  .admin-table-head { align-items: stretch; flex-direction: column; }
  .admin-member-search { display: grid; grid-template-columns: 1fr auto auto; }
  .admin-member-search input { width: 100%; }
  .admin-share-claim { grid-template-columns: 88px 1fr; }
  .share-claim-image { width: 88px; height: 88px; }
  .admin-share-review-actions { grid-column: 1 / -1; }
  .palette-admin-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .prompt-lab-composer { grid-template-columns: 1fr; padding: 10px; }
  .prompt-lab-upload { min-height: 210px; }
  .prompt-lab-upload img { max-height: 300px; }
  .prompt-lab-fields textarea { min-height: 150px; font-size: 14px; }
  .prompt-lab-compare { grid-template-columns: 1fr; }
  .prompt-lab-actions { grid-template-columns: 1fr 1fr; }
  .prompt-lab-actions .prompt-lab-save-name { grid-column: 1 / -1; }
  .prompt-lab-actions button { min-height: 44px; }
  .ai-bean-card { align-items: flex-start; flex-direction: column; }
  .bean-log-row { grid-template-columns: 1fr auto; }
  .bean-log-row small { grid-column: 1 / -1; }
  .admin-stats > div { padding: 10px; }
  .admin-stats b { font-size: 19px; }
  .account-bottom-actions { grid-template-columns: 1fr; }
  .member-work-row { grid-template-columns: 1fr; }
  .floating-service { right: 12px; bottom: 12px; }
}

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

/* 编辑器布局模式只重排界面，不改变图纸、编辑历史或生成算法。 */
body[data-editor-layout-effective="tablet"] .workspace { width: calc(100% - 12px); max-width: 1480px; padding: 8px 0 calc(24px + env(safe-area-inset-bottom, 0px)); }
body[data-editor-layout-effective="tablet"] .editor-shell { grid-template-columns: minmax(0, 2.18fr) minmax(250px, .72fr); grid-template-areas: "canvas tools" "canvas materials"; align-items: start; overflow: visible; }
body[data-editor-layout-effective="tablet"] .canvas-column { grid-area: canvas; position: sticky; top: 8px; border-radius: 19px 0 0 19px; overflow: hidden; }
body[data-editor-layout-effective="tablet"] .tool-panel { grid-area: tools; width: 100%; min-width: 0; display: block; padding: 16px; border: 0; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
body[data-editor-layout-effective="tablet"] .count-panel { grid-area: materials; width: 100%; min-width: 0; padding: 16px; border: 0; border-left: 1px solid var(--line); }
body[data-editor-layout-effective="tablet"] .panel-group { width: 100%; min-width: 0; margin: 0; padding: 14px 0; }
body[data-editor-layout-effective="tablet"] .panel-group:first-child { padding-top: 0; }
body[data-editor-layout-effective="tablet"] .canvas-viewport { height: clamp(620px, 78dvh, 960px); min-height: 0; max-height: none; }
body[data-editor-layout-effective="tablet"] .bead-grid { width: min(920px, calc(100% - 12px)); }
body[data-editor-layout-effective="tablet"] .pinch-tip { display: block; }
body[data-editor-layout-effective="tablet"] .count-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body[data-editor-layout-effective="tablet"] .render-settings-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
body[data-editor-layout-effective="tablet"] .render-settings-group .enhance-action { min-width: 0; min-height: 60px; margin: 0; }
body[data-editor-layout-effective="tablet"] .editor-bottom-tools { grid-template-columns: 1fr; gap: 6px; }
body[data-editor-layout-effective="tablet"] .editor-bottom-tools .tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; }
body[data-editor-layout-effective="tablet"] .editor-bottom-tools .tool { min-width: 0; }

body[data-editor-layout-effective="compact"] .workspace { width: min(100%, 760px); max-width: 760px; padding: 10px 8px calc(24px + env(safe-area-inset-bottom, 0px)); }
body[data-editor-layout-effective="compact"] .editor-shell { grid-template-columns: 1fr; grid-template-areas: "canvas" "tools" "materials"; }
body[data-editor-layout-effective="compact"] .canvas-column { grid-area: canvas; order: 1; }
body[data-editor-layout-effective="compact"] .tool-panel { grid-area: tools; order: 2; width: 100%; min-width: 0; display: grid; grid-template-columns: 1fr; padding: 14px; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
body[data-editor-layout-effective="compact"] .count-panel { grid-area: materials; order: 3; width: 100%; padding: 14px; border: 0; border-top: 1px solid var(--line); }
body[data-editor-layout-effective="compact"] .canvas-viewport { height: clamp(390px, 72vw, 580px); }
body[data-editor-layout-effective="compact"] .pinch-tip { display: block; }
body[data-editor-layout-effective="tablet"] .canvas-viewport .bead-grid,
body[data-editor-layout-effective="compact"] .canvas-viewport .bead-grid { width: 100%; height: 100%; }

/* iPad/large-screen immersive canvas: the editor controls float above a real
   viewport-sized canvas, so the board never loses width to document layout. */
body.canvas-fullscreen { overflow: hidden; }
body.canvas-fullscreen .topbar,
body.canvas-fullscreen .workspace-top,
body.canvas-fullscreen .editor-layout-bar,
body.canvas-fullscreen .tool-panel,
body.canvas-fullscreen .count-panel,
body.canvas-fullscreen .floating-service,
body.canvas-fullscreen footer { display: none !important; }
body.canvas-fullscreen #editor { width: 100%; max-width: none; margin: 0; padding: 0; }
body.canvas-fullscreen .editor-shell { display: block; }
body.canvas-fullscreen .canvas-column { position: fixed; z-index: 1200; inset: 0; width: 100dvw; max-width: none; height: 100dvh; overflow: hidden; border-radius: 0; background: #e7e8e1; }
body.canvas-fullscreen .canvas-viewport { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; max-height: none; }
body.canvas-fullscreen .bead-grid { width: 100%; height: 100%; }
body.canvas-fullscreen .canvas-primary-actions { display: none !important; }
body.canvas-fullscreen .canvas-primary-actions .ios-download-note { display: none; }
body.canvas-fullscreen .canvas-toolbar { position: absolute; z-index: 5; top: max(10px, env(safe-area-inset-top, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); width: min(440px, calc(100vw - 20px)); min-height: 42px; border: 1px solid rgba(23,35,31,.13); border-radius: 13px; box-shadow: 0 10px 28px rgba(23,35,31,.18); }
body.canvas-fullscreen .display-strip { position: absolute; z-index: 5; left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); bottom: calc(60px + env(safe-area-inset-bottom, 0px)); width: auto; border: 1px solid rgba(23,35,31,.13); border-radius: 13px; box-shadow: 0 10px 28px rgba(23,35,31,.18); }
body.canvas-fullscreen .editor-bottom-tools { position: absolute; z-index: 5; left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); bottom: env(safe-area-inset-bottom, 0px); width: auto; min-height: 50px; padding: 5px 8px; border: 1px solid rgba(23,35,31,.13); border-radius: 13px; box-shadow: 0 10px 28px rgba(23,35,31,.18); }
body.canvas-fullscreen .editor-bottom-tools .tool-grid { overflow-x: auto; }
body.canvas-fullscreen .editor-bottom-tools.is-collapsed { left: auto; width: auto; min-height: 0; padding: 4px 7px; }
body.canvas-fullscreen .editor-bottom-tools.is-collapsed .tool-grid { display: none; }
body.canvas-fullscreen .pinch-tip { display: block; top: calc(env(safe-area-inset-top, 0px) + 12px); }

.quick-palette-panel { display: none; }
body[data-editor-layout-effective="tablet"] .quick-palette-panel,
body.canvas-fullscreen .quick-palette-panel { position: absolute; z-index: 6; top: 50%; right: max(10px, env(safe-area-inset-right, 0px)); display: grid; justify-items: center; gap: 5px; width: 50px; max-height: min(60vh, 460px); padding: 7px 5px; transform: translateY(-50%); overflow-y: auto; border: 1px solid rgba(69,49,80,.16); border-radius: 15px; background: rgba(255,252,248,.94); box-shadow: 0 10px 30px rgba(64,44,73,.16); backdrop-filter: blur(12px); overscroll-behavior: contain; }
body[data-editor-layout-effective="tablet"] .canvas-column { position: relative; }
.quick-palette-head { display: grid; justify-items: center; gap: 3px; }
.quick-palette-head > b { color: #6d537d; font-size: 9px; line-height: 1.1; text-align: center; }
.quick-palette-toggle { border: 0; padding: 0; background: transparent; color: #725982; font-size: 9px; cursor: pointer; }
.quick-palette-colors { display: grid; gap: 5px; }
.quick-palette-chip { position: relative; width: 32px; height: 32px; border: 2px solid #fff; border-radius: 10px; background: var(--quick-color); box-shadow: 0 0 0 1px rgba(35,26,41,.18); cursor: pointer; }
.quick-palette-chip.active { box-shadow: 0 0 0 3px #b78ddb; }
.quick-palette-chip .quick-palette-remove { position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; display: grid; place-items: center; border: 1px solid #d8c9df; border-radius: 50%; background: #fff; color: #725982; font-size: 11px; line-height: 1; }
.quick-palette-add { width: 32px; min-height: 32px; border: 1px dashed #bda7c8; border-radius: 10px; background: #f7effb; color: #725982; font-size: 18px; font-weight: 800; cursor: pointer; }
.quick-palette-panel.is-collapsed { width: auto; max-height: none; padding: 6px 7px; overflow: visible; }
.quick-palette-panel.is-collapsed .quick-palette-colors,
.quick-palette-panel.is-collapsed .quick-palette-add { display: none; }
.editor-tools-head { display: contents; }
.fullscreen-tools-toggle { display: none; }
body.canvas-fullscreen .editor-tools-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
body.canvas-fullscreen .editor-tools-label { display: block; }
body.canvas-fullscreen .fullscreen-tools-toggle { display: inline-flex; min-height: 30px; align-items: center; padding: 3px 9px; border: 1px solid rgba(69,49,80,.2); border-radius: 9px; background: #fff; color: #563d66; font-weight: 800; font-size: 11px; cursor: pointer; }

@media (max-width: 699px) {
  .zoom-controls #zoomFitWidth { display: none; }
  body.canvas-fullscreen .canvas-toolbar { top: max(8px, env(safe-area-inset-top, 0px)); right: max(68px, env(safe-area-inset-right, 0px)); width: calc(100vw - 78px); }
  body.canvas-fullscreen .canvas-source-label { max-width: 105px; }
  body.canvas-fullscreen .quick-palette-panel { top: 50%; right: max(6px, env(safe-area-inset-right, 0px)); width: 42px; padding-inline: 4px; }
  body.canvas-fullscreen .quick-palette-chip,
  body.canvas-fullscreen .quick-palette-add { width: 28px; height: 28px; min-height: 28px; }
  body.canvas-fullscreen .display-strip { bottom: calc(112px + env(safe-area-inset-bottom, 0px)); grid-template-columns: repeat(5, minmax(0, 1fr)); }
  body.canvas-fullscreen .editor-bottom-tools { grid-template-columns: 1fr; gap: 3px; bottom: env(safe-area-inset-bottom, 0px); }
  body.canvas-fullscreen .editor-tools-label { display: none; }
}

@media (max-width: 699px) {
  .editor-layout-bar { min-height: 46px; gap: 7px; padding: 5px 6px 5px 9px; }
  .editor-layout-copy b { font-size: 11px; }
  .editor-layout-copy small { max-width: 112px; font-size: 8px; }
  .editor-layout-switch { gap: 2px; padding: 2px; }
  .editor-layout-switch button { min-height: 36px; padding: 5px 7px; font-size: 10px; }
}
.local-flow-preview-banner {
  margin: 10px 0 4px;
  padding: 9px 12px;
  border: 1px solid #b8d9cc;
  border-radius: 999px;
  background: #e9f6f0;
  color: #245846;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.local-flow-preview-nav {
  display: flex;
  gap: 7px;
  margin: 8px 0 12px;
  padding: 2px 0 5px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.local-flow-preview-nav a {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid #d8d8d1;
  border-radius: 999px;
  background: #fff;
  color: #405049;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.local-flow-preview-nav a.active {
  border-color: #286f58;
  background: #286f58;
  color: #fff;
}
/* ----------------------------------------------------------
   Q 感视觉升级（仅外观：不改变编辑器、会员或转换逻辑）
   ---------------------------------------------------------- */
:root {
  --paper: #fff3e6;
  --cream: #fffaf5;
  --white: #fffefb;
  --mint: #e7d9ff;
  --mint-dark: #76539b;
  --coral: #f18b72;
  --line: rgba(111, 76, 112, .16);
  --shadow: 0 18px 50px rgba(112, 76, 100, .14);
}

body {
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 196, 84, .26) 0 5px, transparent 6px),
    radial-gradient(circle at 92% 25%, rgba(241, 139, 114, .22) 0 7px, transparent 8px),
    radial-gradient(circle at 18% 76%, rgba(197, 164, 238, .26) 0 5px, transparent 6px),
    var(--paper);
}

.topbar {
  background: rgba(255, 253, 248, .94);
  border-bottom-color: rgba(112, 76, 100, .13);
  box-shadow: 0 3px 16px rgba(112, 76, 100, .06);
}

.brand-mark,
.brand-mark span,
.brand-dots span {
  border-radius: 7px;
}

.btn,
button,
select,
input[type="text"],
input[type="number"] {
  border-radius: 15px;
}

.btn-dark,
.primary-btn,
.btn.primary {
  background: linear-gradient(135deg, #f08a68, #e96983);
  box-shadow: 0 5px 0 #b94f65, 0 10px 20px rgba(218, 92, 116, .22);
  transform: translateY(-1px);
}

.btn-dark:active,
.primary-btn:active,
.btn.primary:active {
  box-shadow: 0 2px 0 #b94f65;
  transform: translateY(2px);
}

.btn-light,
.btn-ghost {
  background: #fffef9;
  border-color: rgba(118, 83, 155, .18);
  box-shadow: 0 3px 0 rgba(118, 83, 155, .08);
}

.workspace-top,
.editor-layout-bar {
  background: rgba(255, 251, 242, .82);
  border-radius: 20px;
}

.editor-layout-bar {
  border: 1px solid rgba(118, 83, 155, .15);
  box-shadow: 0 8px 24px rgba(112, 76, 100, .08);
}

.editor-layout-bar button,
.editor-layout-bar .layout-mode-btn {
  border-radius: 13px;
}

.editor-shell {
  background: #fffdf8;
  border: 1px solid rgba(118, 83, 155, .16);
  border-radius: 28px;
  box-shadow: 0 22px 55px rgba(112, 76, 100, .15);
}

.tool-panel,
.count-panel {
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 203, 101, .19), transparent 22%),
    linear-gradient(180deg, #fffaf5, #f7eff5);
}

.tool-panel { border-right-color: rgba(118, 83, 155, .13); }
.count-panel { border-left-color: rgba(118, 83, 155, .13); }

.panel-group {
  padding: 14px;
  margin-bottom: 15px;
  border: 1px solid rgba(118, 83, 155, .13);
  border-radius: 18px;
  background: rgba(255, 255, 251, .78);
  box-shadow: 0 5px 14px rgba(112, 76, 100, .055);
}

.panel-group:last-child { border: 1px solid rgba(118, 83, 155, .13); }

.panel-group label,
.panel-title {
  color: #65466f;
  letter-spacing: .01em;
}

.board-size-group {
  background:
    linear-gradient(135deg, rgba(255, 247, 222, .92), rgba(255, 255, 250, .88));
}

.pattern-size-summary {
  border-radius: 14px;
  border-color: rgba(231, 170, 68, .25);
  background: #fffaf0;
}

.board-effect-pills button,
.board-effect-actions button,
.board-compact-settings button,
.board-compact-settings select {
  border-radius: 12px;
}

.canvas-column {
  background:
    radial-gradient(circle at 10% 10%, rgba(252, 216, 128, .12), transparent 18%),
    #f5f3eb;
}

.canvas-primary-actions,
.canvas-toolbar,
.canvas-foot {
  background: rgba(255, 254, 250, .97);
}

.canvas-primary-actions {
  padding: 12px 14px 10px;
}

.canvas-toolbar {
  min-height: 44px;
  padding: 4px 13px;
  color: #65466f;
}

.canvas-viewport {
  background-color: #f4f0e7;
  background-image:
    radial-gradient(rgba(118, 83, 155, .13) 1px, transparent 1.4px),
    linear-gradient(135deg, rgba(255,255,255,.52), rgba(255,255,255,0));
  background-size: 16px 16px, 100% 100%;
}

.bead-grid,
canvas.bead-grid {
  border-radius: 17px;
  box-shadow: 0 8px 24px rgba(112, 76, 100, .15);
}

.display-strip {
  margin: 8px 10px 0;
  min-height: 48px;
  padding: 4px;
  border: 1px solid rgba(118, 83, 155, .14);
  border-radius: 16px;
  background: #fffdf8;
}

.display-strip label {
  min-height: 38px;
  border-radius: 11px;
  background: #f6f2e7;
  color: #684c70;
}

.display-strip label:has(input:checked) {
  background: #f0e7ff;
  color: #6f4691;
}

.editor-bottom-tools {
  margin: 9px 10px 11px;
  padding: 9px 10px;
  border: 1px solid rgba(118, 83, 155, .14);
  border-radius: 17px;
  background: #fffdf8;
}

.editor-bottom-tools .tool {
  border-radius: 13px;
  border-color: rgba(118, 83, 155, .17);
  background: #fffefa;
}

.editor-bottom-tools .tool.active,
.editor-bottom-tools .tool[aria-pressed="true"] {
  background: #f0e5ff;
  border-color: #b68bd3;
  color: #70488d;
}

.tool-grid .tool,
.tool-grid button {
  border-radius: 14px;
}

.tool-grid .tool.active,
.tool-grid button.active {
  background: #f0e5ff;
  border-color: #b68bd3;
  color: #70488d;
}

.material-summary,
.material-list,
.count-panel .panel-group {
  border-radius: 18px;
}

.material-item,
.palette-chip {
  border-radius: 13px;
}

/* 去除旧绿色状态色，统一为奶油黄、珊瑚橙和雾紫 */
.privacy-pill,
.upload-status[data-tone="working"],
.upload-status[data-tone="success"] {
  background: #f2e9ff;
  color: #76539b;
}

.dropzone {
  border: 2px dashed #d8a66f;
  border-radius: 24px;
  background: linear-gradient(145deg, #fffdf8, #fff4e8 55%, #f6edff);
  box-shadow: inset 0 0 0 7px rgba(255,255,255,.46);
}

.dropzone:hover,
.dropzone.dragging,
.dropzone.busy {
  border-color: #ef8b72;
  background: linear-gradient(145deg, #fff8eb, #f8ebff);
}

.upload-glyph {
  background: linear-gradient(135deg, #76539b, #a876bd);
  color: #fff;
  box-shadow: 0 5px 0 #563b78, 0 10px 20px rgba(118,83,155,.2);
}

.upload-button {
  border-radius: 999px;
  background: #ffd36f;
  color: #674326;
  box-shadow: 0 4px 0 #d7a948;
}

.generation-mode button {
  border-radius: 18px;
  background: #fffdfa;
}

.generation-mode button.active,
.ai-subject-cards button.active,
.pet-type-cards button.active,
.person-style-cards button.active {
  border-color: #9a6fbd;
  background: linear-gradient(135deg, #f4eaff, #fff4e6);
  box-shadow: 0 0 0 3px rgba(154,111,189,.12), 0 5px 12px rgba(112,76,100,.08);
}

.generation-mode button.active > span,
.subject-card-mark,
.ai-detected-result strong {
  background: #eadbff;
  color: #6f4691;
}

.style-card-media {
  border-color: #e0cfe4;
  border-radius: 15px;
  background: linear-gradient(145deg, #fffaf4, #eee3ff);
}

.board-effect-pills button {
  border-color: #f0cf9a;
  background: #fff3dc;
  color: #77522e;
}

.board-effect-pills button.active {
  border-color: #e96f78;
  background: linear-gradient(135deg, #f18b72, #e96983);
  color: #fff;
  box-shadow: 0 4px 0 #bc5367;
}

.enhance-action {
  border-color: #efbd92;
  background: #fff2df;
  color: #83502e;
}

.enhance-action.active {
  background: linear-gradient(135deg, #f18b72, #e96983);
  color: #fff;
}

.tool.active,
.canvas-palette-toggle {
  border-color: #b38bd1;
  background: #f0e5ff;
  color: #70488d;
}

.palette-picker-head output,
.save-note,
.member-service-grid .gift-card {
  background: #fff0de;
  color: #865337;
}

.color-settings-brand-grid button.active {
  border-color: #8d64ae;
  background: #8d64ae;
  color: #fff;
  box-shadow: 0 6px 14px rgba(118,83,155,.2);
}

@media (max-width: 699px) {
  .topbar { min-height: 58px; }

  .editor-layout-bar {
    margin-inline: 8px;
    border-radius: 16px;
  }

  .editor-shell {
    border-radius: 22px;
    box-shadow: 0 13px 32px rgba(112, 76, 100, .14);
  }

  .tool-panel,
  .count-panel { padding: 12px 10px; }

  .panel-group {
    padding: 12px;
    border-radius: 16px;
  }

  .canvas-primary-actions { padding: 10px 11px 8px; }

  .canvas-primary-actions .btn { min-height: 43px; }

  .canvas-toolbar { min-height: 38px; padding: 3px 10px; }

  .display-strip { margin: 6px 7px 0; border-radius: 13px; }

  .editor-bottom-tools { margin: 7px; border-radius: 14px; }
}

/* Editor stability pass: route handoff, iOS pinch containment and compact
   fullscreen controls. These overrides intentionally sit last so older theme
   variants cannot re-enable page zoom or hide the recovery controls. */
html.ai-resume-pending body {
  min-height: 100dvh;
  overflow: hidden;
}
html.ai-resume-pending body > * {
  opacity: 0;
  pointer-events: none;
}
html.ai-resume-pending body::before {
  content: "";
  position: fixed;
  z-index: 99998;
  inset: 0;
  background: #fff8ed;
}
html.ai-resume-pending body::after {
  content: "AI图片已生成\A正在进入拼豆编辑器…";
  position: fixed;
  z-index: 99999;
  left: 50%;
  top: 45%;
  width: min(86vw, 420px);
  padding: 28px 20px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(118,83,155,.18);
  border-radius: 24px;
  background: #fffdf8;
  color: #382b40;
  box-shadow: 0 18px 46px rgba(87,58,76,.15);
  white-space: pre;
  text-align: center;
  font-size: 18px;
  font-weight: 850;
  line-height: 1.75;
}

.canvas-viewport,
.bead-grid {
  touch-action: none !important;
  overscroll-behavior: contain;
  -webkit-user-select: none;
  user-select: none;
}

.editor-nav-context .back-home {
  border-color: #d66076;
  background: linear-gradient(135deg, #f18b72, #df6686);
  color: #fff;
  box-shadow: 0 4px 0 #b64f68, 0 8px 18px rgba(193,77,104,.2);
  font-weight: 850;
}
.editor-nav-context .back-home:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #b64f68;
}

.display-strip-head { display: none; }
.count-head h3 small {
  margin-left: 5px;
  color: #796c82;
  font-size: 10px;
  font-weight: 700;
}

body.canvas-fullscreen .display-strip {
  display: block !important;
  padding: 4px 5px;
}
body.canvas-fullscreen .display-strip-head {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 5px;
}
body.canvas-fullscreen .display-strip-head b {
  color: #664972;
  font-size: 11px;
}
body.canvas-fullscreen #fullscreenDisplayToggle {
  min-height: 28px;
  padding: 2px 9px;
  border: 1px solid rgba(118,83,155,.2);
  border-radius: 9px;
  background: #fff;
  color: #70488d;
  font-size: 11px;
  font-weight: 800;
}
body.canvas-fullscreen .display-strip .display-row {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}
body.canvas-fullscreen .display-strip.is-collapsed {
  left: auto;
  width: auto;
  min-width: 106px;
}
body.canvas-fullscreen .display-strip.is-collapsed .display-row {
  display: none !important;
}

@media (max-width: 699px) {
  body.canvas-fullscreen .display-strip .display-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  body.canvas-fullscreen .display-strip label {
    min-height: 36px;
    font-size: 11px;
  }
}

.quality-qa-page { margin: 0; min-width: 320px; background: #f7f2ea; color: #1d2925; font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; }
.quality-qa-shell { width: min(1440px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 60px; }
.quality-qa-shell > header { display: grid; grid-template-columns: 1fr 150px; gap: 24px; align-items: center; padding: 24px 28px; border: 1px solid #e2d9cc; border-radius: 24px; background: rgba(255,255,255,.9); box-shadow: 0 14px 36px rgba(74,55,39,.08); }
.quality-qa-shell > header span { color: #7b52a1; font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.quality-qa-shell > header h1 { margin: 8px 0; font-size: clamp(26px, 4vw, 44px); line-height: 1.08; }
.quality-qa-shell > header p { margin: 0; color: #68716d; font-size: 15px; }
.quality-qa-shell > header img { width: 150px; aspect-ratio: 1; object-fit: cover; border-radius: 20px; }
.quality-qa-legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 18px 0; padding: 14px 18px; border-radius: 16px; background: #efe8f8; color: #5c416f; }
.quality-qa-legend span { padding: 6px 10px; border: 1px solid #d9cae8; border-radius: 999px; background: rgba(255,255,255,.72); font-size: 13px; }
.quality-qa-results { display: grid; gap: 20px; }
.quality-qa-row { padding: 20px; border: 1px solid #e3d9ce; border-radius: 24px; background: rgba(255,255,255,.92); box-shadow: 0 12px 32px rgba(74,55,39,.06); }
.quality-qa-row-title { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 14px; }
.quality-qa-row-title div { display: flex; align-items: center; gap: 10px; }
.quality-qa-row-title b { font-size: 23px; }
.quality-qa-row-title span { padding: 5px 9px; border-radius: 999px; background: #e5f4ef; color: #286d5b; font-size: 12px; font-weight: 800; }
.quality-qa-row-title small { color: #747b77; }
.quality-qa-pair { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.quality-qa-pair figure { min-width: 0; margin: 0; padding: 14px; border: 1px solid #e5ded5; border-radius: 18px; background: #faf8f4; }
.quality-qa-pair figure.is-after { border-color: #c7b2dc; background: #faf7ff; box-shadow: inset 0 0 0 1px rgba(123,82,161,.08); }
.quality-qa-pair figcaption { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; }
.quality-qa-pair figcaption b { font-size: 18px; }
.quality-qa-pair figcaption span { color: #747b77; font-size: 12px; text-align: right; }
.quality-qa-pair figure > img { display: block; width: 100%; height: auto; max-height: 620px; object-fit: contain; border-radius: 10px; background: #fffdf7; }
.quality-qa-pair canvas { display: block; width: 100%; height: auto; max-height: 620px; object-fit: contain; border-radius: 10px; background: #fffdf7; image-rendering: pixelated; }
.quality-qa-error { max-width: 680px; margin: 80px auto; padding: 30px; border-radius: 24px; background: white; }
@media (max-width: 700px) {
  .quality-qa-shell { width: min(100% - 18px, 1440px); padding-top: 10px; }
  .quality-qa-shell > header { grid-template-columns: 1fr 80px; padding: 18px; }
  .quality-qa-shell > header img { width: 80px; border-radius: 14px; }
  .quality-qa-pair { grid-template-columns: 1fr; }
  .quality-qa-row { padding: 12px; border-radius: 18px; }
  .quality-qa-row-title, .quality-qa-pair figcaption { align-items: flex-start; flex-direction: column; }
  .quality-qa-pair figcaption span { text-align: left; }
}

/* Full-screen editor: display switches belong at the very bottom. Editing
   tools stay immediately above them and use a denser touch-friendly layout. */
body.canvas-fullscreen .display-strip {
  bottom: max(5px, env(safe-area-inset-bottom, 0px));
}
body.canvas-fullscreen .editor-bottom-tools {
  bottom: calc(126px + env(safe-area-inset-bottom, 0px));
  min-height: 40px;
  gap: 5px;
  padding: 4px 6px;
}
body.canvas-fullscreen .display-strip.is-collapsed + .editor-bottom-tools {
  bottom: calc(48px + env(safe-area-inset-bottom, 0px));
}
body.canvas-fullscreen .editor-tools-head {
  min-height: 28px;
}
body.canvas-fullscreen .editor-bottom-tools .tool-grid {
  gap: 4px;
}
body.canvas-fullscreen .editor-bottom-tools .tool {
  flex-basis: 60px;
  min-height: 34px;
  padding: 4px 5px;
  border-radius: 10px;
  font-size: 11px;
}
body.canvas-fullscreen .editor-bottom-tools .tool span {
  font-size: 13px;
}
body.canvas-fullscreen .canvas-toolbar {
  min-height: 36px;
  padding: 3px 5px;
}
body.canvas-fullscreen .canvas-toolbar button {
  min-height: 32px;
  padding: 3px 8px;
  font-size: 11px;
}
body.canvas-fullscreen .canvas-toolbar .zoom-value {
  min-width: 42px;
  font-size: 11px;
}

@media (max-width: 699px) {
  body.canvas-fullscreen .display-strip {
    bottom: max(4px, env(safe-area-inset-bottom, 0px));
  }
  body.canvas-fullscreen .editor-bottom-tools {
    bottom: calc(116px + env(safe-area-inset-bottom, 0px));
    padding: 4px 5px;
  }
  body.canvas-fullscreen .display-strip.is-collapsed + .editor-bottom-tools {
    bottom: calc(46px + env(safe-area-inset-bottom, 0px));
  }
  body.canvas-fullscreen .editor-bottom-tools .tool-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }
  body.canvas-fullscreen .editor-bottom-tools .tool {
    min-height: 34px;
    padding: 4px 2px;
    font-size: 11px;
  }
  body.canvas-fullscreen .canvas-toolbar {
    min-height: 34px;
  }
}

/* Touch drawing upgrade: one finger paints continuously; two fingers own
   navigation. Keep the most-used stroke controls close to the canvas. */
.canvas-gesture-bar {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 250, .98);
  color: #6a5871;
}
.canvas-gesture-guide {
  margin-right: auto;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.brush-size-switch,
.canvas-quick-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.brush-size-switch b { font-size: 10px; }
.brush-size-switch button,
.canvas-quick-actions button {
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid rgba(118, 83, 155, .18);
  border-radius: 8px;
  background: #fff;
  color: #65466f;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.brush-size-switch button.active {
  border-color: #b68bd3;
  background: #f0e5ff;
  color: #70488d;
  box-shadow: 0 0 0 1px rgba(182, 139, 211, .12);
}
body.canvas-fullscreen .canvas-gesture-bar {
  position: absolute;
  z-index: 5;
  top: calc(max(10px, env(safe-area-inset-top, 0px)) + 50px);
  right: max(10px, env(safe-area-inset-right, 0px));
  width: auto;
  min-height: 36px;
  border: 1px solid rgba(23, 35, 31, .13);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(23, 35, 31, .16);
}

@media (max-width: 699px) {
  .canvas-gesture-bar {
    gap: 5px;
    padding: 4px 7px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .canvas-gesture-bar::-webkit-scrollbar { display: none; }
  .canvas-gesture-guide { font-size: 9px; }
  .brush-size-switch b { display: none; }
  .brush-size-switch button,
  .canvas-quick-actions button {
    min-height: 30px;
    padding: 3px 7px;
    white-space: nowrap;
  }
  body.canvas-fullscreen .canvas-gesture-bar {
    top: calc(max(8px, env(safe-area-inset-top, 0px)) + 43px);
    right: max(68px, env(safe-area-inset-right, 0px));
    max-width: calc(100vw - 78px);
  }
  body.canvas-fullscreen .canvas-gesture-guide { display: none; }
}
/* Keep the export contents explicit even when editor labels are hidden. */
.print-download-note { grid-column: 1 / -1; color: #53615b; font-size: .8rem; line-height: 1.5; }
