/* Drawing appearance shares the existing inspector column with generation settings. */
#page-create-detail .canvas-style-controls {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 18px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 49px;
}
#page-create-detail .canvas-style-controls > [data-style-context] {
  font-size: 11px;
  color: var(--fg-muted);
  white-space: nowrap;
}
#page-create-detail .cp-strip-open {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 10px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}
.cp-strip-open i {
  width: 15px;
  height: 15px;
  border: 1px solid #aaa6;
  border-radius: 4px;
}
.cp-strip-open small {
  font-size: 10px;
  color: var(--fg-muted);
}
.cp-strip-open b {
  font-size: 11px;
  font-weight: 400;
  color: var(--fg-muted);
}
#page-create-detail .canvas-style-controls > p {
  margin: 0;
  font-size: 11px;
  color: var(--fg-dim);
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.studio-ready #page-create-detail .cr-side--right {
  width: 294px;
  flex: 0 0 294px;
  min-width: 0;
  display: flex;
  overflow: visible;
}
.studio-ready #page-create-detail .cr-side--right[data-open="false"] {
  width: 28px;
  flex-basis: 28px;
}
#page-create-detail .cr-side--right[data-open="false"] .canvas-inspector {
  display: none;
}
#page-create-detail .canvas-inspector {
  display: flex;
  flex: 1;
  min-width: 0;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  overflow: hidden;
}
#page-create-detail .canvas-inspector [hidden] {
  display: none !important;
}
.cp-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#page-create-detail .cp-tabs > button {
  border: 0;
  background: transparent;
  color: var(--fg-muted);
  font: inherit;
  font-size: 12px;
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
}
#page-create-detail .cp-tabs > button.active {
  background: var(--bg-soft);
  color: var(--fg);
  font-weight: 600;
}
#page-create-detail .cp-tabs [data-close-inspector] {
  display: none;
  margin-left: auto;
  font-size: 20px;
  padding: 4px 8px;
}
#page-create-detail .canvas-properties {
  padding: 0 17px 28px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  font-size: 12px;
  color: var(--fg);
  background: var(--bg-card);
}
#page-create-detail .canvas-inspector #paramsPanel {
  flex: 1;
  width: 100%;
  min-width: 0;
  overflow-y: auto;
  min-height: 0;
  max-height: none;
  padding: 18px;
  box-sizing: border-box;
  display: block;
  transform: none;
  position: static;
  opacity: 1;
}
.cp-context {
  padding: 18px 0 15px;
  border-bottom: 1px solid var(--border);
}
.cp-context strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}
.cp-context span {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  color: var(--fg-muted);
  line-height: 1.7;
}
.cp-section {
  padding: 17px 0;
  border-bottom: 1px solid var(--border);
}
.cp-section:last-child {
  border: 0;
}
.cp-section h3 {
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--fg);
}
.cp-color-row {
  display: flex;
  gap: 7px;
  align-items: center;
}
.cp-color-well {
  padding: 3px !important;
  width: 34px !important;
  height: 34px;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  background: var(--bg-card) !important;
  flex-shrink: 0;
  cursor: pointer;
}
.cp-color-well i {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background-color: transparent;
  background-image:
    linear-gradient(45deg, #a8afa52a 25%, transparent 25%),
    linear-gradient(-45deg, #a8afa52a 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #a8afa52a 75%),
    linear-gradient(-45deg, transparent 75%, #a8afa52a 75%);
  background-size: 8px 8px;
  background-position:
    0 0,
    0 4px,
    4px -4px,
    -4px 0;
  box-shadow: inset 0 0 0 1px #45506216;
}
.cp-color-well i.is-mixed {
  background: linear-gradient(135deg, #edeff2 50%, #6a7079 50%) !important;
}
#page-create-detail .cp-hex {
  flex: 1;
  min-width: 0;
  width: 0;
  padding: 8px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  font:
    12px/1.4 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  text-transform: uppercase;
}
#page-create-detail .cp-none {
  width: 32px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg-muted);
  font-size: 20px;
  cursor: pointer;
}
#page-create-detail .cp-none.active {
  border-color: #8f9aac;
  background: #e8ecf3;
  color: #414f67;
}
.cp-quick-colors {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  margin-top: 11px;
}
#page-create-detail .cp-quick-colors button,
.canvas-color-popover [data-picker-color] {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  padding: 0;
  border-radius: 5px;
  background: var(--cp-color);
  border: 1px solid #5c636e29;
  cursor: pointer;
  box-shadow: 0 0 0 2px transparent;
  transition:
    transform 0.12s,
    box-shadow 0.12s;
}
#page-create-detail .cp-quick-colors button[aria-pressed="true"],
.canvas-color-popover [data-picker-color].active {
  box-shadow:
    0 0 0 2px var(--bg-card),
    0 0 0 3px #7c8799;
}
.cp-width-row {
  margin: 14px 0 9px;
}
.cp-number {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 11px;
  color: var(--fg-muted);
}
#page-create-detail .cp-number input {
  width: 67px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 8px;
  font: inherit;
  font-size: 12px;
  color: var(--fg);
  background: var(--bg);
}
.cp-segment {
  display: flex;
  gap: 5px;
  margin-top: 10px;
}
#page-create-detail .cp-segment button {
  flex: 1;
  min-width: 0;
  min-height: 35px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--fg-muted);
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}
#page-create-detail .cp-segment button.active {
  border-color: #949fb2;
  background: #eceff4;
  color: #414e64;
}
#page-create-detail .cp-segment svg {
  display: block;
  width: 24px;
  height: 20px;
  flex-shrink: 0;
  pointer-events: none;
}
#page-create-detail [data-join-row] .cp-segment button {
  min-height: 68px;
  padding: 8px 3px;
}
#page-create-detail [data-join-row] .cp-segment svg {
  width: 42px;
  height: 38px;
}
.cp-join-preview {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--fg);
}
.cp-join-preview svg {
  width: 100%;
  max-width: 205px;
  height: 84px;
  overflow: visible;
}
.cp-join-preview span {
  font-size: 11px;
  color: var(--fg-muted);
}
.cp-join-note {
  font-size: 10px;
  line-height: 1.7;
  color: var(--fg-muted);
  margin: 9px 0 0;
}
.cp-subtitle {
  display: block;
  font-size: 11px;
  color: var(--fg-muted);
  margin: 13px 0 6px;
}
.cp-section [data-radius-row] {
  margin-top: 14px;
}
#page-create-detail .canvas-properties input[type="range"] {
  display: block;
  width: 100%;
  height: 23px;
  accent-color: #687790;
  background: transparent;
  margin: 10px 0 0;
  cursor: pointer;
}
.cp-opacity-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.cp-opacity-row > input {
  flex: 1;
  min-width: 0;
  margin: 0 !important;
}
.cp-opacity-row > label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--fg-muted);
  font-size: 10px;
}
#page-create-detail .cp-opacity-row input[type="number"] {
  width: 48px;
  padding: 7px 3px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--fg);
  font-size: 11px;
}
.cp-text-size {
  display: flex;
  gap: 8px;
  align-items: center;
}
.cp-text-size .cp-number {
  flex: 1;
}
.cp-text-size [data-bold] {
  width: 33px;
  height: 33px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--fg);
  font-weight: 700;
  cursor: pointer;
}
.cp-text-size [data-bold].active {
  background: #e6eaf2;
  border-color: #949fb2;
}
#page-create-detail .canvas-inspector :focus-visible,
.canvas-color-popover :focus-visible {
  outline: 2px solid #7a89a3;
  outline-offset: 2px;
}
#page-create-detail .canvas-inspector [aria-invalid="true"],
.canvas-color-popover [aria-invalid="true"] {
  border-color: #c95a4e !important;
}
.canvas-color-popover {
  position: fixed;
  z-index: 10100;
  width: 318px;
  padding: 16px;
  box-sizing: border-box;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  scrollbar-width: thin;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--bg-card);
  color: var(--fg);
  box-shadow: 0 15px 55px #1d242f26;
  font: 12px/1.5 var(--font-body, system-ui, sans-serif);
}
.canvas-color-popover[hidden] {
  display: none !important;
}
.canvas-color-popover header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.canvas-color-popover header strong {
  font-size: 13px;
  font-weight: 600;
}
.canvas-color-popover header button {
  border: 0;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--fg-muted);
  font-size: 19px;
  cursor: pointer;
}
.cp-sv {
  position: relative;
  height: 148px;
  width: 100%;
  border-radius: 8px;
  touch-action: none;
  cursor: crosshair;
  isolation: isolate;
}
.cp-sv:before,
.cp-sv:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
}
.cp-sv:before {
  background: linear-gradient(to right, #fff, transparent);
}
.cp-sv:after {
  background: linear-gradient(to top, #000, transparent);
}
.cp-sv > i {
  position: absolute;
  z-index: 1;
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 2px solid white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px #0008;
  pointer-events: none;
}
.canvas-color-popover .cp-hue {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 12px;
  border: 0;
  border-radius: 9px;
  margin: 17px 0;
  background: linear-gradient(to right, red, #ff0, #5474ab, #0ff, #00f, #f0f, red);
  cursor: pointer;
}
.cp-hue::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  border: 2px solid white;
  background: transparent;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #49515e80;
}
.cp-hue::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid white;
  background: transparent;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #49515e80;
}
.cp-picker-hex {
  display: grid;
  grid-template-columns: 1fr 83px;
  gap: 10px;
}
.cp-picker-hex label,
.cp-rgb label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10px;
  color: var(--fg-muted);
}
.canvas-color-popover input:not([type="range"]) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--fg);
  font:
    12px/1.4 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.cp-rgb {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
}
.cp-picker-palette {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 11px 8px;
  margin-top: 18px;
}
.canvas-color-popover [data-picker-color] {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
}
.cp-recent {
  margin-top: 18px;
}
.cp-recent > span {
  font-size: 10px;
  color: var(--fg-muted);
}
.cp-recent > div {
  display: flex;
  gap: 8px;
  min-height: 24px;
  margin-top: 9px;
}
.canvas-color-popover footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.canvas-color-popover footer button {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  color: var(--fg-muted);
  font: inherit;
  cursor: pointer;
}
.canvas-color-popover [data-picker-done] {
  background: #56647b;
  color: #fff;
  border-color: #56647b;
}
@media (max-width: 1100px) {
  .studio-ready #page-create-detail .cr-side--right {
    width: 278px;
    flex-basis: 278px;
  }
  #page-create-detail .canvas-properties {
    padding-inline: 14px;
  }
}
@media (max-width: 800px) {
  #page-create-detail .canvas-style-controls {
    padding: 8px 12px;
    gap: 10px;
    min-height: 47px;
  }
  #page-create-detail .canvas-style-controls > p {
    display: none;
  }
  #page-create-detail .cp-strip-open {
    min-height: 35px;
    padding: 7px 12px;
    font-size: 12px;
  }
  .studio-ready #page-create-detail .cr-side--right {
    display: none !important;
    position: fixed !important;
    inset: auto 0 calc(62px + env(safe-area-inset-bottom)) 0 !important;
    width: 100% !important;
    height: min(68dvh, 610px) !important;
    max-height: 68dvh;
    z-index: 145 !important;
    background: var(--bg-card);
    padding: 0 !important;
    border-radius: 18px 18px 0 0;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 -10px 45px #14182018;
  }
  .studio-ready #page-create-detail.st-params-open .cr-side--right {
    display: flex !important;
  }
  .studio-ready #page-create-detail .cr-side--right .cr-toggle {
    display: none !important;
  }
  #page-create-detail .canvas-inspector {
    border-left: 0;
    width: 100%;
    height: 100%;
  }
  .cp-tabs {
    padding: 10px 15px;
    gap: 8px;
  }
  #page-create-detail .cp-tabs > button {
    padding: 10px 15px;
  }
  #page-create-detail .cp-tabs [data-close-inspector] {
    display: block;
  }
  #page-create-detail .canvas-properties {
    padding: 0 20px 24px;
  }
  .cp-section {
    padding: 16px 0;
  }
  .cp-quick-colors {
    justify-content: flex-start;
    gap: 13px;
  }
  #page-create-detail .cp-quick-colors button {
    width: 25px;
    height: 25px;
    flex-basis: 25px;
  }
  #page-create-detail .canvas-inspector #paramsPanel {
    max-height: none !important;
    height: auto !important;
    flex: 1;
    padding: 18px 20px !important;
  }
  .studio-ready
    #page-create-detail.st-params-open
    .canvas-inspector
    #paramsPanel[hidden] {
    display: none !important;
  }
  .cp-color-row .cp-hex {
    max-width: none;
  }
  .cp-picker-palette {
    gap: 10px 8px;
  }
  #page-create-detail .cp-segment button {
    min-height: 41px;
    font-size: 11px;
    padding: 8px;
  }
  .cp-context span {
    font-size: 11px;
  }
  .cp-section h3 {
    font-size: 13px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cp-quick-colors button,
  .canvas-color-popover [data-picker-color] {
    transition: none;
  }
}
#page-create-detail .cp-color-well {
  position: relative;
  isolation: isolate;
}
.cp-color-well:before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 5px;
  z-index: -1;
  background-color: white;
  background-image:
    linear-gradient(45deg, #c2c5ca 25%, transparent 25%),
    linear-gradient(-45deg, #c2c5ca 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #c2c5ca 75%),
    linear-gradient(-45deg, transparent 75%, #c2c5ca 75%);
  background-size: 8px 8px;
  background-position:
    0 0,
    0 4px,
    4px -4px,
    -4px 0;
}
.cp-color-well i {
  background-image: none;
  position: relative;
}
