:root { --canvas: #f6f7f2; --ink: #20221c; --muted: #5b5e52; --citron: #e0f268; --soft: #ebefda; --line: #d8dccd; font: 14px/1.5 Manrope, Arial, sans-serif; color: var(--ink); background: var(--canvas); color-scheme: light; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { height: 100dvh; margin: 0; display: grid; grid-template-rows: 72px minmax(0, 1fr) 44px; overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; opacity: .4; }
a { color: #424a20; text-decoration: none; text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, canvas:focus-visible { outline: 2px solid #424a20; outline-offset: 4px; }
p, h1, h2 { margin: 0; }
.editor-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 32px; padding-inline: 24px; border-bottom: 1px solid var(--line); background: var(--canvas); }
.brand { display: inline-flex; gap: 10px; align-items: center; font-size: 18px; font-weight: 600; letter-spacing: -.03em; color: var(--ink); }
.image-identity { min-width: 0; display: flex; align-items: center; gap: 16px; }
.image-identity input { min-width: 0; width: min(100%, 320px); border: 1px solid transparent; border-radius: 6px; padding: 8px; background: transparent; color: var(--ink); text-overflow: ellipsis; }
.image-identity input:hover, .image-identity input:focus { border-color: var(--line); }
.identity-note { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.share-actions { display: flex; align-items: center; gap: 12px; }
.primary { display: inline-flex; justify-content: center; align-items: center; gap: 12px; background: var(--ink); color: var(--citron); border: 1px solid var(--ink); border-radius: 8px; padding: 10px 16px; min-height: 44px; font-size: 14px; font-weight: 600; }
.primary:hover { background: #363a2c; }
.quiet-action { padding: 8px 12px; min-height: 44px; border: 0; background: transparent; font-size: 13px; }
.icon-button { display: grid; place-items: center; width: 40px; min-height: 40px; border: 1px solid transparent; border-radius: 8px; padding: 0; background: transparent; }
.icon-button:hover { background: var(--soft); }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; }
[data-icon] svg { display: block; }
.editor-main { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0; }
.editor-main[data-panel=true] { grid-template-columns: minmax(0, 1fr) 304px; }
.canvas-area { position: relative; min-width: 0; background: #e8ebe1; }
.canvas-heading { position: absolute; inset: 20px 32px auto; display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--muted); }
.canvas-heading p:first-child { color: var(--ink); }
.canvas-wrap { position: absolute; inset: 56px 48px 132px; overflow: auto; display: grid; align-items: safe center; justify-items: safe center; scroll-padding: 24px; }
canvas { display: block; background: white; box-shadow: 0 16px 48px #20221c14, 0 1px 4px #20221c15; touch-action: none; cursor: crosshair; }
.canvas-controls { position: absolute; bottom: 92px; right: 32px; display: flex; gap: 16px; align-items: center; font-size: 12px; color: var(--muted); }
.canvas-controls select { font-size: 12px; min-height: 36px; padding: 6px 10px; border: 1px solid #b7bcaa; background: var(--canvas); color: var(--ink); border-radius: 6px; }
.tool-dock { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; align-items: center; padding: 8px; border: 1px solid #c8cebb; border-radius: 14px; background: var(--canvas); box-shadow: 0 8px 24px #20221c0d; }
.tool-group { display: flex; align-items: center; gap: 4px; }
.tool-group button { display: grid; place-items: center; width: 40px; min-height: 40px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; }
.tool-group button:hover { background: var(--soft); }
.tool-group button[aria-pressed=true] { background: var(--ink); color: var(--citron); }
.dock-divider { width: 1px; height: 24px; background: #c8cebb; margin-inline: 12px; }
.context-panel { min-width: 0; overflow-y: auto; border-left: 1px solid var(--line); padding: 24px; background: var(--canvas); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.panel-heading h1 { font-size: 18px; font-weight: 600; line-height: 1.3; }
.panel-description { color: var(--muted); font-size: 13px; margin-top: 20px; }
.field { display: grid; gap: 8px; color: var(--muted); font-size: 13px; margin-top: 24px; }
.field select, .field textarea, .crop-fields input { width: 100%; color: var(--ink); background: white; border: 1px solid #a0a58f; border-radius: 6px; min-height: 40px; padding: 8px 10px; }
.field input[type=color] { width: 100%; height: 40px; border: 1px solid #a0a58f; border-radius: 6px; background: white; padding: 4px; }
.panel-button { width: 100%; border: 1px solid var(--ink); border-radius: 8px; min-height: 44px; padding: 10px 12px; margin-top: 20px; background: transparent; color: var(--ink); font-weight: 500; }
.panel-button.primary { background: var(--ink); color: var(--citron); }
.crop-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.crop-fields label { display: grid; gap: 8px; color: var(--muted); font-size: 12px; }
.share-file { display: flex; align-items: center; gap: 12px; margin-top: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.format-label { font-size: 13px; font-weight: 600; display: grid; place-items: center; width: 44px; height: 52px; border-radius: 4px; background: var(--ink); color: var(--canvas); flex-shrink: 0; }
.share-file strong { font-size: 13px; font-weight: 600; display: block; overflow-wrap: anywhere; }
.share-file div > span { font-size: 12px; color: var(--muted); display: block; margin-top: 4px; }
.access-note, .preview-note { color: var(--muted); font-size: 12px; margin-top: 12px; }
.account-group { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.account-group h2 { font-size: 18px; font-weight: 600; }
.account-group p { font-size: 13px; color: var(--muted); margin-top: 8px; }
.text-button { background: transparent; border: 0; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; min-height: 44px; padding: 8px 0; }
.secondary-download { margin-top: 24px; font-size: 13px; }
.editor-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-inline: 24px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.editor-footer a { min-height: 32px; display: inline-flex; align-items: center; flex-shrink: 0; }
dialog { max-width: 440px; width: calc(100% - 48px); padding: 32px; border: 1px solid var(--ink); border-radius: 12px; background: var(--canvas); color: var(--ink); }
dialog::backdrop { background: #20221c66; }
dialog h2 { font-size: 24px; font-weight: 600; line-height: 1.2; }
dialog p { margin-top: 16px; color: var(--muted); }
dialog form { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; margin-top: 24px; }
dialog form a { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.embedded body { grid-template-rows: 56px minmax(0, 1fr); }
.embedded .editor-footer { display: none; }
.embedded .editor-header { padding-inline: 16px; }
.embedded .canvas-heading { inset: 12px 24px auto; }
.embedded .canvas-wrap { inset: 40px 24px 92px; }
.embedded .canvas-controls { bottom: 66px; }
.embedded .tool-dock { bottom: 8px; }
@media (max-width: 900px) {
  .identity-note, .desktop-account { display: none; }
  .editor-header { gap: 20px; }
  .editor-main[data-panel=true] { grid-template-columns: minmax(0, 1fr); }
  .context-panel { position: fixed; z-index: 5; right: 24px; top: 88px; width: 288px; max-height: calc(100dvh - 228px); border: 1px solid #a0a58f; border-radius: 12px; box-shadow: 0 16px 40px #20221c18; }
}
@media (max-width: 620px) {
  body { grid-template-rows: 108px minmax(0, 1fr) 44px; }
  .editor-header { grid-template-columns: 1fr auto; gap: 0 16px; padding-inline: 24px; align-content: center; }
  .brand { font-size: 17px; }
  .image-identity { grid-row: 2; grid-column: 1 / -1; margin-top: 8px; }
  .image-identity input { max-width: none; width: 100%; font-size: 12px; padding: 4px 0; }
  .share-actions { grid-row: 1; grid-column: 2; }
  .share-actions .primary { font-size: 12px; padding-inline: 12px; gap: 8px; min-height: 40px; }
  .desktop-download { display: none; }
  .canvas-heading { inset: 16px 24px auto; font-size: 11px; flex-wrap: wrap; gap: 4px 16px; }
  .canvas-heading p:last-child { display: none; }
  .canvas-wrap { inset: 48px 24px 136px; }
  .canvas-controls { right: 24px; bottom: 92px; font-size: 11px; }
  .tool-dock { padding: 6px; bottom: 20px; border-radius: 12px; }
  .tool-group { gap: 2px; }
  .tool-group button, .tool-dock .icon-button { width: 30px; min-height: 36px; }
  .dock-divider { margin-inline: 5px; height: 20px; }
  .context-panel { inset: auto 24px 128px; width: auto; padding: 20px; max-height: calc(100dvh - 248px); }
  .panel-heading { padding-bottom: 12px; }
  .field { margin-top: 16px; }
  .editor-footer { padding-inline: 24px; font-size: 11px; }
  .editor-footer a { display: none; }
  .embedded body { grid-template-rows: 88px minmax(0, 1fr); }
  .embedded .editor-header { padding-inline: 16px; }
  .embedded .context-panel { inset: auto 16px 104px; max-height: calc(100dvh - 216px); }
}
@media (max-width: 360px) { .tool-group { gap: 1px; } .tool-group button, .tool-dock .icon-button { width: 26px; } .dock-divider { margin-inline: 3px; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
