/* Studio, Kundenkonto, Admin. Nutzt die Variablen und Bausteine aus style.css */
.app { padding-block: clamp(28px, 5vw, 56px) clamp(56px, 8vw, 96px); }
.app h1 { font: 800 clamp(1.8rem, 4.5vw, 2.7rem)/1.1 var(--display); margin: 10px 0 10px; }
.app .lead { max-width: 640px; }
.app-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; margin-top: 26px; }
@media (max-width: 920px) { .app-grid { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(18px, 3vw, 26px); }
.panel + .panel { margin-top: 16px; }
.panel h2 { font: 700 1.2rem var(--display); margin: 0 0 4px; display: flex; gap: 10px; align-items: center; }
.panel h2 .num { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--surface, #fff); display: inline-grid; place-items: center; font: 600 0.85rem var(--mono); flex: none; }
.panel.done h2 .num { background: var(--rec); color: var(--rec-ink); }
.panel .sub { color: var(--muted); margin: 0 0 16px; font-size: 0.95rem; }
.panel.locked { opacity: .55; pointer-events: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > input { flex: 1 1 240px; }
.app input, .app textarea, .app select { width: 100%; font: inherit; color: var(--ink); background: var(--field); border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px; box-sizing: border-box; }
.app textarea { min-height: 90px; resize: vertical; }
.app label { font-weight: 600; font-size: 0.9rem; display: block; margin: 12px 0 6px; }
.app .hint { color: var(--muted); font-weight: 400; }
.app .err { color: #c0262d; font-size: 0.92rem; margin: 10px 0 0; }
.app .ok-note { color: #1d7a46; font-size: 0.92rem; margin: 10px 0 0; }
.prod { display: grid; grid-template-columns: 120px 1fr; gap: 16px; margin-top: 16px; }
.prod .main-img { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--field); }
@media (max-width: 520px) { .prod { grid-template-columns: 1fr; } }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumbs label { margin: 0; position: relative; cursor: pointer; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 2px solid var(--line); display: block; }
.thumbs input { position: absolute; opacity: 0; }
.thumbs input:checked + img { border-color: var(--rec); }
.thumbs input:not(:checked) + img { opacity: .4; }
.cr-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; max-height: 470px; overflow-y: auto; padding: 2px; }
.cr-pick button { all: unset; cursor: pointer; display: grid; gap: 4px; text-align: left; border-radius: 12px; padding: 4px; border: 2px solid transparent; }
.cr-pick button[aria-pressed="true"] { border-color: var(--rec); }
.cr-pick button:focus-visible { outline: 2px solid var(--ink); }
.cr-pick img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 9px; display: block; }
.cr-pick b { font: 700 0.9rem var(--display); }
.cr-pick span { font-size: 0.75rem; color: var(--muted); }
.cr-pick .demo { color: var(--rec); font-weight: 600; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button { border: 1.5px solid var(--line); background: var(--field); border-radius: 999px; padding: 8px 13px; font: 600 0.86rem var(--body); cursor: pointer; color: var(--ink); }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--surface, #fff); border-color: var(--ink); }
.app textarea.script, .script { white-space: pre-wrap; font-size: 1rem; line-height: 1.55; min-height: 220px; }
.loading { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.loading::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--rec); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pkgs { display: grid; gap: 10px; }
.pkgs label { margin: 0; display: flex; gap: 12px; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; font-weight: 500; }
.pkgs label:has(input:checked) { border-color: var(--rec); box-shadow: 0 0 0 1px var(--rec) inset; }
.pkgs input { width: auto; accent-color: var(--rec); }
.pkgs b { font-family: var(--display); }
.pkgs .p { margin-left: auto; font-weight: 700; white-space: nowrap; }
.check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; font-size: 0.92rem !important; }
.check input { width: auto; margin-top: 3px; accent-color: var(--rec); }
.tabs { display: flex; gap: 6px; margin-bottom: 4px; }
.tabs button { border: 0; background: none; font: 700 0.95rem var(--display); color: var(--muted); padding: 6px 2px; margin-right: 12px; border-bottom: 2px solid transparent; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--rec); }
.summary { position: sticky; top: 84px; }
.summary dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 10px 0 0; font-size: 0.92rem; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.summary .total { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; display: flex; justify-content: space-between; font: 800 1.2rem var(--display); }
.summary .small { color: var(--muted); font-size: 0.82rem; margin: 8px 0 0; }
.btn.wide { width: 100%; justify-content: center; }
/* Konto */
.orders { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.orders a { display: grid; grid-template-columns: 54px 1fr auto; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; color: var(--ink); }
.orders img { width: 54px; height: 72px; object-fit: cover; border-radius: 9px; }
.orders b { font-family: var(--display); display: block; }
.orders small { color: var(--muted); }
.badge { font: 600 0.72rem/1 var(--mono); text-transform: uppercase; letter-spacing: .04em; padding: 7px 9px; border-radius: 999px; background: var(--field); border: 1px solid var(--line); white-space: nowrap; }
.badge.geliefert, .badge.abgenommen { background: #e5f5ec; border-color: #b7e0c7; color: #12603a; }
.badge.korrektur, .badge.pruefung { background: #fff4e0; border-color: #f2d49b; color: #7a4d00; }
.badge.in_produktion { background: #e8f0ff; border-color: #bcd0f7; color: #1d3f8a; }
.timeline { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding-bottom: 12px; position: relative; color: var(--muted); }
.timeline li::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); margin-top: 4px; z-index: 1; }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 7px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.timeline li.on { color: var(--ink); font-weight: 600; }
.timeline li.on::before { background: var(--rec); border-color: var(--rec); }
.player { width: 100%; max-width: 340px; aspect-ratio: 9 / 16; border-radius: 16px; background: #0E1219; display: block; }
.thread { display: grid; gap: 10px; margin: 12px 0; max-height: 420px; overflow-y: auto; }
.msg { padding: 10px 13px; border-radius: 14px; max-width: 85%; font-size: 0.94rem; white-space: pre-wrap; }
.msg small { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 4px; }
.msg.kunde { background: var(--ink); color: var(--surface, #fff); justify-self: end; }
.msg.kunde small { color: rgba(255,255,255,.65); }
.msg.team { background: var(--field); border: 1px solid var(--line); }
.msg.system { background: none; border: 1px dashed var(--line); color: var(--muted); max-width: 100%; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; font-size: 0.93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.back { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.empty-state { text-align: center; padding: 34px 16px; color: var(--muted); }
/* Admin */
.adm table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.adm th, .adm td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.adm tr[data-id] { cursor: pointer; }
.adm tr[data-id]:hover { background: var(--field); }
.adm .tbl { overflow-x: auto; }
/* Chat-Widget */
.chat-fab { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40; border: 0; border-radius: 999px; background: var(--rec, #e5373f); color: var(--rec-ink, #fff); font: 700 0.95rem var(--display, system-ui); padding: 13px 18px; box-shadow: 0 16px 36px -14px rgba(0,0,0,.55); cursor: pointer; display: flex; gap: 8px; align-items: center; }
.chat-fab i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.chat-box { position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 41; width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100dvh - 110px)); background: var(--surface, #fff); color: var(--ink, #0E1219); border: 1px solid var(--line, #ddd); border-radius: 18px; box-shadow: 0 28px 60px -20px rgba(0,0,0,.5); display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; }
.chat-box header { padding: 14px 16px; border-bottom: 1px solid var(--line, #ddd); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.chat-box header b { font-family: var(--display, system-ui); }
.chat-box header small { display: block; color: var(--muted, #666); font-size: 0.75rem; }
.chat-box header button { border: 0; background: none; font-size: 1.5rem; cursor: pointer; color: var(--muted, #666); line-height: 1; }
.chat-log { padding: 14px; overflow-y: auto; display: grid; gap: 10px; align-content: start; }
.chat-log .m { padding: 9px 12px; border-radius: 14px; font-size: 0.93rem; line-height: 1.45; white-space: pre-wrap; max-width: 88%; }
.chat-log .m.user { background: var(--ink, #0E1219); color: #fff; justify-self: end; }
.chat-log .m.assistant { background: var(--field, #f3f3f3); border: 1px solid var(--line, #ddd); }
.chat-log .m a { color: inherit; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line, #ddd); }
.chat-form input { flex: 1; font: inherit; border: 1.5px solid var(--line, #ddd); border-radius: 12px; padding: 10px 12px; background: var(--field, #fff); color: var(--ink, #0E1219); min-width: 0; }
.chat-form button { border: 0; border-radius: 12px; background: var(--rec, #e5373f); color: var(--rec-ink, #fff); font-weight: 700; padding: 0 14px; cursor: pointer; }
.chat-sugg { display: flex; gap: 6px; flex-wrap: wrap; }
.chat-sugg button { border: 1px solid var(--line, #ddd); background: none; border-radius: 999px; padding: 6px 10px; font-size: 0.82rem; cursor: pointer; color: var(--ink, #0E1219); }
.linkish { border: 0; background: none; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; font-size: 0.92rem; }
