/* ATLAS - Automationen, Spotify, Cover-Anzeige */

/* Schalter */
.au-switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; color: var(--text2); user-select: none; }
.au-switch input { display: none; }
.au-switch span { width: 36px; height: 20px; border-radius: 99px; background: var(--panel3); position: relative; transition: background .18s; flex: none; border: 1px solid var(--line2); }
.au-switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .18s var(--ease), background .18s; }
.au-switch input:checked + span { background: color-mix(in srgb, #4fd18b 40%, transparent); border-color: #4fd18b; }
.au-switch input:checked + span::after { transform: translateX(16px); background: #4fd18b; }

.au-status { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 13.5px; color: var(--text2); }
.au-status.on { border-color: color-mix(in srgb, #4fd18b 40%, var(--line)); }
.au-rules { display: flex; flex-direction: column; gap: 10px; }
.au-rule { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.au-rule.off { opacity: .55; }
.au-flow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.au-flow > b { font: 600 15px var(--display); letter-spacing: .01em; }
.au-flow small { color: var(--faint); font-size: 11.5px; }
.au-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--text2); }
.au-line > .i { color: var(--accent); width: 15px; height: 15px; }
.au-k { font: 700 10.5px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--bg); background: var(--accent); padding: 2px 7px; border-radius: 5px; }
.au-line:nth-child(3) .au-k { background: #8b9cff; }
.au-k.big { display: inline-block; margin-bottom: 10px; font-size: 11.5px; }
.au-act { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); font-size: 12.5px; }
.au-act .i { width: 13px; height: 13px; color: #8b9cff; }
.au-then .i { width: 12px; height: 12px; color: var(--faint); }
.au-p { color: var(--muted); }
.au-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.au-tpl { display: grid; grid-template-columns: auto 1fr; column-gap: 11px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line2); background: transparent; color: var(--text2); transition: border-color .15s, background .15s; }
.au-tpl:hover { border-color: var(--accent); background: var(--panel); color: var(--text); }
.au-tpl .i { grid-row: 1 / 3; width: 20px; height: 20px; color: var(--accent); margin-top: 2px; }
.au-tpl b { font-size: 13.5px; }
.au-tpl small { color: var(--muted); font-size: 11.8px; }
.au-log { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.au-log:last-child { border-bottom: 0; }
.au-log .meta { flex: 1; min-width: 0; }
.au-log .meta b { display: block; font-size: 13px; }
.au-log .meta small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-log .when { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Editor */
.au-block { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg2); display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.au-block > .au-k, .au-block > .au-vars, .au-block > .btn, .au-block > .au-action { grid-column: 1 / -1; justify-self: start; }
.au-block > .au-action { justify-self: stretch; }
.au-vars { color: var(--faint); font-size: 11.5px; }
.au-action { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel); }
.au-action-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.au-action-head .i { color: #8b9cff; }
.au-action-head select { flex: 1; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg2); padding: 6px 9px; }
.au-days { display: flex; gap: 4px; flex-wrap: wrap; }
.au-days label { cursor: pointer; }
.au-days input { display: none; }
.au-days span { display: inline-block; padding: 5px 9px; border-radius: 7px; border: 1px solid var(--line2); font-size: 12px; color: var(--muted); }
.au-days input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Spotify */
.sp-box { margin-top: 14px; }
.sp-setup { border: 1px dashed var(--line2); border-radius: 11px; padding: 10px 12px; font-size: 13px; }
.sp-setup summary { cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sp-setup summary .i { color: #1ed760; }
.sp-setup summary span { color: var(--muted); font-size: 12px; }
.sp-uri { font: 12px var(--mono); padding: 2px 6px; border-radius: 5px; background: var(--panel2); border: 1px solid var(--line); }
.sp-ok { display: flex; align-items: center; gap: 9px; font-size: 12.8px; color: var(--text2); }
.sp-ok .i { color: #1ed760; }
.sp-ok span { flex: 1; }

/* Cover gross: Hintergrund aus dem Album-Cover */
.cc-music, .music-panel { position: relative; overflow: hidden; isolation: isolate; }
.cc-music.has-cover::before, .music-panel.has-cover::before { content: ""; position: absolute; inset: -40px; z-index: -1; background: var(--cover) center / cover; filter: blur(34px) saturate(1.4) brightness(.55); opacity: .9; }
.music-panel.has-cover .panel-title, .music-panel.has-cover .mp-meta small, .music-panel.has-cover .mp-time { color: rgba(255, 255, 255, .78); }
.music-panel.has-cover .mp-meta b, .cc-music.has-cover .mp-meta b { color: #fff; }
.cc-music.has-cover .mp-meta small { color: rgba(255, 255, 255, .75); }
.cc-music.has-cover { border-color: transparent; }
.cc-music.has-cover .mp-cover { width: 56px; height: 56px; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.music-panel.has-cover .mp.big .mp-cover { width: 168px; height: 168px; border-radius: 16px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.music-panel.has-cover .mp.big { flex-direction: column; align-items: center; text-align: center; }
.music-panel.has-cover .mp.big .mp-meta { width: 100%; }
.music-panel.has-cover .mp-bar { background: rgba(255, 255, 255, .2); }
.music-panel.has-cover .mp-bar i { background: #fff; }
.music-panel.has-cover .icon-btn { color: #fff; }

/* Oben in der Leiste: drehende Platte mit Cover */
.now-chip { display: flex; align-items: center; gap: 9px; height: 31px; max-width: 240px; padding: 0 12px 0 4px; margin-right: 11px; border-radius: 99px;
  background: var(--tb-sys-bg); border: 1px solid var(--tb-sys-line); }
.now-chip[hidden] { display: none; }
.now-disc { width: 24px; height: 24px; border-radius: 50%; overflow: hidden; flex: none; background: var(--panel3); display: grid; place-items: center; animation: spin 6s linear infinite; box-shadow: 0 0 0 2px #000 inset; }
.now-disc img { width: 100%; height: 100%; object-fit: cover; }
.now-disc .i { width: 13px; height: 13px; }
.now-txt { min-width: 0; line-height: 1.15; }
.now-txt b { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-txt small { display: block; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1400px) { .now-txt { display: none; } .now-chip { padding-right: 4px; } }

/* Editor: Wenn- und Dann-Block untereinander, volle Breite */
#auForm > .au-block { grid-column: 1 / -1; }
.au-block > .au-k { align-self: start; }
.au-action .form { grid-template-columns: 1fr 1fr; }
.modal:has(#auForm) { width: min(780px, 94vw); }
.top .scan-pill span { white-space: nowrap; }
.now-chip { max-width: 210px; }
@media (max-width: 1560px) { .now-txt { display: none; } .now-chip { padding-right: 4px; } }

/* Outlook-Sperre */
.guard-box { margin: 16px; padding: 14px 16px; border-radius: 12px; border: 1px solid color-mix(in srgb, #f2b84b 45%, transparent); background: color-mix(in srgb, #f2b84b 8%, transparent); font-size: 13px; color: var(--text2); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.guard-box > .i { color: #f2b84b; width: 20px; height: 20px; }
.guard-box p { margin: 0; }
.guard-box small { color: var(--muted); }
.guard-box.small { flex-direction: row; align-items: center; margin: 0 0 16px; }
.guard-box a { color: var(--accent); }
