:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  --ink: #202a38;
  --muted: #566477;
  --border: #dce1e7;
  --accent: #285691;
  --paper: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; background: #f5f6f8; color: var(--ink); }
body > header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem max(1rem, calc((100vw - 1240px) / 2)); background: var(--paper); border-bottom: 1px solid var(--border); }
a { color: var(--accent); text-underline-offset: 3px; }
.brand { color: var(--ink); font-size: 1.2rem; font-weight: 700; text-decoration: none; }
header nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
header nav a { color: var(--muted); text-decoration: none; }
header nav a[aria-current] { color: var(--accent); font-weight: 600; }
header nav button { background: none; color: var(--ink); border-color: var(--border); }
main { max-width: 1240px; margin: 1.5rem auto; padding: 0 1rem 2rem; }
h2 { margin: 0 0 1rem; font-size: 1.5rem; }
h3 { margin: 0 0 .8rem; font-size: 1.1rem; }
h4 { margin: 0 0 .4rem; font-size: 1rem; }
p { margin: .6rem 0; }
p:empty { display: none; }
section, .panel { min-width: 0; background: var(--paper); border: 1px solid var(--border); border-radius: 6px; padding: 1.2rem; margin-bottom: 1rem; }
section > h3:not(:first-child) { margin-top: 1.7rem; }
section section, section > .panel { padding: 1rem 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; margin-bottom: 0; }
.auth-panel { width: min(100%, 420px); margin: 3rem auto; padding: 1.6rem; }
.auth-panel input { width: 100%; }
form label { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; margin: .7rem 0; font-size: .9rem; }
label:has(> input[type=checkbox]), label:has(> input[type=radio]) { display: flex; flex-direction: row; align-items: center; gap: .5rem; }
input, textarea, select { max-width: 100%; min-height: 36px; padding: .45rem .6rem; border: 1px solid #b9c2ce; border-radius: 4px; background: var(--paper); color: var(--ink); font: inherit; }
textarea { width: min(100%, 680px); min-height: 90px; }
input[type=checkbox], input[type=radio] { min-height: auto; margin: 0; accent-color: var(--accent); }
input:disabled { background: #f1f3f6; color: var(--muted); }
button { min-height: 36px; padding: .45rem .8rem; border: 1px solid transparent; border-radius: 4px; background: var(--accent); color: white; font: inherit; font-size: .9rem; cursor: pointer; }
button.secondary { background: var(--paper); border-color: #bbc5d1; color: var(--ink); }
button.danger { background: var(--paper); color: #a22924; border-color: #d5aaa7; }
button:hover { filter: brightness(.94); }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 3px solid #669bdc; outline-offset: 3px; }
[hidden], .hidden { display: none !important; }
.error, [role=alert] { color: #a22924; }
.muted, small { color: var(--muted); font-size: .85rem; }
.code-box { padding: .8rem; margin: .8rem 0; border: 1px solid var(--border); border-radius: 4px; background: #f3f6fa; font-family: ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.badge { padding: .1rem .4rem; background: #f8eded; color: #a22924; border-radius: 3px; font-size: .8rem; }
.table-wrap { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .7rem .6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; font-size: .9rem; }
th { color: var(--muted); font-size: .8rem; font-weight: 600; white-space: nowrap; }
td small { display: block; }
td code { white-space: nowrap; }
td button { white-space: nowrap; }
.empty-row { color: var(--muted); padding: 1.2rem .6rem; }
.tabs { display: flex; gap: .3rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs button.tab { background: none; color: var(--muted); border: 0; border-radius: 0; border-bottom: 2px solid transparent; padding: .65rem .9rem; white-space: nowrap; }
.tabs button.tab.active { border-bottom-color: var(--accent); color: var(--accent); }
.toolbar, .filter-bar, .section-heading { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.filter-bar { align-items: flex-end; margin-bottom: .8rem; }
.filter-bar label { margin: .25rem 0; }
.filter-bar > details { flex-basis: 100%; }
.section-heading { justify-content: space-between; margin-bottom: .7rem; }
.section-heading h3 { margin: 0; }
.notice { padding: .8rem 1rem; margin: .8rem 0; border: 1px solid #d6c591; border-left: 3px solid #aa8126; border-radius: 4px; background: #fffaf0; }
.notice button { margin: .2rem .2rem .2rem 0; }
summary { cursor: pointer; color: var(--ink); font-weight: 500; }
details[open] > summary { margin-bottom: .8rem; }
summary:focus-visible { border-radius: 2px; }
.action-menu { margin-top: .5rem; min-width: 135px; }
.action-menu summary { color: var(--muted); font-size: .85rem; }
.action-items { display: flex; flex-direction: column; align-items: stretch; gap: .4rem; }
.action-items button { text-align: left; white-space: normal; }
.project-actions > a { display: inline-block; margin-right: .5rem; }
#task-create-form fieldset { border: 1px solid var(--border); border-radius: 6px; margin: .8rem 0; padding: .4rem 1rem .9rem; }
#task-create-form legend { padding: 0 .4rem; color: var(--muted); font-size: .85rem; font-weight: 600; }
.item-list { margin: .4rem 0; padding-left: 1.4rem; }
.item-list li { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .45rem 0; list-style: decimal; }
.item-list li input[name=prompt] { flex: 1 1 320px; }
.task-card { padding: 1rem 0; margin: .5rem 0; border-bottom: 1px solid var(--border); }
.task-card:last-child { border-bottom: 0; }
.task-card label { margin: .6rem 0; }
.task-card li { margin: .5rem 0; }
.task-card li button { margin-left: .4rem; }
.task-controls { display: flex; gap: .4rem; flex-wrap: wrap; margin: .8rem 0; }
.task-description, .answers-view { white-space: pre-wrap; overflow-wrap: anywhere; }
.storage-note { margin-top: 1rem; font-size: .85rem; }
.storage-note summary { color: var(--muted); }
.audit { max-height: 400px; overflow: auto; padding-left: 1.2rem; font-size: .85rem; }
.audit li { padding: .3rem 0; overflow-wrap: anywhere; }
pre { padding: .7rem; margin: .7rem 0; max-height: 300px; overflow: auto; background: #f3f5f7; border-radius: 4px; }
#output { min-height: 2rem; white-space: pre-wrap; overflow-wrap: anywhere; }
dialog { width: min(1050px, 92vw); max-height: 90vh; overflow: auto; padding: 1.5rem; border: 1px solid var(--border); border-radius: 6px; }
dialog.access-dialog { width: min(520px, 92vw); }
dialog.access-dialog input:not([type=checkbox]) { width: 100%; }
.publish-result p { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; }
dialog::backdrop { background: rgba(20, 30, 45, .4); }
.py-keyword { color:#7b2fa0; font-weight:bold; }
.py-string { color:#126c3e; }.py-comment { color:#667583; }.py-number { color:#b04c00; }
.comparison-grid { display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
.comparison-grid label { min-width:0; }
.comparison-grid textarea { display:block; box-sizing:border-box; width:100%; min-height:300px; white-space:pre; overflow:auto; font:14px/1.5 ui-monospace,monospace; }
@media (max-width: 850px) {
  body > header { flex-wrap: wrap; gap: .7rem; }
  header nav { gap: .7rem; }
  main { margin-top: 1rem; }
  section, .panel { padding: 1rem; }
}
@media (max-width: 650px) {
  .comparison-grid { grid-template-columns: 1fr; }
  .filter-bar > label { flex: 1 1 160px; }
  .filter-bar input:not([type=checkbox]), .filter-bar select { width: 100%; }
  .auth-panel { margin: 1rem auto; }
  th, td { padding: .6rem .4rem; }
}
@media (forced-colors: active) {
}

#editor-preview { width: 100%; height: 85vh; min-height: 600px; border: 0; }

/* Launch-Page und öffentliche Galerie */
.launch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.launch-card { display: block; padding: 1.2rem; background: var(--paper); border: 1px solid var(--border); border-radius: 6px; color: inherit; text-decoration: none; }
.launch-card:hover { border-color: var(--accent, #2b6cb0); }
.launch-card h2 { margin-top: 0; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin: 1rem 0; }
.gallery-card { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.gallery-card img, .gallery-cover-fallback { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #e8edf2; display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: bold; }
.gallery-card-body { padding: .8rem 1rem 1rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.gallery-card-body h3 { margin: 0; }
.gallery-card-body p { margin: .2rem 0; overflow-wrap: anywhere; }
.gallery-card-body .muted { font-size: .85rem; }
.gallery-card-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: auto; padding-top: .5rem; }
a.button { display: inline-block; padding: .35rem .7rem; border: 1px solid var(--border); border-radius: 4px; text-decoration: none; color: inherit; background: #fff; font-size: .9rem; }
a.button.secondary { background: transparent; }
