/* myNote – Akzentfarben (data-accent am <html>). Wird nach den Themes geladen und überschreibt deren Akzent. */
:root { --on-accent: #ffffff; }
html { accent-color: var(--accent); }

/* Schrift auf dem Akzent: Weiss erreicht bei diesen Farben nur 3,0 bis 4,2 : 1, fast Schwarz 4,7 bis 6,7 : 1 */
html[data-accent="blue"] { --accent: #2f7df6; --on-accent: #050807; }
html[data-accent="violet"] { --accent: #8b5cf6; --on-accent: #050807; }
html[data-accent="pink"] { --accent: #e84393; --on-accent: #050807; }
html[data-accent="red"] { --accent: #e5484d; --on-accent: #050807; }
html[data-accent="orange"] { --accent: #e07b00; --on-accent: #050807; }
html[data-accent="teal"] { --accent: #0f9aa0; --on-accent: #050807; }
html[data-accent="neon-green"] { --accent: #39ff14; --on-accent: #04210a; }
html[data-accent="neon-cyan"] { --accent: #00f0ff; --on-accent: #00262a; }
html[data-accent="neon-pink"] { --accent: #ff2ec4; --on-accent: #2a0020; }
html[data-accent="neon-violet"] { --accent: #b44dff; --on-accent: #14002a; }
html[data-accent="neon-orange"] { --accent: #ff8a00; --on-accent: #2a1400; }
html[data-accent="neon-yellow"] { --accent: #f4ff1a; --on-accent: #262900; }

/* Abgeleitete Werte: aus dem Akzent gemischt, damit Schrift auf hellem und dunklem Grund lesbar bleibt */
html[data-accent]:not([data-accent="default"]) { --accent-soft: color-mix(in srgb, var(--accent) 17%, transparent); --accent-text: color-mix(in srgb, var(--accent) 58%, #000); }
html[data-theme="dark"][data-accent]:not([data-accent="default"]), html[data-theme="glass-dark"][data-accent]:not([data-accent="default"]) { --accent-text: color-mix(in srgb, var(--accent) 72%, #fff); }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"][data-accent]:not([data-accent="default"]) { --accent-text: color-mix(in srgb, var(--accent) 72%, #fff); }
}

/* Neon: dezentes Leuchten */
html[data-accent^="neon"] .btn.primary { box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 65%, transparent), inset 0 1px 0 rgba(255, 255, 255, .45); }
html[data-accent^="neon"] .card:hover, html[data-accent^="neon"] .editor-area:focus { box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent); }
html[data-accent^="neon"] .sidebar-nav a.active, html[data-accent^="neon"] .tree-note.active { box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 40%, transparent); }
html[data-accent^="neon"] :is(input, button, a, summary):focus-visible { outline-color: var(--accent); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 70%, transparent); }

/* Farbfelder im Darstellungs-Menü */
.accent-group { padding: 6px 10px 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.accent-group > span { display: block; margin-bottom: 6px; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.accent-row { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-pop button.swatch { display: block; width: 24px; height: 24px; flex: 0 0 24px; padding: 0; border: 2px solid transparent; border-radius: 50%; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.theme-pop button.swatch::after { content: none; }
.theme-pop button.swatch:hover { transform: scale(1.12); }
.theme-pop button.swatch[aria-checked="true"] { border-color: var(--text); box-shadow: 0 0 0 2px var(--panel), inset 0 0 0 1px rgba(0, 0, 0, .25); }
.theme-pop button.swatch-default { background: #16865b; }
.theme-pop button.swatch-blue { background: #2f7df6; }
.theme-pop button.swatch-violet { background: #8b5cf6; }
.theme-pop button.swatch-pink { background: #e84393; }
.theme-pop button.swatch-red { background: #e5484d; }
.theme-pop button.swatch-orange { background: #e07b00; }
.theme-pop button.swatch-teal { background: #0f9aa0; }
.theme-pop button.swatch-neon-green { background: #39ff14; }
.theme-pop button.swatch-neon-cyan { background: #00f0ff; }
.theme-pop button.swatch-neon-pink { background: #ff2ec4; }
.theme-pop button.swatch-neon-violet { background: #b44dff; }
.theme-pop button.swatch-neon-orange { background: #ff8a00; }
.theme-pop button.swatch-neon-yellow { background: #f4ff1a; }

/* Eigene Farbe: Farbwähler im Menü; die Farben selbst setzt theme.js als Inline-Variablen am <html> */
.accent-custom { display: flex; align-items: center; gap: 10px; cursor: pointer; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; color: var(--muted); }
.accent-custom input[type="color"] { width: 44px; height: 28px; padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; cursor: pointer; }
html[data-accent="custom"] .accent-custom input[type="color"] { border-color: var(--text); }
html[data-accent="custom"] .accent-custom { color: var(--text); }

/* Schrift im Darstellungs-Menü */
.theme-pop { max-height: calc(100vh - var(--topbar) - 24px); max-height: calc(100dvh - var(--topbar) - 24px); overflow-y: auto; }
.font-group { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.font-group button.ff-system { font-family: var(--ff-system); }
.font-group button.ff-serif { font-family: var(--ff-serif); }
.font-group button.ff-humanist { font-family: var(--ff-humanist); }
.font-group button.ff-readable { font-family: var(--ff-readable); }
.font-group button.ff-mono { font-family: var(--ff-mono); }
.font-row { display: flex; align-items: center; gap: 6px; padding: 4px 10px; }
.font-row .font-label { flex: 1; color: var(--text); font-size: .9rem; }
.font-row output { min-width: 4.2em; text-align: center; font-variant-numeric: tabular-nums; color: var(--text); font-size: .9rem; }
.theme-pop .font-row button.step { width: 38px; flex: 0 0 38px; padding: 5px 0; justify-content: center; border: 1px solid var(--line); background: var(--panel2); font-weight: 700; }
.theme-pop .font-row button.step::after { content: none; }
.theme-pop .font-row button.step:hover { background: var(--accent-soft); }
.theme-pop button.font-reset { color: var(--muted); font-size: .88rem; justify-content: center; margin-top: 4px; }

/* Touch (5.47.0): Farbfelder grösser, damit sie sich mit dem Finger treffen lassen */
@media (pointer: coarse) {
  .theme-pop button.swatch { width: 44px; height: 44px; flex: 0 0 44px; min-height: 0; }
  .accent-custom input[type="color"] { height: 44px; }
  .theme-pop .font-row button.step { width: 44px; flex: 0 0 44px; }
}
