/* Google Stores: baut auf gk.css (BG Google) auf, eigene Akzentfarbe (Kupfer) und die Teile
   für Hochladen, Fragen, Quellen und Mitschrift. */

:root {
  --bg: #f4f2ef;
  --surface-2: #f8f7f5;
  --line: #e6e1db;
  --line-2: #d6cfc7;
  --ink-2: #514a44;
  --ink-3: #857d75;
  --accent: #b4501a;
  --accent-ink: #ffffff;
  --accent-soft: #f8e7dc;
  --k-beachten: #b4501a;   --k-beachten-bg: #f8e7dc;
  --k-vorgehen: #2456b8;   --k-vorgehen-bg: #e5edfb;
  --k-richtwert: #8a6200;  --k-richtwert-bg: #f8efd6;
  --k-fehler: #b4232f;     --k-fehler-bg: #fbe5e7;
  --k-tipp: #23775f;       --k-tipp-bg: #e0f1eb;
  --ok: #23775f;
  --run: #2456b8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110f;
    --surface: #1c1815;
    --surface-2: #221d1a;
    --ink: #f0ebe6;
    --ink-2: #bdb4ab;
    --ink-3: #8c837b;
    --line: #322b26;
    --line-2: #413832;
    --accent: #f08a4b;
    --accent-ink: #2a1306;
    --accent-soft: #3a2316;
    --k-beachten: #f08a4b;   --k-beachten-bg: #3a2316;
    --k-vorgehen: #7fa6ff;   --k-vorgehen-bg: #18243d;
    --k-richtwert: #e8bd5a;  --k-richtwert-bg: #33290f;
    --k-fehler: #ff7a84;     --k-fehler-bg: #3a1a1e;
    --k-tipp: #5fd1ac;       --k-tipp-bg: #13302a;
    --ok: #5fd1ac;
    --run: #7fa6ff;
  }
}

.gs-mark svg { width: 17px; height: 17px; stroke-width: 2; }
.gs-mark-g { background: #0d6b55 !important; color: #fff !important; }

.gk-kind-beachten { color: var(--k-beachten); background: var(--k-beachten-bg); }
.gk-kind-vorgehen { color: var(--k-vorgehen); background: var(--k-vorgehen-bg); }
.gk-kind-richtwert { color: var(--k-richtwert); background: var(--k-richtwert-bg); }
.gk-kind-fehler { color: var(--k-fehler); background: var(--k-fehler-bg); }
.gk-kind-tipp { color: var(--k-tipp); background: var(--k-tipp-bg); }

/* ---------- Fragen ---------- */
.gs-ask {
  margin: 18px 0 6px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.gs-ask form { display: flex; gap: 8px; }
.gs-ask textarea {
  flex: 1; min-width: 0; min-height: 44px; max-height: 160px; resize: none; padding: 10px 12px; line-height: 1.45;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); outline: none;
}
.gs-ask textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.gs-ask form .gk-btn { height: 44px; align-self: flex-end; }
.gs-ask-hint { margin: 8px 2px 0; font-size: 12.5px; color: var(--ink-3); }
.gs-answer { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.gs-answer .gk-content { max-width: 72ch; }
.gs-answer a.gs-cite { font-size: 12px; font-weight: 600; text-decoration: none; padding: 0 4px; border-radius: 4px; background: var(--accent-soft); white-space: nowrap; }
.gs-answer-meta { font-size: 12px; color: var(--ink-3); margin-top: 8px; }

/* ---------- In Arbeit ---------- */
.gs-jobs { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.gs-job {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: center;
  padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-align: left; width: 100%; cursor: pointer;
}
.gs-job:hover { border-color: var(--line-2); }
.gs-job-title { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-job-st { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gs-job .gk-bar { height: 6px; }
.gs-job .gk-bar > i { background: var(--run); transition: width 0.6s ease; }

/* ---------- Quellen ---------- */
.gs-sources { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gs-source {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 2px 12px; align-items: center;
  width: 100%; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer;
}
.gs-source:last-child { border-bottom: 0; }
.gs-source:hover { background: var(--surface-2); }
.gs-src-ico { grid-row: span 2; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.gs-src-ico svg { width: 18px; height: 18px; }
.gs-src-title { font-weight: 600; font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; }
.gs-src-meta { grid-column: 2 / -1; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.gs-st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--run); }
.gs-st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.gs-st-fertig { color: var(--ok); }
.gs-st-fehler { color: var(--danger); }
.gs-st-wartet, .gs-st-upload { color: var(--ink-3); }
.gs-st-run::before { animation: gs-pulse 1.4s ease-in-out infinite; }
@keyframes gs-pulse { 50% { opacity: 0.3; } }

.gs-panel { margin: 0 0 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.gs-panel p { margin: 0 0 6px; color: var(--ink-2); }
.gs-panel p:last-child { margin-bottom: 0; }
.gs-panel.is-error { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger) 6%, var(--surface)); }
.gs-panel .gk-bar { margin-top: 10px; }
.gs-panel .gk-bar > i { background: var(--run); transition: width 0.6s ease; }
.gs-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.gs-chapters { margin: 0; padding: 0; list-style: none; }
.gs-chapters li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; padding: 5px 0; color: var(--ink-2); }
.gs-chapters li.gs-nots { grid-template-columns: minmax(0, 1fr); }
.gs-ts {
  border: 0; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 12.5px; border-radius: 6px;
  padding: 1px 7px; cursor: pointer; font-variant-numeric: tabular-nums; justify-self: start; height: fit-content;
}
.gs-ts:hover { filter: brightness(0.96); }
.gs-ts:disabled { background: var(--surface-2); color: var(--ink-3); cursor: default; }

.gs-player {
  position: sticky; top: calc(var(--head-h) + env(safe-area-inset-top, 0px) + 8px); z-index: 5;
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.gs-player audio { width: 100%; height: 36px; }

.gs-transcript { max-height: 520px; overflow-y: auto; padding: 4px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.gs-tline { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.gs-tline:last-child { border-bottom: 0; }
.gs-tline.is-now { color: var(--ink); }
.gs-tline.is-now .gs-ts { background: var(--accent); color: var(--accent-ink); }
.gs-plain { white-space: pre-wrap; font-size: 14px; color: var(--ink-2); padding: 12px 0; }
details.gs-details > summary { cursor: pointer; font: 700 18px/1.3 var(--font-display); margin: 30px 0 12px; list-style: none; }
details.gs-details > summary::-webkit-details-marker { display: none; }
details.gs-details > summary::after { content: " ▾"; color: var(--ink-3); font-size: 14px; }
details.gs-details[open] > summary::after { content: " ▴"; }

/* ---------- Hochladen ---------- */
.gs-drop {
  display: grid; place-items: center; gap: 6px; padding: 26px 16px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line-2); border-radius: var(--radius); background: var(--surface-2); color: var(--ink-2);
}
.gs-drop:hover, .gs-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.gs-drop b { color: var(--ink); font-size: 15px; }
.gs-drop small { color: var(--ink-3); }
.gs-files { margin: 12px 0 4px; display: flex; flex-direction: column; gap: 8px; }
.gs-file { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.gs-file .gk-input { height: 36px; padding: 0 10px; }
.gs-file small { grid-column: 1 / -1; color: var(--ink-3); font-size: 12px; }
.gs-file button { border: 0; background: none; color: var(--ink-3); font-size: 20px; cursor: pointer; line-height: 1; padding: 0 4px; }
.gs-tabs { display: flex; gap: 4px; margin: -4px 0 14px; }

.gs-uploads {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 70;
  width: min(360px, calc(100vw - 32px)); padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.gs-uploads h4 { margin: 0 0 8px; font: 700 14px/1.3 var(--font-display); display: flex; justify-content: space-between; gap: 8px; }
.gs-uploads h4 button { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 18px; line-height: 1; }
.gs-up { margin: 8px 0; font-size: 13px; }
.gs-up-top { display: flex; justify-content: space-between; gap: 10px; }
.gs-up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.gs-up-pct { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gs-up .gk-bar { height: 5px; margin-top: 4px; }
.gs-up.is-err .gs-up-pct { color: var(--danger); }
.gs-up.is-done .gk-bar > i { background: var(--ok); }

.gs-budget { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13px; color: var(--ink-2); }
.gs-budget input { width: 90px; height: 32px; padding: 0 8px; }

@media (max-width: 640px) {
  .gs-ask form { flex-direction: column; }
  .gs-ask form .gk-btn { align-self: stretch; }
  .gs-ask textarea { min-height: 64px; }
  .gs-chapters li, .gs-tline { grid-template-columns: 64px minmax(0, 1fr); }
  .gs-source { grid-template-columns: 34px minmax(0, 1fr); }
  .gs-source .gs-st { grid-column: 2; justify-self: start; }
}
