.seedream-doodle {
  width: min(1080px, calc(100vw - 24px));
  max-height: min(94vh, 980px);
  padding: 0;
  border: 1px solid #35506a;
  border-radius: 18px;
  background: #101b28;
  color: #edf5fc;
  box-shadow: 0 24px 80px #000a;
}
.seedream-doodle::backdrop { background: #02080dd9; backdrop-filter: blur(5px); }
.seedream-doodle-shell { display: grid; grid-template-rows: auto auto minmax(160px, 1fr) auto auto; gap: 14px; max-height: min(94vh, 980px); padding: 20px; box-sizing: border-box; }
.seedream-doodle header, .seedream-doodle footer, .seedream-doodle-tools { display: flex; align-items: center; gap: 10px; }
.seedream-doodle header { justify-content: space-between; }
.seedream-doodle header small { color: #83e4d9; font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.seedream-doodle h2 { margin: 3px 0 5px; font-size: 23px; }
.seedream-doodle header p { margin: 0; color: #aebfd0; font-size: 13px; }
.seedream-doodle button { min-height: 36px; padding: 6px 12px; border: 1px solid #3b5369; border-radius: 9px; background: #182a3a; color: #e5f1fb; cursor: pointer; }
.seedream-doodle button:hover, .seedream-doodle button:focus-visible { border-color: #83e4d9; outline: none; }
.seedream-doodle button[aria-pressed="true"] { border-color: #82dace; background: #1a4145; }
.seedream-doodle button:disabled { opacity: .5; cursor: not-allowed; }
.seedream-doodle [data-doodle-close] { width: 38px; padding: 0; font-size: 22px; }
.seedream-doodle-tools { flex-wrap: wrap; }
.seedream-doodle-tools button { width: 38px; height: 38px; min-height: 38px; padding: 8px; display: inline-grid; place-items: center; }
.seedream-doodle-tools button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.seedream-doodle-tool-divider { width: 1px; height: 25px; margin: 0 3px; background: #385064; }
.seedream-doodle-tools label { display: inline-flex; align-items: center; color: #c7d6e4; }
.seedream-doodle-tools [hidden] { display: none; }
.seedream-doodle-tools input[type="color"] { width: 36px; height: 32px; padding: 0; border: 0; background: none; }
.seedream-doodle-tools input[type="range"] { width: 96px; accent-color: #83e4d9; }
.seedream-doodle-image { position: relative; justify-self: center; max-width: 100%; max-height: min(54vh, 570px); overflow: hidden; border: 1px solid #36516a; border-radius: 10px; background: #0a111b; }
.seedream-doodle-image canvas { display: block; width: 100%; height: 100%; }
.seedream-doodle-image [data-doodle-ink] { position: absolute; inset: 0; touch-action: none; cursor: crosshair; }
.seedream-doodle-image [data-doodle-ink][data-tool="text"] { cursor: text; }
.seedream-doodle-image [data-doodle-inline-text] { position: absolute; z-index: 2; height: 29px; box-sizing: border-box; padding: 0 2px; border: 1px dashed #8ce1d8; border-radius: 3px; outline: none; background: #101b28b8; font: 600 20px/26px sans-serif; text-shadow: 1px 1px #101b28; }
.seedream-doodle-image [data-doodle-inline-text][hidden] { display: none; }
.seedream-doodle-prompt { display: grid; gap: 7px; font-size: 14px; font-weight: 600; }
.seedream-doodle-prompt textarea { width: 100%; min-height: 75px; padding: 10px 12px; box-sizing: border-box; resize: vertical; border: 1px solid #3b5369; border-radius: 9px; background: #0d1723; color: #f4f8fd; font: inherit; font-weight: 400; }
.seedream-doodle-prompt textarea:focus { border-color: #83e4d9; outline: none; }
.seedream-doodle footer { justify-content: space-between; min-height: 40px; }
.seedream-doodle footer span { color: #9fcabf; font-size: 13px; }
.seedream-doodle footer span.is-error { color: #ff9b9b; }
.seedream-doodle footer div { display: flex; gap: 9px; flex: none; }
.seedream-doodle [data-doodle-submit] { border-color: #7adbd1; background: #77d8cd; color: #092222; font-weight: 700; }
.seedream-doodle-trigger svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.seedream-doodle .seedream-doodle-prompt[hidden] { display: none; }
.seedream-doodle.is-reference-edit .seedream-doodle-shell { grid-template-rows: auto auto minmax(160px, 1fr) auto; }
.reference-preview[data-doodle-reference] { cursor: pointer; }
.reference-preview[data-doodle-reference]:focus-visible { outline: 2px solid #83e4d9; outline-offset: 3px; }
.reference-zoom-preview.seedream-reference-preview { display: block; bottom: auto; max-width: none; max-height: none; aspect-ratio: auto; opacity: 1; pointer-events: auto; transform: none; transition: none; position: fixed; z-index: 15000; box-sizing: border-box; padding: 8px; border: 1px solid #35506a; border-radius: 12px; background: #101b28; color: #edf5fc; box-shadow: 0 12px 40px #0009; }
.reference-zoom-preview.seedream-reference-preview[hidden] { display: none; }
.seedream-reference-preview img { display: block; width: 100%; height: min(260px, 45vh); object-fit: contain; background: #09121d; border-radius: 7px; }
.seedream-reference-preview button { min-height: 38px; border: 1px solid #3b5369; border-radius: 7px; color: #edf5fc; background: #182a3a; cursor: pointer; }
.seedream-reference-preview [data-reference-edit] { width: 100%; margin-top: 8px; }
.seedream-reference-preview [data-reference-preview-close] { position: absolute; right: 12px; top: 12px; width: 32px; min-height: 32px; font-size: 20px; }
.seedream-reference-preview button:hover, .seedream-reference-preview button:focus-visible { outline: 2px solid #83e4d9; }
@media (max-width: 650px) {
  .seedream-doodle-shell { padding: 14px; gap: 11px; }
  .seedream-doodle h2 { font-size: 19px; }
  .seedream-doodle-image { max-height: 44vh; }
  .seedream-doodle footer { align-items: stretch; flex-direction: column; }
  .seedream-doodle footer div { justify-content: flex-end; }
}
