/*
 * SPDX-FileCopyrightText: 2026 Christian (Fuchs The Fox)
 * SPDX-License-Identifier: MIT
 *
 * Code by Christian (Fuchs The Fox), licensed under the MIT License.
 * Images and assets: All rights reserved by Nik Raccoom, Fuchs The Fox and Skayo.
 */

:root {
  color-scheme: light dark;
  --bg: #f3f4f6;
  --panel: #ffffff;
  --text: #171717;
  --muted: #656b76;
  --border: #d7dbe2;
  --accent: #6d28d9;
  --accent-hover: #5b21b6;
  --focus: #8b5cf6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111318;
    --panel: #1b1e25;
    --text: #f5f5f5;
    --muted: #b6bbc6;
    --border: #343945;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --focus: #a78bfa;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}
button, input { font: inherit; }
.app { width: min(1480px, 100%); margin: 0 auto; padding: 18px; }
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px 20px; margin-bottom: 18px;
}
h1 { font-size: clamp(1.35rem, 2.4vw, 2rem); margin: 0 0 4px; }
.hero p { margin: 0; color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
button {
  min-height: 44px; border: 0; border-radius: 10px; padding: 10px 16px;
  background: var(--accent); color: white; font-weight: 700; cursor: pointer;
}
button:hover { background: var(--accent-hover); }
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
button:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.workspace { display: grid; grid-template-columns: minmax(300px, 460px) minmax(0, 1fr); gap: 18px; align-items: start; }
.editor, .preview-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 16px;
}
.editor { display: grid; gap: 16px; }
fieldset { border: 0; margin: 0; padding: 0; }
fieldset + fieldset { border-top: 1px solid var(--border); padding-top: 16px; }
legend { font-size: 1.08rem; font-weight: 800; margin-bottom: 10px; color: var(--accent); }
.input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.field { min-width: 0; }
.field label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 4px; }
.field input {
  width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; background: transparent; color: var(--text); font-size: 16px;
}
.note { margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); font-size: .9rem; }
.preview-card { min-width: 0; }
canvas { display: block; width: 100%; height: auto; background: white; border-radius: 8px; }
.status { margin: 10px 2px 0; min-height: 1.4em; color: var(--muted); font-size: .88rem; }
@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .preview-card { order: -1; }
}
@media (max-width: 560px) {
  .app { padding: 10px; }
  .hero { align-items: stretch; flex-direction: column; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; }
  .input-grid { grid-template-columns: 1fr; }
}
.site-footer {
  margin-top: 18px;
  padding: 12px 4px 2px;
  color: var(--muted);
  font-size: .82rem;
  text-align: center;
}


/* Inline profile-name buttons and their local link popup. */
.profile-trigger {
  display: inline;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  cursor: pointer;
}
.profile-trigger:hover { background: transparent; color: var(--accent-hover); }
.profile-trigger[aria-expanded="true"] { text-decoration-style: solid; }

.profile-popup {
  position: fixed;
  z-index: 1000;
  width: min(230px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.22);
}
.profile-popup[hidden] { display: none; }
.profile-popup-title {
  padding: 5px 8px 8px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 800;
}
.profile-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
.profile-link:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.profile-link:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.profile-link img { flex: 0 0 22px; display: block; }
.profile-link[hidden] {
  display: none;
}
