:root{
  --bg: #f7f9ff;
  --panel: rgba(255,255,255,.92);
  --panel2: rgba(255,255,255,.96);
  --text: rgba(10,14,25,.96);
  --muted: rgba(10,14,25,.66);
  --border: rgba(15,23,42,.14);
  --accent: #0066ff;
  --red: #ff0033;
  --blue: #0057ff;
  --green: #00c853;
  --orange: #ff6d00;
  --purple: #7c00ff;
  --shadow: 0 14px 40px rgba(15,23,42,.12);
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: var(--sans);
  background:
    radial-gradient(900px 560px at 12% 8%, rgba(0,87,255,.22), transparent 58%),
    radial-gradient(860px 520px at 92% 10%, rgba(255,0,51,.18), transparent 58%),
    radial-gradient(900px 520px at 60% 115%, rgba(124,0,255,.16), transparent 62%),
    radial-gradient(820px 520px at 8% 112%, rgba(0,200,83,.12), transparent 62%),
    var(--bg);
  color: var(--text);
}

.container{
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.app-header{
  padding: 26px 0 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, rgba(255,255,255,.75), rgba(255,255,255,0));
  backdrop-filter: blur(8px);
}
.app-title{
  display:flex;
  gap: 18px;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
}
.kicker{
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 12px;
}
h1{
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: .01em;
}
.subtext{
  margin: 12px 0 0;
  color: var(--muted);
}

.sid-box{
  display:flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.sid-box label{
  font-size: 12px;
  color: var(--muted);
}
.sid-box input{
  width: min(420px, 58vw);
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.92);
  color: var(--text);
  padding: 0 10px;
  font-family: var(--mono);
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.06);
}
.sid-box input::placeholder{
  color: rgba(10,14,25,.42);
}
.sid-box input:focus{
  border-color: rgba(0,87,255,.55);
  box-shadow: 0 0 0 4px rgba(0,87,255,.16), inset 0 0 0 1px rgba(15,23,42,.06);
}

.grid{
  display:grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 16px;
  margin: 18px 0 0;
  position: relative;
  z-index: 2;
}
@media (max-width: 980px){
  .grid{ grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}
@media (max-width: 640px){
  .grid{ grid-template-columns: 1fr; }
}

.panel{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-head{
  display:flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(0,87,255,.10), rgba(124,0,255,.06) 55%, rgba(255,109,0,.06));
}
.panel h2{
  margin:0;
  font-size: 16px;
}
.panel h2 .panel-kicker{
  display:block;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(10,14,25,.60);
  margin-bottom: 2px;
}
.panel h2 .panel-letter{
  display:block;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1;
}
.tag{
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.14);
  color: rgba(10,14,25,.74);
  background: rgba(255,255,255,.70);
}
.tag-blue{ border-color: rgba(0,87,255,.65); color: rgba(0,87,255,1); background: rgba(0,87,255,.12); box-shadow: 0 0 0 2px rgba(0,87,255,.07); }
.tag-red{ border-color: rgba(255,0,51,.65); color: rgba(255,0,51,1); background: rgba(255,0,51,.10); box-shadow: 0 0 0 2px rgba(255,0,51,.06); }
.tag-green{ border-color: rgba(0,200,83,.60); color: rgba(0,200,83,1); background: rgba(0,200,83,.10); box-shadow: 0 0 0 2px rgba(0,200,83,.06); }
.tag-orange{ border-color: rgba(245,158,11,.62); color: rgba(245,158,11,1); background: rgba(245,158,11,.12); box-shadow: 0 0 0 2px rgba(245,158,11,.06); }
.tag-purple{ border-color: rgba(79,70,229,.62); color: rgba(79,70,229,1); background: rgba(79,70,229,.12); box-shadow: 0 0 0 2px rgba(79,70,229,.06); }
/* „aktiv“: gleiche Kontur wie in A–C/E, ohne Nachbar-Glow der Farb-Pille */
.panel-head .tag-aktiv{
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  margin-left: auto;
  user-select: none;
  box-shadow: none;
  border: 1px solid rgba(15,23,42,.14);
  background: rgba(255,255,255,.78);
}
.panel-head input[type="checkbox"]{
  transform: translateY(1px);
  accent-color: var(--accent);
}

.form-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 14px;
}
.field label{
  display:block;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px;
}
.field select{
  width: 100%;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff8c6;
  color: var(--text);
  padding: 0 10px;
  outline: none;
}
.field select:disabled{
  background: #fffde3;
  color: rgba(10,14,25,.55);
  opacity: .85;
}
.field select:focus{
  border-color: rgba(0,87,255,.55);
  box-shadow: 0 0 0 4px rgba(0,87,255,.16);
}

.actions-btns{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}
.actions-btns .btn{
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-shadow: 0 10px 28px rgba(15,23,42,.10);
}
.actions-btns .btn-primary{
  /* gleiche optische Basisfläche wie Nebenbutton */
  box-shadow: 0 14px 34px rgba(0,87,255,.22), 0 14px 34px rgba(255,0,51,.18), 0 14px 34px rgba(124,0,255,.16);
}
.actions{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  margin: 16px 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel2);
  box-shadow: var(--shadow);
  position: relative;
  z-index: 2;
}
.status{
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
}

.btn{
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(15,23,42,.14);
  cursor: pointer;
  font-weight: 600;
  color: rgba(10,14,25,.92);
  background: rgba(255,255,255,.92);
  transition: transform .10s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}
.btn:disabled{
  cursor:not-allowed;
  opacity: .55;
}
.btn-primary{
  border-color: rgba(0,87,255,.55);
  color: rgba(255,255,255,.98);
  background: linear-gradient(90deg, rgba(0,87,255,1), rgba(255,0,51,1) 55%, rgba(124,0,255,1));
  box-shadow: 0 14px 34px rgba(0,87,255,.22), 0 14px 34px rgba(255,0,51,.18), 0 14px 34px rgba(124,0,255,.16);
}
.btn-secondary{
  border-color: rgba(15,23,42,.14);
  background: rgba(255,255,255,.82);
}
.btn:hover:not(:disabled){
  transform: translateY(-1px);
  border-color: rgba(0,87,255,.45);
  box-shadow: 0 18px 45px rgba(15,23,42,.18);
}
.btn:active:not(:disabled){
  transform: translateY(0px);
}

.result{
  margin: 16px 0 28px;
  position: relative;
  z-index: 0;
}
.canvas-wrap{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
  overflow:auto;
}
canvas{
  display:block;
  max-width: 100%;
}
.details{
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 8px 12px;
}
.details summary{
  cursor:pointer;
  color: var(--text);
  font-weight: 600;
  padding: 8px 0;
}
.questions{
  margin: 8px 0 10px 18px;
  color: var(--muted);
}
.note{
  color: var(--muted);
  font-size: 12px;
  padding-bottom: 8px;
}

.details-overlay{
  position: fixed;
  z-index: 50;
  width: min(520px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 24px));
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.98);
  box-shadow: 0 24px 70px rgba(15,23,42,.25);
}
.details-overlay[hidden]{ display:none; }
.details-overlay-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(0,87,255,.10), rgba(255,0,51,.08) 55%, rgba(124,0,255,.08));
}
.details-overlay-title{
  font-weight: 900;
  font-size: 13px;
}
.details-overlay-close{
  width: 34px;
  padding: 0;
  font-size: 18px;
  line-height: 34px;
  height: 34px;
  border-radius: 10px;
}
.details-overlay-body{
  padding: 12px;
  overflow: auto;
  max-height: 460px;
}
.details-line{
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 900;
  margin: 6px 0;
}

