.step-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.step-nav button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #40594b;
  background: rgba(255, 253, 243, 0.54);
  text-align: left;
}

.step-nav span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(127, 181, 154, 0.16);
  color: #557462;
  font-size: 12px;
}

.step-nav button.active {
  border-color: rgba(127, 181, 154, 0.62);
  background: #fffdf3;
  box-shadow: 0 10px 24px rgba(71, 96, 80, 0.1);
}

.panel-host {
  display: grid;
  gap: 16px;
}

.panel-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 243, 0.72);
  box-shadow: 0 12px 32px rgba(58, 80, 65, 0.08);
}

.section-heading span {
  display: inline-block;
  margin-bottom: 8px;
  color: #76937e;
  font-size: 12px;
}

.section-heading h2 {
  margin-bottom: 8px;
  font-family: "Noto Serif SC", serif;
  font-size: 22px;
}

.section-heading p {
  color: var(--muted);
  line-height: 1.65;
}

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

.template-card {
  position: relative;
  min-height: 132px;
  padding: 16px;
  border: 1px solid rgba(78, 105, 87, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 253, 243, 0.94), rgba(236, 244, 229, 0.74));
  color: var(--ink);
  text-align: left;
  overflow: hidden;
}

.template-card.active {
  border-color: var(--template-accent);
  box-shadow: inset 0 0 0 1px var(--template-accent), 0 12px 26px rgba(67, 92, 75, 0.12);
}

.template-orb {
  display: block;
  width: 30px;
  height: 30px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--template-accent);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--template-accent) 18%, transparent);
}

.template-card strong,
.template-card small {
  position: relative;
  z-index: 1;
  display: block;
}

.template-card strong {
  margin-bottom: 7px;
  font-size: 16px;
}

.template-card small {
  color: var(--muted);
  line-height: 1.45;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.field > span {
  color: #536d5d;
  font-size: 13px;
}

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

.field input,
.field textarea {
  width: 100%;
  border: 1px solid rgba(91, 121, 100, 0.24);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: rgba(255, 255, 247, 0.78);
  outline: none;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(127, 181, 154, 0.18);
}

.chip-row,
.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.style-option {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 253, 243, 0.68);
  color: #435c4e;
}

.chip.active,
.style-option.active {
  border-color: var(--green);
  background: rgba(127, 181, 154, 0.18);
  color: #2f5c46;
}

.style-list {
  display: grid;
  gap: 8px;
}

.beautify-panel {
  display: grid;
  gap: 14px;
}

.beautify-substeps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(78, 105, 87, 0.14);
  border-radius: 8px;
  background: rgba(240, 242, 224, 0.72);
}

.beautify-substeps button {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  color: #617367;
  background: transparent;
}

.beautify-substeps button span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(93, 119, 101, 0.1);
  font-size: 11px;
}

.beautify-substeps button.active {
  color: #2f5c46;
  background: rgba(255, 253, 243, 0.92);
  box-shadow: 0 2px 8px rgba(45, 64, 52, 0.08);
}

.beautify-substeps button.active span {
  color: #fffdf3;
  background: var(--green);
}

.beautify-page {
  display: grid;
  gap: 14px;
}

.beautify-block {
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding: 14px;
  border: 1px solid rgba(78, 105, 87, 0.15);
  border-radius: 8px;
  background: rgba(255, 253, 243, 0.58);
}

.icon-style-grid {
  display: grid;
  gap: 10px;
}

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

.icon-style-card {
  display: grid;
  gap: 7px;
  justify-items: start;
  min-height: 118px;
  border: 1px solid rgba(78, 105, 87, 0.16);
  border-radius: 8px;
  padding: 12px;
  color: #31483b;
  background: rgba(255, 255, 247, 0.68);
  text-align: left;
}

.icon-style-card.active {
  border-color: var(--green);
  background: rgba(127, 181, 154, 0.14);
  box-shadow: inset 0 0 0 1px rgba(127, 181, 154, 0.26);
}

.icon-style-card small,
.widget-config-row small {
  color: var(--muted);
  line-height: 1.45;
}

.icon-demo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 253, 243, 0.86);
  box-shadow: 0 8px 16px rgba(45, 64, 52, 0.12);
}

.icon-demo img {
  width: 27px;
  height: 27px;
}

.icon-demo-glass {
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(10px);
}

.icon-demo-sticker {
  border: 2px solid #fff6d5;
  border-radius: 18px 12px 18px 12px;
  background: color-mix(in srgb, var(--green) 20%, #fffdf3);
}

.icon-demo-mono {
  border: 1px solid rgba(55, 79, 64, 0.34);
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  filter: grayscale(1);
}

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

.widget-config-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 10px;
  align-items: start;
  min-height: 142px;
  padding: 12px;
  border: 1px solid rgba(78, 105, 87, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 247, 0.66);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.widget-config-row:hover {
  transform: translateY(-1px);
}

.widget-config-row.active {
  border-color: rgba(91, 151, 120, 0.55);
  background: rgba(232, 245, 234, 0.76);
}

.widget-style-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}

.widget-config-demo {
  position: relative;
  display: grid;
  align-content: center;
  gap: 3px;
  width: 72px;
  height: 62px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 14px;
  padding: 8px;
  color: #31483b;
  box-shadow: 0 6px 14px rgba(48, 65, 54, 0.11);
}

.widget-config-row > .feature-switch {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
}

.widget-config-demo b {
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
}

.widget-config-demo small {
  overflow: hidden;
  color: inherit;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.68;
}

.widget-config-demo-mint { background: linear-gradient(135deg, #dff3df, #b9dfce); }
.widget-config-demo-sky { background: linear-gradient(145deg, #c8e9f6, #9bc7eb); }
.widget-config-demo-night { background: linear-gradient(145deg, #34383e, #17191b); color: #fff; }
.widget-config-demo-photo { background: linear-gradient(145deg, #f0afad, #809eaa); color: #fff; }
.widget-config-demo-paper { background: #fffefb; }
.widget-config-demo-rose { background: linear-gradient(145deg, #ffe3e8, #f4bcc8); color: #7f3f50; }
.widget-config-demo-lavender { background: linear-gradient(145deg, #e6ddf6, #c9bce9); color: #4b3e6d; }
.widget-config-demo-cream { background: linear-gradient(145deg, #fff1cb, #f5dca9); color: #604e35; }
.widget-config-demo-coral { background: linear-gradient(145deg, #ffd8c9, #f4aaa7); color: #673e3e; }
.widget-config-demo-green { background: linear-gradient(145deg, #d6eddf, #a9d5bd); }

.widget-demo-disc {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, #b96e64 0 4px, #171717 5px 8px);
}

.widget-demo-photo { width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.48); }
.widget-demo-heart { color: #dc7188; font-family: sans-serif; font-size: 15px; font-style: normal; }
.widget-demo-avatar { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: #8e7ab5; color: #fff; font-style: normal; }
.widget-demo-bars { display: flex; align-items: end; gap: 3px; height: 28px; }
.widget-demo-bars i { width: 6px; border-radius: 4px; background: rgba(255,255,255,.68); }
.widget-demo-bars i:nth-child(1) { height: 40%; }
.widget-demo-bars i:nth-child(2) { height: 70%; }
.widget-demo-bars i:nth-child(3) { height: 55%; }
.widget-demo-bars i:nth-child(4) { height: 88%; }
.widget-demo-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.widget-demo-actions i { display: grid; place-items: center; min-height: 20px; border-radius: 6px; background: rgba(255,255,255,.6); font-family: sans-serif; font-size: 9px; font-style: normal; }

.widget-config-copy {
  display: grid;
  grid-column: 1 / -1;
  grid-row: 2;
  gap: 3px;
  min-width: 0;
}

.widget-config-copy strong {
  font-size: 13px;
}

.beautify-upload {
  grid-column: 1 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  align-items: center;
}

.beautify-upload-preview {
  display: grid;
  place-items: center;
  width: 76px;
  height: 52px;
  overflow: hidden;
  border: 1px dashed rgba(91, 121, 100, 0.28);
  border-radius: 8px;
  background: rgba(255, 253, 243, 0.68);
  color: rgba(67, 92, 78, 0.52);
  font-size: 12px;
}

.beautify-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.widget-inline-fields {
  grid-column: 1 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 7px;
}

.widget-inline-fields label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
}

.widget-inline-fields input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px;
  color: #31483b;
  background: rgba(255, 253, 243, 0.82);
  font-size: 11px;
}

.beautify-upload-button {
  display: grid;
  place-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 243, 0.78);
  color: #40594b;
  cursor: pointer;
}

.beautify-upload-button input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.beautify-app-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: rgba(127, 181, 154, 0.14);
  overflow: hidden;
}

.beautify-app-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.beautify-app-icon.is-uploaded img,
.app-icon-preview.is-uploaded img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.icon-shape-sticker {
  border-radius: 19px 13px 19px 13px;
}

.icon-shape-mono {
  border-radius: 11px;
}

.beautify-app-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.beautify-app-choice {
  display: grid;
  gap: 5px;
  justify-items: center;
  min-width: 0;
  min-height: 74px;
  padding: 8px 4px;
  border: 1px solid rgba(78, 105, 87, 0.14);
  border-radius: 8px;
  color: #52695a;
  background: rgba(255, 255, 247, 0.58);
  font-size: 12px;
}

.beautify-app-choice.active {
  border-color: var(--green);
  color: #2f5c46;
  background: rgba(127, 181, 154, 0.14);
  box-shadow: inset 0 0 0 1px rgba(127, 181, 154, 0.2);
}

.beautify-app-editor {
  display: grid;
  gap: 14px;
  min-height: 250px;
  padding: 16px;
  border: 1px solid rgba(78, 105, 87, 0.16);
  border-radius: 8px;
  background: rgba(255, 253, 243, 0.64);
}

.beautify-app-editor-heading {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 11px;
  align-items: center;
}

.beautify-app-editor-heading strong,
.beautify-app-editor-heading small {
  display: block;
}

.beautify-app-editor-heading small {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
}

.beautify-app-editor-heading button {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #40594b;
  background: rgba(255, 253, 243, 0.82);
}

.beautify-app-icon-large {
  width: 48px;
  height: 48px;
}

.beautify-app-icon-large img {
  width: 30px;
  height: 30px;
}

.app-look-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(91, 121, 100, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 247, 0.56);
}

.app-icon-uploader {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 10px;
  align-items: center;
}

.app-icon-preview {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border: 1px solid rgba(78, 105, 87, 0.16);
  border-radius: 17px;
  background: rgba(246, 244, 229, 0.86);
  box-shadow: 0 8px 18px rgba(45, 64, 52, 0.1);
}

.app-icon-preview img {
  width: 40px;
  height: 40px;
  object-fit: cover;
}

.app-icon-uploader > button,
.app-theme-heading > button {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #40594b;
  background: rgba(255, 253, 243, 0.78);
}

.app-icon-uploader > button:disabled {
  cursor: default;
  opacity: 0.42;
}

.app-icon-upload-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.app-theme-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.app-theme-heading > span,
.app-theme-heading strong,
.app-theme-heading small {
  display: block;
}

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

.app-theme-card {
  display: grid;
  grid-template-columns: 68px 1fr;
  grid-template-rows: auto auto;
  gap: 3px 10px;
  align-items: center;
  min-height: 88px;
  padding: 10px;
  border: 1px solid rgba(78, 105, 87, 0.15);
  border-radius: 8px;
  color: #31483b;
  background: rgba(255, 255, 250, 0.76);
  text-align: left;
}

.app-theme-card.active {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(127, 181, 154, 0.24);
}

.app-theme-card strong,
.app-theme-card small {
  min-width: 0;
}

.app-theme-card small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.app-theme-demo {
  grid-row: 1 / 3;
  display: grid;
  align-content: center;
  gap: 5px;
  width: 68px;
  height: 54px;
  padding: 8px;
  border: 1px solid rgba(42, 55, 47, 0.1);
  border-radius: 7px;
  background: #f3f1e7;
}

.app-theme-demo i {
  display: block;
  height: 7px;
  border-radius: 4px;
  background: #fff;
}

.app-theme-demo i:nth-child(2) {
  width: 74%;
  margin-left: auto;
  background: #9fdaa0;
}

.app-theme-card-qq .app-theme-demo {
  background: #eef7ff;
}

.app-theme-card-qq .app-theme-demo i:nth-child(2) {
  background: #56b8f5;
}

.app-theme-card-instagram .app-theme-demo {
  border-color: #e36b9a;
  background: #fff;
}

.app-theme-card-instagram .app-theme-demo i:nth-child(2) {
  background: #4b9de8;
}

.app-theme-card-x .app-theme-demo {
  border-color: #111;
  background: #fff;
}

.app-theme-card-x .app-theme-demo i {
  background: #eff3f4;
}

.app-theme-card-x .app-theme-demo i:nth-child(2) {
  background: #111;
}

.style-option {
  border-radius: 8px;
  text-align: left;
}

.swatch {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 253, 243, 0.9);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px rgba(55, 79, 64, 0.18);
}

.swatch.active {
  box-shadow: 0 0 0 3px rgba(127, 181, 154, 0.38);
}

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

.companion-row {
  position: relative;
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 243, 0.66);
}

.companion-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(127, 181, 154, 0.15);
}

.companion-icon img {
  width: 26px;
  height: 26px;
}

.companion-copy {
  display: grid;
  gap: 3px;
}

.companion-copy small {
  color: var(--muted);
  line-height: 1.45;
}

.companion-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.app-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.app-row-actions button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  color: #40594b;
  background: rgba(255, 253, 243, 0.76);
}

.app-picker-row.is-required {
  background: rgba(255, 253, 243, 0.82);
}

.app-picker-row {
  grid-template-columns: 46px 1fr auto;
}

.required-pill {
  display: grid;
  place-items: center;
  min-width: 46px;
  min-height: 26px;
  border: 1px solid rgba(127, 181, 154, 0.34);
  border-radius: 999px;
  color: #47715b;
  background: rgba(127, 181, 154, 0.14);
  font-size: 12px;
}

.toggle-visual {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: rgba(91, 113, 98, 0.22);
  transition: background 0.18s ease;
}

.toggle-visual::after {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  margin: 3px;
  border-radius: 50%;
  background: #fffdf3;
  transition: transform 0.18s ease;
}

.companion-row input:checked + .toggle-visual {
  background: var(--green);
}

.companion-row input:checked + .toggle-visual::after {
  transform: translateX(18px);
}

.feature-switch {
  position: relative;
  display: block;
  width: 44px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(91, 121, 100, 0.2);
  border-radius: 999px;
  background: rgba(255, 253, 243, 0.84);
  cursor: pointer;
}

.feature-switch input {
  position: absolute;
  opacity: 0;
}

.feature-switch-track {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: rgba(91, 113, 98, 0.22);
  transition: background 0.18s ease;
}

.feature-switch-track::after {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  margin: 2px;
  border-radius: 50%;
  background: #fffdf3;
  box-shadow: 0 2px 6px rgba(47, 63, 50, 0.22);
  transition: transform 0.18s ease;
}

.feature-switch input:checked + .feature-switch-track {
  background: var(--green);
}

.feature-switch input:checked + .feature-switch-track::after {
  transform: translateX(18px);
}

.app-config-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.setting-row,
.setting-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(78, 105, 87, 0.15);
  border-radius: 8px;
  background: rgba(255, 253, 243, 0.66);
}

.setting-row > span,
.setting-field > span,
.setting-group-title {
  display: grid;
  gap: 3px;
}

.setting-row strong,
.setting-field strong,
.setting-group-title strong {
  color: #31483b;
  font-size: 14px;
}

.setting-row small,
.setting-field small,
.setting-group-title small {
  color: var(--muted);
  line-height: 1.45;
}

.setting-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.setting-row input[type="checkbox"]:checked + .toggle-visual {
  background: var(--green);
}

.setting-row input[type="checkbox"]:checked + .toggle-visual::after {
  transform: translateX(18px);
}

.setting-row.is-disabled {
  opacity: 0.72;
}

.setting-field select,
.setting-field input[type="number"],
.setting-field textarea {
  min-width: 150px;
  border: 1px solid rgba(91, 121, 100, 0.24);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: rgba(255, 255, 247, 0.88);
  outline: none;
}

.setting-field-wide {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.setting-field textarea {
  min-width: 0;
  width: 100%;
  resize: vertical;
  line-height: 1.6;
}

.setting-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(78, 105, 87, 0.15);
  border-radius: 8px;
  background: rgba(255, 253, 243, 0.58);
}

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

.mini-check-grid label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid rgba(91, 121, 100, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 247, 0.62);
  color: #40594b;
  font-size: 13px;
}

.mini-check-grid input {
  width: 15px;
  height: 15px;
  accent-color: var(--green);
}

.save-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(127, 181, 154, 0.18), rgba(207, 182, 111, 0.14));
}

.save-card span {
  color: var(--muted);
}

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

.install-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.storage-card {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 243, 0.64);
}

.storage-card > div {
  display: grid;
  gap: 3px;
}

.storage-card span {
  color: var(--muted);
  font-size: 12px;
}

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

.storage-card dl div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.storage-card dt {
  color: var(--muted);
  font-size: 10px;
}

.storage-card dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.storage-card.storage-error,
.storage-card.storage-warning {
  border-color: rgba(184, 104, 92, 0.34);
  background: rgba(255, 241, 233, 0.7);
}

.action-grid button:disabled {
  cursor: default;
  opacity: 0.45;
}

.action-grid button,
.import-button {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 243, 0.72);
  color: #40594b;
  text-align: center;
}

.action-grid .primary-action {
  border-color: transparent;
  background: var(--green);
  color: #fffdf3;
}

.flow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.builder-step-summary,
.builder-tool-heading,
.builder-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  color: #3d5d49;
}
.builder-step-summary {
  padding: 10px 12px;
  border: 1px solid rgba(74, 112, 87, .16);
  border-radius: 6px;
  background: #f4f8f1;
  font-size: 12px;
}
.builder-step-summary span,
.builder-tool-heading small,
.builder-list-heading small { color: #76857b; font-size: 10px; }
.builder-tool-heading,
.builder-list-heading { margin: 15px 0 8px; }
.builder-tool-heading strong,
.builder-list-heading strong { font-size: 12px; }
.builder-tool-list {
  border: 1px solid rgba(53, 94, 70, .2);
  background: #f1f7f0;
}
.builder-tool-list .companion-row { background: transparent; }
.ai-tool-icon {
  color: #fff;
  background: #47745c;
  font-size: 11px;
  font-weight: 700;
}

.advanced-settings-section { margin-top: 16px; }
.advanced-settings-toggle {
  display: grid;
  width: 100%;
  min-height: 58px;
  grid-template-columns: minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(67, 94, 76, .17);
  border-radius: 7px;
  color: #365442;
  background: rgba(255, 253, 247, .72);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.advanced-settings-toggle > span:first-child { display: grid; gap: 3px; min-width: 0; }
.advanced-settings-toggle strong { font-size: 12px; }
.advanced-settings-toggle small { color: #79877e; font-size: 10px; }
.advanced-settings-meta { color: #678070; font-size: 10px; white-space: nowrap; }
.advanced-settings-toggle b { font-size: 16px; transition: transform .18s ease; }
.advanced-settings-section.is-open .advanced-settings-toggle b { transform: rotate(180deg); }
.advanced-settings-content { margin-top: 8px; }
.advanced-settings-content .custom-app-builder-card { margin-top: 0; }

.sticky-flow-actions {
  position: sticky;
  bottom: -1px;
  z-index: 3;
  margin-top: 18px;
  padding: 10px 0 2px;
  background: linear-gradient(to bottom, rgba(255,253,247,0), #fffdf7 20%);
}

.completion-checklist {
  display: grid;
  margin-top: 14px;
  border-top: 1px solid rgba(65, 91, 73, .14);
}
.completion-checklist div {
  display: flex;
  min-height: 45px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(65, 91, 73, .12);
  color: #68796e;
  font-size: 12px;
}
.completion-checklist strong { color: #304b3a; font-size: 12px; text-align: right; }
.completion-actions { display: grid; gap: 8px; margin-top: 18px; }
.completion-actions button {
  min-height: 45px;
  border: 1px solid rgba(52,86,65,.18);
  border-radius: 6px;
  color: #3d5d49;
  background: #fffdf7;
  font: inherit;
  cursor: pointer;
}
.completion-actions button.primary-action { color: #fff; background: #78b092; }
.completion-actions button:disabled { cursor: wait; opacity: .6; }
.export-result { margin-top: 10px; padding: 9px 11px; border-radius: 5px; color: #496655; background: #eef6ed; font-size: 11px; }
.export-result.is-error { color: #8b3d3d; background: #fff0ed; }

.flow-actions button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 13px;
  color: #40594b;
  background: rgba(255, 253, 243, 0.78);
}

.flow-actions .primary-action {
  border-color: transparent;
  color: #fffdf3;
  background: var(--green);
}

@media (max-width: 520px) {
  .template-grid,
  .form-grid,
  .icon-style-grid,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .widget-config-row,
  .beautify-app-editor-heading {
    grid-template-columns: 1fr;
  }

  .widget-config-list {
    grid-template-columns: 1fr;
  }


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

  .beautify-app-editor-heading {
    justify-items: start;
  }

  .app-icon-uploader,
  .app-theme-heading {
    grid-template-columns: 1fr;
  }

  .app-theme-grid {
    grid-template-columns: 1fr;
  }
}

.ai-provider-picker {
  display: grid;
  gap: 14px;
}

.ai-provider-picker > section {
  display: grid;
  gap: 8px;
}

.ai-provider-picker > section > strong {
  color: #496052;
  font-size: 12px;
}

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

.ai-provider-checks label {
  position: relative;
  min-width: 0;
}

.ai-provider-checks input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ai-provider-checks span {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid rgba(83, 108, 92, 0.18);
  border-radius: 8px;
  color: #405448;
  background: rgba(255, 253, 243, 0.66);
  cursor: pointer;
}

.ai-provider-checks b {
  font-size: 12px;
  font-weight: 600;
}

.ai-provider-checks small {
  overflow: hidden;
  color: #75847a;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-provider-checks input:checked + span {
  border-color: #79af93;
  background: rgba(221, 239, 227, 0.74);
  box-shadow: inset 3px 0 #79af93;
}

@media (max-width: 520px) {
  .ai-provider-checks {
    grid-template-columns: 1fr;
  }
}

.beautify-package-toolbar {
  display: block;
  padding: 9px 10px;
  border: 1px solid rgba(78, 105, 87, 0.14);
  border-radius: 8px;
  background: rgba(255, 253, 243, 0.56);
}

.beautify-package-toolbar summary {
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.beautify-package-toolbar[open] summary {
  margin-bottom: 9px;
}

.beautify-package-toolbar button,
.custom-entry-card,
.custom-widget-entry,
.custom-add-button,
.package-actions button,
.customization-drawer button {
  border: 1px solid rgba(78, 105, 87, 0.18);
  border-radius: 8px;
  color: #40594b;
  background: rgba(255, 253, 243, 0.82);
}

.beautify-package-toolbar button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.custom-entry-chip {
  border-style: dashed;
}

.custom-swatch {
  display: grid;
  place-items: center;
  border-style: dashed;
  color: #4c6b59;
  background: rgba(255, 253, 243, 0.76);
  font-size: 20px;
}

.custom-entry-card,
.custom-widget-entry {
  border-style: dashed;
}

.custom-entry-symbol {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px dashed rgba(70, 103, 83, 0.42);
  border-radius: 8px;
  color: #4e765f;
  font-size: 24px;
  font-style: normal;
}

.custom-widget-entry {
  grid-template-columns: 48px 1fr;
  grid-template-rows: 1fr;
  align-items: center;
  min-height: 96px;
  text-align: left;
}

.custom-widget-entry > span:last-child {
  display: grid;
  gap: 5px;
}

.customization-drawer {
  position: fixed;
  z-index: 40;
  top: 0;
  bottom: 0;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  left: 0;
  display: flex;
  flex-direction: column;
  width: min(500px, 50vw);
  min-width: 420px;
  padding: 18px;
  border-right: 1px solid rgba(55, 79, 64, 0.2);
  background: #f8f8ef;
  box-shadow: 18px 0 44px rgba(40, 59, 47, 0.16);
  overflow: hidden;
}

.customization-drawer-header {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
}

.customization-drawer-header > button {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 18px;
}

.customization-drawer-header > span {
  display: grid;
  gap: 2px;
}

.customization-drawer-header small,
.customization-drawer-description,
.custom-field small,
.custom-empty,
.package-preview p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.customization-drawer-header strong {
  font-size: 17px;
}

.developer-toggle {
  position: relative;
}

.developer-toggle input {
  position: absolute;
  opacity: 0;
}

.developer-toggle span {
  display: block;
  padding: 7px 9px;
  border: 1px solid rgba(78, 105, 87, 0.18);
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.developer-toggle input:checked + span {
  border-color: var(--green);
  color: #2f5c46;
  background: rgba(127, 181, 154, 0.16);
}

.customization-drawer-description {
  margin: 10px 0 14px;
}

.customization-drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  padding-right: 5px;
  overflow: auto;
}

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

.custom-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin-bottom: 10px;
}

.custom-field > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #40594b;
  font-size: 12px;
}

.custom-field input,
.custom-field select,
.custom-field textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(78, 105, 87, 0.2);
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fffdf6;
}

.custom-field input[type="color"] {
  height: 42px;
  padding: 4px;
}

.custom-field input[type="range"] {
  padding: 8px 0;
  accent-color: var(--green);
}

.custom-field textarea {
  resize: vertical;
  font-family: Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.custom-field-wide {
  grid-column: 1 / -1;
}

.custom-icon-list,
.custom-widget-list {
  display: grid;
  gap: 8px;
}

.custom-icon-row {
  display: grid;
  grid-template-columns: 38px 1fr auto auto;
  gap: 8px;
  align-items: center;
  min-height: 52px;
  padding: 7px;
  border-bottom: 1px solid rgba(78, 105, 87, 0.12);
}

.custom-icon-row > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(127, 181, 154, 0.12);
}

.custom-icon-row img {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  object-fit: cover;
}

.custom-icon-row i {
  width: 15px;
  height: 15px;
  border: 1px dashed rgba(78, 105, 87, 0.42);
  border-radius: 4px;
}

.custom-icon-row label,
.package-actions label {
  position: relative;
  padding: 7px 9px;
  border: 1px solid rgba(78, 105, 87, 0.18);
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
}

.custom-icon-row input,
.package-actions input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.custom-icon-row button {
  padding: 7px 9px;
  font-size: 12px;
}

.custom-icon-row button:disabled {
  opacity: 0.4;
}

.custom-widget-editor {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(78, 105, 87, 0.15);
}

.custom-widget-editor header,
.custom-app-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.custom-widget-editor header button {
  padding: 6px 8px;
  color: #a05555;
  font-size: 11px;
}

.custom-widget-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 12px;
  padding: 3px;
  border: 1px solid rgba(78, 105, 87, 0.14);
  border-radius: 8px;
  background: rgba(225, 234, 224, 0.52);
}

.custom-widget-tabs button {
  min-height: 34px;
  border: 0;
  background: transparent;
  font-size: 12px;
}

.custom-widget-tabs button.active {
  color: #264f3b;
  background: #fffdf6;
  box-shadow: 0 1px 5px rgba(44, 68, 53, 0.1);
}

.custom-widget-tabs button:disabled {
  opacity: 0.42;
}

.custom-widget-instance-list {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 4px;
  overflow-x: auto;
}

.custom-widget-instance-list button {
  flex: 0 0 auto;
  display: grid;
  gap: 1px;
  min-width: 92px;
  padding: 7px 9px;
  text-align: left;
}

.custom-widget-instance-list button.active {
  border-color: var(--green);
  background: rgba(127, 181, 154, 0.13);
}

.custom-widget-instance-list small,
.custom-widget-template-card small,
.custom-widget-template-hint,
.custom-widget-editor-toolbar small,
.custom-widget-image-upload small,
.custom-code-mode-toggle small,
.custom-code-permissions small {
  color: var(--muted);
  font-size: 10px;
}

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

.custom-widget-template-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  min-height: 122px;
  padding: 9px;
  text-align: left;
}

.custom-widget-template-card strong,
.custom-widget-template-card small {
  overflow-wrap: anywhere;
}

.custom-widget-template-demo {
  position: relative;
  display: grid;
  place-items: center;
  height: 58px;
  border-radius: 7px;
  color: #315341;
  background: #dff2e8;
  overflow: hidden;
}

.custom-widget-template-demo i {
  position: absolute;
  right: 9px;
  bottom: 8px;
  width: 22px;
  height: 4px;
  border-radius: 4px;
  background: currentColor;
  opacity: 0.2;
}

.custom-widget-template-demo b { font-size: 18px; font-weight: 600; }
.template-weather .custom-widget-template-demo { color: #24495d; background: #dcecf5; }
.template-music .custom-widget-template-demo { color: #fff; background: #262a2d; }
.template-photo .custom-widget-template-demo { background: #f2e7dc; }
.template-character .custom-widget-template-demo { color: #4d3553; background: #f3e8f5; }
.template-anniversary .custom-widget-template-demo { color: #6a3e43; background: #f8e8e8; }
.template-actions .custom-widget-template-demo { color: #263746; background: #edf1f5; }
.template-mood .custom-widget-template-demo { color: #5c4930; background: #f9edcf; }
.template-note .custom-widget-template-demo { color: #514521; background: #fff2b8; }

.custom-widget-template-hint { margin: 10px 0 0; }

.custom-widget-editor-toolbar,
.custom-code-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(78, 105, 87, 0.14);
}

.custom-widget-editor-toolbar > span,
.custom-code-mode-toggle > span {
  display: grid;
  gap: 2px;
}

.custom-widget-editor-toolbar button {
  padding: 6px 9px;
  color: #9a4e4e;
}

.custom-widget-image-upload {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 2px 10px;
  align-items: center;
  min-height: 64px;
  padding: 8px;
  border: 1px dashed rgba(78, 105, 87, 0.28);
  border-radius: 8px;
  cursor: pointer;
}

.custom-widget-image-upload > span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 7px;
  background: rgba(127, 181, 154, 0.12);
  overflow: hidden;
}

.custom-widget-image-upload img { width: 100%; height: 100%; object-fit: cover; }
.custom-widget-image-upload i { font-size: 20px; font-style: normal; }
.custom-widget-image-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.custom-code-locked {
  padding: 18px;
  border: 1px dashed rgba(78, 105, 87, 0.28);
  border-radius: 8px;
  text-align: center;
}

.custom-code-locked p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

.custom-code-permissions {
  margin-bottom: 14px;
}

.custom-code-permissions header {
  display: grid;
  gap: 2px;
  margin-bottom: 7px;
}

.custom-code-permissions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.custom-code-permission {
  position: relative;
}

.custom-code-permission input {
  position: absolute;
  opacity: 0;
}

.custom-code-permission span {
  display: block;
  padding: 5px 7px;
  border: 1px solid rgba(78, 105, 87, 0.18);
  border-radius: 7px;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.custom-code-permission input:checked + span {
  border-color: var(--green);
  color: #28503c;
  background: rgba(127, 181, 154, 0.14);
}

.custom-code-field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.custom-code-field > span { color: #40594b; font-size: 12px; font-weight: 600; }
.custom-code-field textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid rgba(78, 105, 87, 0.2);
  border-radius: 7px;
  padding: 9px 10px;
  color: #dfe9e2;
  background: #1d2822;
  font: 11px/1.55 Consolas, monospace;
  tab-size: 2;
}

.custom-add-button {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 9px 12px;
  border-style: dashed;
  cursor: pointer;
}

.custom-validation,
.custom-drawer-status {
  min-height: 18px;
  margin: 4px 0 0;
  font-size: 11px;
}

.custom-validation.is-valid {
  color: #47715b;
}

.custom-validation.is-error,
.custom-drawer-status {
  color: #9a5a54;
}

.customization-drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(78, 105, 87, 0.14);
}

.customization-drawer-actions button {
  min-height: 38px;
  padding: 8px 12px;
}

.customization-drawer .primary-action {
  border-color: transparent;
  color: #fffdf3;
  background: var(--green);
}

body:has(.customization-drawer) {
  overflow: hidden;
}

.custom-drawer-status {
  margin: 6px 0 0;
  text-align: right;
}

.chat-appearance-studio {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(78, 105, 87, 0.14);
}

.custom-check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 52px;
  padding: 9px 10px;
  border: 1px solid rgba(78, 105, 87, 0.14);
  border-radius: 8px;
  background: rgba(255, 253, 243, 0.58);
}

.custom-check-row > span:first-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.custom-check-row strong {
  color: #314d3d;
  font-size: 12px;
}

.custom-check-row small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.chat-appearance-preview-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-appearance-preview-switch > span {
  color: #40594b;
  font-size: 11px;
  font-weight: 600;
}

.chat-appearance-preview-switch > div,
.chat-appearance-tabs {
  display: grid;
  padding: 3px;
  border-radius: 8px;
  background: rgba(225, 234, 224, 0.58);
}

.chat-appearance-preview-switch > div {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chat-appearance-preview-switch button,
.chat-appearance-tabs button {
  min-height: 32px;
  border: 0;
  padding: 5px 9px;
  color: #66776d;
  background: transparent;
  font-size: 10px;
}

.chat-appearance-preview-switch button.active,
.chat-appearance-tabs button.active {
  color: #264f3b;
  background: #fffdf6;
  box-shadow: 0 1px 5px rgba(44, 68, 53, 0.1);
}

.chat-appearance-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.settings-appearance-tabs,
.settings-appearance-preview-switch > div {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chat-appearance-panel {
  display: grid;
  gap: 10px;
}

.chat-bubble-color-section {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(78, 105, 87, 0.12);
}

.chat-bubble-color-section header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.chat-bubble-color-section header strong {
  color: #40594b;
  font-size: 12px;
}

.chat-bubble-color-section header small {
  color: var(--muted);
  font-size: 10px;
}

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

.package-actions button,
.package-actions label {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 8px 10px;
  text-align: center;
}

.package-preview {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(78, 105, 87, 0.14);
}

.package-preview > span {
  color: var(--muted);
  font-size: 11px;
}

.package-preview h4 {
  margin: 5px 0 10px;
}

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

.package-preview dl div {
  padding: 8px;
  background: rgba(255, 253, 243, 0.72);
}

.package-preview dt {
  color: var(--muted);
  font-size: 10px;
}

.package-preview dd {
  margin: 3px 0 0;
  font-size: 12px;
}

.package-preview button {
  min-height: 38px;
  padding: 8px 12px;
}

@media (max-width: 900px) {
  .builder-pane {
    backdrop-filter: none;
  }

  .customization-drawer {
    width: min(500px, 100vw);
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .custom-field-grid,
  .custom-color-grid,
  .package-actions {
    grid-template-columns: 1fr;
  }

  .custom-widget-template-grid {
    grid-template-columns: 1fr;
  }
}

.custom-app-media-studio {
  display: grid;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid rgba(47, 67, 55, 0.12);
  border-bottom: 1px solid rgba(47, 67, 55, 0.12);
}

.custom-app-media-studio > header {
  display: grid;
  gap: 2px;
}

.custom-app-media-studio > header small {
  color: #718078;
  font-size: 11px;
}

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

.custom-app-media-card {
  display: grid;
  min-width: 0;
  gap: 7px;
  align-content: start;
}

.custom-app-media-preview {
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 3;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(47, 67, 55, 0.16);
  border-radius: 7px;
  color: #839088;
  background: #f2f4ed;
  font-size: 10px;
}

.custom-app-media-preview.is-square {
  width: 58px;
  aspect-ratio: 1;
}

.custom-app-media-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.custom-app-media-card > strong {
  overflow-wrap: anywhere;
  font-size: 11px;
}

.custom-app-media-card > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.custom-app-media-card label,
.custom-app-media-card button {
  display: inline-grid;
  min-height: 30px;
  padding: 0 9px;
  place-items: center;
  border: 1px solid rgba(47, 67, 55, 0.16);
  border-radius: 6px;
  color: #294536;
  background: #fffdf7;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.custom-app-media-card input {
  display: none;
}

.custom-app-media-card button:disabled {
  cursor: default;
  opacity: 0.42;
}

.ai-assistant-root {
  position: fixed;
  left: 420px;
  top: 24px;
  z-index: 50;
  display: grid;
  width: min(444px, calc(100vw - 56px));
  justify-items: start;
}

.ai-assistant-root:not(.is-open):not(.has-pending) { width: 52px; }

.ai-assistant-fab {
  display: grid;
  width: 52px;
  height: 52px;
  align-items: center;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 50%;
  color: #fffdf6;
  background: #2f5a43;
  box-shadow: 0 10px 28px rgba(24, 54, 41, 0.26);
  font: 700 12px/1 inherit;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.ai-assistant-root.is-open .ai-assistant-fab { display: none; }

.ai-assistant-fab span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  font: 700 13px/1 Arial, sans-serif;
}

.ai-assistant-connection {
  display: grid;
  gap: 10px;
  padding: 14px;
  overflow: auto;
  background: #fbfcf7;
}

.ai-assistant-connection-intro { display: grid; gap: 3px; }
.ai-assistant-connection-intro strong { color: #294b38; font-size: 13px; }
.ai-assistant-connection-intro small { color: #718078; font-size: 10px; line-height: 1.5; }
.ai-assistant-connection label { display: grid; gap: 5px; color: #496052; font-size: 11px; }
.ai-assistant-connection label span { display: flex; align-items: baseline; gap: 5px; font-weight: 700; }
.ai-assistant-connection label span small { color: #87938c; font-weight: 400; }
.ai-assistant-connection input,
.ai-assistant-connection select {
  width: 100%;
  min-height: 36px;
  box-sizing: border-box;
  padding: 7px 9px;
  border: 1px solid rgba(52, 86, 65, 0.2);
  border-radius: 6px;
  color: #30483a;
  background: #fffefa;
  font: inherit;
  font-size: 12px;
}
.ai-assistant-connection-status { min-height: 16px; margin: 0; color: #65776b; font-size: 10px; }
.ai-assistant-connection-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.ai-assistant-connection-actions button {
  min-height: 36px;
  border: 1px solid rgba(52, 86, 65, 0.18);
  border-radius: 6px;
  color: #3e5c49;
  background: #fffdf7;
  font: inherit;
  cursor: pointer;
}
.ai-assistant-connection-actions button.primary { border-color: #76a98c; color: #fff; background: #76a98c; }
.ai-assistant-connection-actions button:disabled { cursor: wait; opacity: .58; }

.ai-assistant-panel {
  display: grid;
  grid-row: 1;
  width: min(444px, calc(100vw - 56px));
  max-height: min(620px, calc(100vh - 170px));
  margin: 0 0 8px;
  overflow: hidden;
  border: 1px solid rgba(53, 82, 64, 0.18);
  border-radius: 10px;
  background: rgba(255, 253, 247, 0.98);
  box-shadow: 0 20px 54px rgba(29, 52, 39, 0.22);
}

.ai-assistant-pending-bar {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  padding: 9px;
  border: 1px solid rgba(47, 90, 67, 0.2);
  border-radius: 7px;
  background: #fffdf7;
  box-shadow: 0 14px 36px rgba(29, 52, 39, 0.2);
}

.ai-assistant-pending-bar span { display: grid; gap: 2px; min-width: 0; }
.ai-assistant-pending-bar strong { color: #294b38; font-size: 12px; }
.ai-assistant-pending-bar small { color: #748179; font-size: 10px; }
.ai-assistant-pending-bar button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(52, 86, 65, 0.18);
  border-radius: 6px;
  color: #3e5c49;
  background: #fff;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.ai-assistant-pending-bar button.primary { color: #fff; background: #76a98c; }

.ai-preview-status {
  position: absolute;
  top: 18px;
  left: 50%;
  z-index: 12;
  display: flex;
  transform: translateX(-50%);
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 6px;
  color: #173827;
  background: rgba(236, 248, 239, .94);
  box-shadow: 0 10px 28px rgba(5, 22, 15, .22);
  font-size: 11px;
  white-space: nowrap;
}
.ai-preview-status strong { font-size: 11px; }
.ai-preview-status span { color: #536b5d; }

.builder-pane.has-ai-draft .panel-host {
  opacity: .56;
  filter: saturate(.72);
}

.ai-assistant-panel[hidden] {
  display: none;
}

.ai-assistant-header {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border-bottom: 1px solid rgba(53, 82, 64, 0.12);
  background: #f4f7ef;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.ai-assistant-root.is-dragging .ai-assistant-header,
.ai-assistant-root.is-dragging .ai-assistant-fab { cursor: grabbing; }

.ai-assistant-header div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ai-assistant-header strong {
  color: #264635;
  font-size: 14px;
}

.ai-assistant-header small {
  overflow: hidden;
  color: #748179;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-assistant-header .ai-assistant-header-actions {
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}

.ai-assistant-header-actions button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  color: #53665b;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.ai-assistant-header-actions button[data-ai-assistant-configure],
.ai-assistant-header-actions button[data-ai-assistant-memory] {
  width: auto;
  padding: 0 7px;
  border: 1px solid rgba(65, 96, 74, 0.18);
  color: #486553;
  background: #fffdf7;
  font: inherit;
  font-size: 10px;
}

.ai-assistant-chat {
  display: grid;
  max-height: 260px;
  gap: 8px;
  padding: 12px;
  overflow: auto;
  align-content: start;
  background: #fbfcf7;
}

.ai-assistant-intent {
  width: fit-content;
  margin: 0 auto 2px;
  padding: 4px 8px;
  border: 1px solid rgba(67, 94, 76, .12);
  border-radius: 999px;
  color: #748179;
  background: rgba(255,255,255,.72);
  font-size: 9px;
}
.ai-assistant-intent.is-change { color: #2f6749; background: #e4f2e8; }
.ai-assistant-intent.is-clarify { color: #795e31; background: #f7efd9; }
.ai-assistant-intent.is-proposeWidget,
.ai-assistant-intent.is-generateWidget { color: #315d70; background: #e5f1f4; }

.ai-assistant-message {
  width: fit-content;
  max-width: 88%;
  padding: 9px 10px;
  border-radius: 8px;
  color: #34483b;
  background: #eef3ea;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.ai-assistant-message.is-user {
  justify-self: end;
  color: #173827;
  background: #d8ecdf;
}

.ai-assistant-message.is-loading {
  color: #78847d;
  font-size: 11px;
}

.ai-widget-proposal,
.ai-widget-review,
.ai-assistant-memory {
  display: grid;
  gap: 9px;
  padding: 12px;
  overflow: auto;
  border-top: 1px solid rgba(53, 82, 64, 0.1);
  background: #fffdf8;
}

.ai-widget-proposal header,
.ai-widget-review header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #315440;
  font-size: 12px;
}

.ai-widget-proposal header span,
.ai-widget-review header span {
  padding: 3px 6px;
  border-radius: 5px;
  color: #65776b;
  background: #edf2ea;
  font-size: 9px;
}

.ai-widget-review header span.is-safe { color: #276143; background: #dff1e6; }
.ai-widget-proposal p,
.ai-widget-proposal small,
.ai-widget-status { margin: 0; color: #65776b; font-size: 10px; line-height: 1.5; }
.ai-widget-status.is-error { margin: 0 12px; padding: 8px; color: #8a4c42; background: #faece8; }
.ai-widget-proposal dl,
.ai-widget-review dl { display: grid; grid-template-columns: 58px 1fr; gap: 4px 7px; margin: 0; font-size: 10px; }
.ai-widget-proposal dt,
.ai-widget-review dt { color: #829087; }
.ai-widget-proposal dd,
.ai-widget-review dd { margin: 0; color: #40594a; }
.ai-widget-proposal > div { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.ai-widget-proposal button,
.ai-assistant-back,
.ai-assistant-memory-add button {
  min-height: 33px;
  border: 1px solid rgba(52, 86, 65, 0.18);
  border-radius: 6px;
  color: #3e5c49;
  background: #fff;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.ai-widget-proposal button.primary,
.ai-assistant-memory-add button.primary { color: #fff; background: #76a98c; border-color: #76a98c; }
.ai-widget-proposal button:disabled { opacity: .55; cursor: wait; }
.ai-widget-review details { color: #53665b; font-size: 10px; }
.ai-widget-review summary { cursor: pointer; }
.ai-widget-review pre { max-height: 130px; padding: 7px; overflow: auto; border-radius: 5px; color: #33483c; background: #f0f3ed; white-space: pre-wrap; }

.ai-assistant-memory { max-height: 500px; }
.ai-assistant-memory-intro { display: grid; gap: 3px; }
.ai-assistant-memory-intro strong { color: #294b38; font-size: 13px; }
.ai-assistant-memory-intro small { color: #718078; font-size: 10px; line-height: 1.5; }
.ai-assistant-memory-group { display: grid; gap: 5px; padding-top: 7px; border-top: 1px solid rgba(53,82,64,.08); }
.ai-assistant-memory-group > strong { color: #496052; font-size: 11px; }
.ai-assistant-memory-group > small { color: #919a94; font-size: 10px; }
.ai-assistant-memory-group ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.ai-assistant-memory-group li { display: grid; grid-template-columns: 1fr 24px; align-items: center; gap: 5px; min-height: 30px; padding: 4px 4px 4px 8px; border-radius: 5px; color: #4d6255; background: #f1f4ed; font-size: 10px; }
.ai-assistant-memory-group li button { width: 24px; height: 24px; border: 0; color: #76847b; background: transparent; cursor: pointer; }
.ai-assistant-memory-add { display: grid; grid-template-columns: 92px minmax(0,1fr) 48px; gap: 5px; }
.ai-assistant-memory-add input,
.ai-assistant-memory-add select { min-width: 0; min-height: 34px; box-sizing: border-box; border: 1px solid rgba(52,86,65,.18); border-radius: 6px; color: #40594a; background: #fff; font: inherit; font-size: 10px; }

.ai-assistant-draft {
  padding: 10px 12px;
  border-top: 1px solid rgba(53, 82, 64, 0.1);
  background: #fffdf8;
}

.ai-assistant-draft header {
  display: flex;
  justify-content: space-between;
  color: #385844;
  font-size: 11px;
}

.ai-assistant-draft header span {
  color: #829087;
}

.ai-assistant-draft ul {
  display: grid;
  gap: 3px;
  margin: 7px 0 0;
  padding-left: 17px;
  color: #68776d;
  font-size: 11px;
}

.ai-assistant-draft-actions,
.ai-assistant-composer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 10px 12px 0;
}

.ai-assistant-draft-actions button,
.ai-assistant-composer button,
.ai-assistant-suggestions button {
  min-height: 32px;
  border: 1px solid rgba(52, 86, 65, 0.18);
  border-radius: 6px;
  color: #3e5c49;
  background: #fffdf7;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.ai-assistant-draft-actions .primary,
.ai-assistant-composer .primary {
  border-color: #76a98c;
  color: #fff;
  background: #76a98c;
}

.ai-assistant-draft-actions button:disabled,
.ai-assistant-composer button:disabled {
  cursor: default;
  opacity: 0.48;
}

.ai-assistant-suggestions {
  display: flex;
  gap: 6px;
  padding: 10px 12px 0;
  overflow: auto;
  scrollbar-width: none;
}

.ai-assistant-suggestions::-webkit-scrollbar { display: none; }

.ai-assistant-suggestions button {
  min-width: 132px;
  min-height: 29px;
  padding: 5px 7px;
  color: #627368;
  background: #f7f8f2;
  text-align: left;
  white-space: normal;
}

.ai-assistant-composer {
  grid-template-columns: 36px minmax(0, 1fr) 48px;
  align-items: end;
  padding: 10px 12px 12px;
}

.ai-assistant-composer.is-dragover {
  background: #e8f3eb;
  outline: 1px dashed #6e9f83;
  outline-offset: -5px;
}

.ai-assistant-attach {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(52, 86, 65, 0.18);
  border-radius: 50%;
  color: #42614f;
  background: #fffdf7;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.ai-assistant-attach input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.ai-assistant-attachments {
  display: grid;
  max-height: 190px;
  gap: 6px;
  padding: 10px 12px 0;
  overflow: auto;
  border-top: 1px solid rgba(53, 82, 64, .08);
}

.ai-attachment-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 6px;
  border: 1px solid rgba(52, 86, 65, .13);
  border-radius: 7px;
  background: #f6f8f2;
}

.ai-attachment-preview {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  color: #607267;
  background: #e5ebe3;
  font-size: 9px;
}

.ai-attachment-preview img { width: 100%; height: 100%; object-fit: cover; }
.ai-attachment-copy { display: grid; min-width: 0; gap: 2px; }
.ai-attachment-copy strong { overflow: hidden; color: #344e3e; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ai-attachment-copy small { color: #7b887f; font-size: 9px; line-height: 1.35; }
.ai-attachment-copy button { width: fit-content; padding: 2px 6px; border: 1px solid rgba(52,86,65,.16); border-radius: 5px; color: #3e664e; background: #fff; font: inherit; font-size: 9px; cursor: pointer; }
.ai-attachment-remove { width: 26px; height: 26px; border: 0; color: #718077; background: transparent; font-size: 16px; cursor: pointer; }
.ai-attachment-error { margin: 8px 12px 0; padding: 7px 8px; border-radius: 5px; color: #8a463e; background: #faebe7; font-size: 10px; line-height: 1.4; }

.ai-assistant-composer textarea {
  width: 100%;
  min-height: 48px;
  resize: vertical;
  border: 1px solid rgba(52, 86, 65, 0.18);
  border-radius: 6px;
  color: #30483a;
  background: #fffefa;
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .ai-assistant-root {
    position: fixed;
    inset: auto 12px 12px 12px !important;
    width: calc(100vw - 24px);
  }
  .ai-assistant-panel {
    width: 100%;
    max-height: min(72vh, 620px);
    margin: 0;
    border-radius: 10px 10px 4px 4px;
  }
  .ai-preview-status {
    top: 8px;
    max-width: calc(100% - 24px);
    white-space: normal;
  }
}

.custom-app-builder-card { margin-top:16px; padding:16px; border:1px solid rgba(86,117,93,.2); border-radius:8px; background:#fffef8; }
.custom-app-builder-card .section-heading { margin-bottom:12px; }
.custom-app-summary { display:grid; grid-template-columns:90px 1fr; gap:8px 12px; margin:0 0 12px; font-size:12px; }
.custom-app-summary dt { color:#58715d; }.custom-app-summary dd { margin:0; color:#33463a; overflow-wrap:anywhere; }
.file-action { display:inline-flex; align-items:center; cursor:pointer; }
.empty-state { color:#718075; font-size:13px; }
.custom-app-agent-guide { margin-top:12px; padding:12px; border:1px solid rgba(86,117,93,.18); border-radius:6px; background:#f4f8f1; }
.custom-app-agent-guide strong { display:block; margin-bottom:8px; color:#385444; font-size:12px; }
.custom-app-agent-guide textarea { width:100%; min-height:210px; resize:vertical; box-sizing:border-box; padding:10px; border:1px solid rgba(86,117,93,.22); border-radius:5px; background:#fffefa; color:#30483a; font:12px/1.55 ui-monospace,Consolas,monospace; }
.custom-app-agent-guide a { align-self:center; color:#477a5e; font-size:12px; }
