/* Compact paint palette. Existing theme buttons retain their native semantics. */
.mini-theme-options.color-palette{display:inline-flex;align-items:center;gap:2px;padding:3px 6px;border:1px solid var(--line-soft);border-radius:18px 18px 18px 8px;background:var(--surface)}
.color-palette .mini-theme-option{width:23px;min-width:23px;height:32px;padding:3px;border-radius:50%}
.color-palette .mini-paper{width:12px;height:12px;border-radius:50%;transition:box-shadow 160ms ease,transform 160ms ease}
.color-palette .mini-theme-option[aria-pressed="true"] .mini-paper{box-shadow:0 0 0 2px var(--paper),0 0 0 3px var(--accent),0 0 9px var(--accent-line);transform:scale(1.08)}
:root[data-custom-color] .color-palette .mini-theme-option[aria-pressed="true"] .mini-paper{background:var(--palette-custom)}
.palette-more,.palette-cursor{display:inline-flex;align-items:center;justify-content:center;width:28px;min-width:28px;height:36px;border:0;border-radius:9px;background:transparent;color:var(--ink-soft);padding:2px;font:inherit}
.palette-more{font-size:18px;letter-spacing:1px}
.palette-cursor[aria-pressed="true"]{background:var(--tint);color:var(--accent)}
.palette-more:focus-visible,.palette-cursor:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.palette-dialog{box-sizing:border-box;width:min(340px,calc(100vw - 32px));max-height:calc(100dvh - 40px);overflow:auto;padding:20px;border:1px solid var(--line);border-radius:20px;background:var(--paper);color:var(--ink);box-shadow:0 15px 55px var(--shadow);font-family:var(--font-ui)}
.palette-dialog::backdrop{background:rgb(0 0 0 / .25)}
.palette-dialog form{display:grid;gap:16px;margin:0}
.palette-dialog h2{font-size:16px;margin:0}
.palette-detail-themes{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.palette-detail-themes button{display:grid;justify-items:center;gap:8px;padding:10px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);font:inherit;font-size:12px;min-height:68px}
.palette-detail-themes button[aria-pressed="true"]{outline:2px solid var(--accent);outline-offset:1px}
.palette-preview{display:block;width:48px;height:28px;border-radius:6px;border:1px solid #8888;background:#fbf7ec}
.palette-preview[data-quick-theme="sage"]{background:#e2ede4}
.palette-preview[data-quick-theme="colorful"]{background:linear-gradient(120deg,#e5c6e8,#def1e8)}
.palette-preview[data-quick-theme="night"]{background:#26282c}
.palette-custom-label{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px}
.palette-custom-label input{width:52px;height:40px;padding:3px;border:1px solid var(--line);border-radius:9px;background:var(--surface)}
.palette-reset,.palette-done{min-height:44px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font:inherit;font-size:13px}
.palette-done{background:var(--tint);color:var(--accent)}
@media(pointer:coarse){.color-palette .mini-theme-option{width:29px;min-width:29px;height:44px}.palette-more,.palette-cursor{height:44px;min-width:32px}}
@media(prefers-reduced-motion:reduce){.color-palette .mini-paper{transition:none}}
/* Reset only the canvas cursor; native text, link, resize and busy cursors remain contextual. */
html[data-cursor="system"],html[data-cursor="system"] body{cursor:auto}

@media(max-width:600px){.topbar{flex-wrap:wrap;row-gap:8px}.topbar-actions{flex-wrap:wrap;max-width:100%}.mini-preferences{flex-wrap:wrap}}

/* A single paint-palette button; the original controls remain internal theme actions. */
.mini-theme-options.color-palette{padding:0;border:0;background:transparent;border-radius:50%;gap:0;flex:0 0 40px}
.color-palette>.mini-theme-option{display:none}
.palette-trigger{display:grid;place-items:center;flex:0 0 40px;width:40px;height:44px;padding:3px;border:0;border-radius:50%;background:transparent;color:var(--ink-soft);touch-action:manipulation;-webkit-touch-callout:none;user-select:none}
.palette-trigger svg{overflow:visible}
.palette-trigger [data-palette-dot]{stroke:var(--paper);stroke-width:.7;transition:filter 160ms ease,stroke 160ms ease}
.palette-trigger [data-active="true"]{stroke:var(--accent);stroke-width:1.4;filter:drop-shadow(0 0 2px var(--accent))}
:root[data-custom-color] .palette-trigger [data-active="true"]{fill:var(--palette-custom)}
.palette-trigger:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.palette-detail-themes .palette-preview{width:32px;height:32px;border-radius:50%}
.palette-custom-label input{border-radius:50%;width:44px;height:44px;overflow:hidden}
.palette-custom-label input::-webkit-color-swatch-wrapper{padding:0}
.palette-custom-label input::-webkit-color-swatch{border:0;border-radius:50%}
.palette-custom-label input::-moz-color-swatch{border:0;border-radius:50%}
@media(pointer:coarse){.palette-cursor{display:none}}
@media(max-width:600px){
 .topbar{display:flex;flex-wrap:nowrap;align-items:center;gap:8px}
 .topbar-identity{flex:1 1 auto;min-width:0}
 .topbar .brand-copy{min-width:0}
 .topbar h1{white-space:nowrap;word-break:normal;overflow:hidden;text-overflow:ellipsis}
 .topbar-actions{flex:0 0 auto;flex-wrap:nowrap;gap:2px;max-width:none}
 .mini-preferences{flex-wrap:nowrap;gap:2px}
 .topbar .eyebrow{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}
@media(prefers-reduced-motion:reduce){.palette-trigger [data-palette-dot]{transition:none}}
