.photo-editor {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 0;
  max-width: none;
  max-height: none;
  box-sizing: border-box;
  border: 0;
  color: var(--msg-text, #172b4d);
  background: var(--msg-panel, #fff);
  color-scheme: dark;
  overflow: hidden;
}
[data-hubba-theme=light] .photo-editor { color-scheme: light; }
.photo-editor[open] { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto auto; }
.photo-editor-toolbar { grid-row: 1; }
.photo-editor-options { grid-row: 2; }
.photo-editor-stage { grid-row: 3; }
.photo-editor-caption { grid-row: 4; }
.photo-editor-status { grid-row: 5; }
.photo-editor-footer { grid-row: 6; }
.photo-editor::backdrop { background: transparent; }
.photo-editor [hidden] { display: none !important; }
.photo-editor-toolbar,
.photo-editor-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px 16px;
  background: var(--msg-panel, #fff);
}
.photo-editor-toolbar { border-bottom: 1px solid var(--msg-line, #dce2e8); }
.photo-editor-identity { min-width: 0; margin-right: auto; }
.photo-editor .photo-editor-title { margin: 0; font-size: 15px; font-weight: 700; }
.photo-editor-recipient { margin: 4px 0 0; font-size: 12px; color: var(--msg-muted, #52627a); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-editor-tools { display: flex; align-items: center; gap: 4px; }
.photo-editor-icon,
.photo-editor-action,
.photo-editor-thumbnail {
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.photo-editor-icon { display: grid; place-items: center; width: 37px; height: 37px; padding: 6px; border-radius: 50%; flex: 0 0 auto; }
.photo-editor-icon svg,
.photo-editor-thumbnail svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.photo-editor button:hover:not(:disabled),
.photo-editor button[aria-pressed=true] { background: var(--msg-selected, #dbe6fb); }
.photo-editor button[aria-pressed=true] { border-color: var(--msg-accent, #001a44); }
.photo-editor button:disabled { opacity: .44; cursor: default; }
.photo-editor :focus-visible { outline: 2px solid var(--msg-accent, #001a44); outline-offset: 2px; }
.photo-editor-action { border-color: var(--msg-line, #dce2e8); border-radius: 9px; padding: 7px 10px; font-size: 12px; white-space: nowrap; }
.photo-editor-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; max-height: 23dvh; overflow-y: auto; padding: 8px 16px; border-bottom: 1px solid var(--msg-line, #dce2e8); font-size: 12px; }
.photo-editor-options label { display: flex; align-items: center; gap: 6px; color: inherit; }
.photo-editor-options input[type=color] { width: 32px; height: 30px; padding: 3px; cursor: pointer; }
.photo-editor-options input[type=range] { width: 83px; padding: 0; accent-color: var(--msg-accent, #001a44); }
.photo-editor-options :is(input[type=text], select) { width: auto; min-width: 0; max-width: 100%; }
.photo-editor-options :is(input[type=text], select, input[type=color]) { color: inherit; background: var(--msg-input, #f0f2f5); border-color: var(--msg-line, #dce2e8); }
.photo-editor-symbols { display: flex; flex-wrap: wrap; gap: 3px; }
.photo-editor-symbols button { font-size: 17px; padding: 3px 6px; }
.photo-editor-stage { position: relative; display: grid; place-items: center; overflow: hidden; min-height: 0; background: var(--msg-bg, #eef2f7); }
.photo-editor-frame { position: relative; overflow: hidden; box-shadow: 0 8px 35px #0003; }
.photo-editor-frame canvas { display: block; width: 100%; height: 100%; }
.photo-editor-overlay { position: absolute; inset: 0; pointer-events: none; }
.photo-editor-frame:is([data-tool=crop],[data-tool=draw],[data-tool=shape],[data-tool=pixel],[data-tool=emoji],[data-tool=text],[data-tool=sticker]) .photo-editor-overlay { pointer-events: auto; touch-action: none; cursor: crosshair; }
.photo-editor-empty { margin: 0; color: var(--msg-muted, #52627a); font-size: 14px; }
.photo-editor-caption { display: flex; align-items: center; width: min(650px, calc(100% - 28px)); margin: 8px auto; border: 1px solid var(--msg-line, #dce2e8); border-radius: 10px; background: var(--msg-input, #f0f2f5); }
.photo-editor-caption textarea { flex: 1 1 auto; resize: vertical; min-height: 40px; max-height: 112px; background: transparent; color: inherit; border: 0; border-radius: 10px; line-height: 1.4; font-size: 14px; }
.photo-editor-caption textarea::placeholder { color: var(--msg-muted, #52627a); }
.photo-editor-caption .photo-editor-icon { margin: 0 4px; }
.photo-editor-status { margin: 0; padding: 0 14px 7px; text-align: center; font-size: 12px; color: var(--msg-muted, #52627a); }
.photo-editor-status:empty { display: none; }
.photo-editor-status.photo-editor-error { color: var(--msg-danger, #b93646); }
.photo-editor-footer { justify-content: flex-end; border-top: 1px solid var(--msg-line, #dce2e8); }
.photo-editor-strip { display: flex; align-items: center; gap: 8px; margin-inline: auto; min-width: 0; max-width: 100%; overflow-x: auto; padding: 4px; }
.photo-editor-thumbnail { display: grid; place-items: center; padding: 0; flex: 0 0 48px; width: 48px; height: 48px; border-radius: 6px; border-color: var(--msg-line, #dce2e8); overflow: hidden; }
.photo-editor-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.photo-editor-thumbnail[aria-current=true] { outline: 2px solid var(--msg-accent, #001a44); outline-offset: 1px; }
.photo-editor-thumbnail.photo-editor-uncertain { border: 2px solid var(--msg-danger, #b93646); }
.photo-editor-send { width: 50px; height: 50px; background: var(--hubba-primary, #001a44); color: #fff; }
.photo-editor-send.photo-editor-retry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  padding-inline: 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.photo-editor .photo-editor-send:hover:not(:disabled) { background: var(--hubba-primary, #001a44); filter: brightness(1.35); }
@media (max-width: 1100px) {
  .photo-editor-toolbar { flex-wrap: wrap; }
  .photo-editor-tools { max-width: 100%; overflow-x: auto; padding: 3px; }
}
@media (max-width: 720px) {
  .photo-editor-toolbar, .photo-editor-footer { padding: 6px 10px; }
  .photo-editor-toolbar { gap: 3px 8px; }
  .photo-editor-tools { width: 100%; flex-wrap: wrap; overflow: visible; }
  .photo-editor-icon { width: 37px; height: 37px; }
  .photo-editor-send { width: 43px; height: 43px; }
  .photo-editor-options { padding: 6px 10px; }
}
