/* Cocos Verlauf Gesamt — style adopted from Claude Design "Verlauf Gesamt.dc.html" */

.cv2 {
  --cv2-primary: #F5A623;
  --cv2-primary-h: #E0951A;
  --cv2-bg: #FDF8EC;
  --cv2-card: #FFFFFF;
  --cv2-text: #1C1A17;
  --cv2-sub: #8C8578;
  --cv2-sub-2: #9A927F;
  --cv2-sub-3: #A39A86;
  --cv2-border: #EFE7D6;
  --cv2-border-2: #F2ECDD;
  --cv2-row-border: #F0EADC;
  --cv2-input-bg: #FCFAF4;
  --cv2-input-border: #E8E0CE;
  --cv2-pill-bg: #F6F1E4;
  --cv2-pill-text: #4A453B;
  --cv2-link: #B26A00;
  --cv2-link-h: #8A5200;
  --cv2-r-card: 16px;

  display: block;
  font-family: 'DM Sans', Helvetica, Arial, sans-serif;
  color: var(--cv2-text);
  box-sizing: border-box;
}
.cv2 * { box-sizing: border-box; }
.cv2 a { color: var(--cv2-link); text-decoration: none; }
.cv2 a:hover { color: var(--cv2-link-h); text-decoration: underline; }

/* ── Header ── */
.cv2-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.cv2-header-text { display: flex; flex-direction: column; gap: 6px; }
.cv2-eyebrow {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cv2-sub);
  font-weight: 500;
}
.cv2-title {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  line-height: 1.1;
  color: var(--cv2-text);
  font-size: 28px;
}
.cv2-header-actions { display: flex; align-items: center; gap: 12px; flex: 1 1 260px; justify-content: flex-end; }
.cv2-updated { font-size: 13px; color: var(--cv2-sub); }
.cv2-refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: 10px;
  background: var(--cv2-primary) !important;
  color: #fff !important;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: normal;
  text-shadow: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(80,55,0,.18);
}
.cv2-refresh-btn:hover { background: var(--cv2-primary-h) !important; }
.cv2-refresh-btn:focus,
.cv2-refresh-btn:focus-visible { outline: 2px solid var(--cv2-primary-h); outline-offset: 2px; }
.cv2-refresh-btn:disabled { opacity: .6; cursor: default; }
.cv2-spinner {
  display: none;
  width: 14px; height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: cv2-spin .7s linear infinite;
}
.cv2-refresh-btn.is-loading .cv2-spinner { display: inline-block; }
@keyframes cv2-spin { to { transform: rotate(360deg); } }

/* ── Panel (outer white container) ── */
.cv2-panel {
  background: var(--cv2-card);
  border: 1px solid var(--cv2-border);
  border-radius: var(--cv2-r-card);
  box-shadow: 0 1px 2px rgba(90,70,20,.05);
  overflow: hidden;
}

/* ── Toolbar ── */
.cv2-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--cv2-border-2);
}
.cv2-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--cv2-input-border);
  border-radius: 9px;
  background: var(--cv2-input-bg);
  flex: 1 1 220px;
  min-width: 180px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.cv2-search-wrap:focus-within {
  border-color: var(--cv2-primary);
  box-shadow: 0 0 0 3px rgba(245,166,35,.16);
}
.cv2-search-dot { display: inline-block; width: 12px; height: 12px; flex: none; border: 1.5px solid #A69C88; border-radius: 50%; }
.cv2-search {
  flex: 1; min-width: 0; background: transparent; font-size: 14px; color: var(--cv2-text); font-family: inherit;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}
.cv2-search:focus,
.cv2-search:focus-visible { border: none !important; outline: none !important; box-shadow: none !important; }
.cv2-search-clear { flex: none; cursor: pointer; font-size: 14px; color: var(--cv2-sub-3); padding: 0 2px; display: none; }
.cv2-search-clear:hover { color: #4A453B; }
.cv2-search-wrap.has-query .cv2-search-clear { display: inline-block; }

.cv2-tabs { display: flex; padding: 3px; gap: 2px; background: #F6F1E4; border-radius: 9px; overflow-x: auto; max-width: 100%; }
.cv2-tab { padding: 7px 14px; border-radius: 7px; font-size: 13px; white-space: nowrap; cursor: pointer; color: #7A7365; font-weight: 500; transition: background-color .18s ease, color .18s ease, box-shadow .18s ease; }
.cv2-tab.is-active { background: #fff; color: var(--cv2-text); font-weight: 700; box-shadow: 0 1px 1px rgba(80,60,10,.08); }


.cv2-counts { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.cv2-count-text { font-size: 13px; color: var(--cv2-sub); }
.cv2-count-num { font-weight: 700; color: var(--cv2-text); }
.cv2-toggle-all { font-size: 13px; font-weight: 700; color: var(--cv2-link); cursor: pointer; white-space: nowrap; }
.cv2-toggle-all:hover { color: var(--cv2-link-h); }

/* ── Empty state ── */
.cv2-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 56px 20px; }
.cv2-empty-title { font-size: 15px; font-weight: 700; color: var(--cv2-text); }
.cv2-empty-sub { font-size: 13px; color: var(--cv2-sub); }
.cv2-reset-filters { margin-top: 6px; padding: 8px 14px; border: 1px solid var(--cv2-input-border); border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--cv2-link); cursor: pointer; }
.cv2-reset-filters:hover { border-color: var(--cv2-primary); }

/* ── Wide table ── */
.cv2-wide { display: block; }
.cv2-narrow { display: none; }
.cv2-scroll { overflow-x: auto; }
.cv2-min { min-width: 1060px; }

.cv2-grid { display: grid; grid-template-columns: 230px 160px 180px 200px 160px 1fr 44px; align-items: center; }
.cv2-grid--head {
  padding: 12px 20px;
  background: var(--cv2-input-bg);
  border-bottom: 1px solid var(--cv2-border);
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--cv2-sub);
  font-weight: 700;
}
.cv2-group { border-bottom: 1px solid var(--cv2-row-border); }
.cv2-row { padding: 14px 20px; transition: background-color .15s ease; }
.cv2-row:hover { background: #FDFBF5; }

.cv2-status-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cv2-status-cell.is-toggle { cursor: pointer; }
.cv2-chev {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: rgba(245,166,35,.14);
  color: var(--cv2-link-h);
  font-size: 11px;
  transition: transform .32s cubic-bezier(.34,1.56,.64,1), background-color .2s ease, color .2s ease;
}
.cv2-status-cell.is-toggle:hover .cv2-chev { background: rgba(245,166,35,.26); }
.cv2-group.is-open .cv2-chev { transform: rotate(90deg); background: var(--cv2-primary); color: #fff; }
.cv2-status-text { font-size: 14px; font-weight: 500; color: var(--cv2-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv2-more-badge { flex: none; padding: 2px 7px; border-radius: 20px; background: var(--cv2-pill-bg); font-size: 11px; font-weight: 700; color: #8A7F6C; }

.cv2-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #B8AFA0; }
.cv2-dot--sm { width: 6px; height: 6px; }
.cv2-dot--aktiv { background: #3FA96B; }
.cv2-dot--inaktiv { background: #B8AFA0; }
.cv2-dot--pause { background: #5B8DEF; }
.cv2-dot--offline-gestartet,
.cv2-dot--offline { background: var(--cv2-primary); }

.cv2-timecell { display: flex; flex-direction: column; gap: 2px; }
.cv2-time { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--cv2-text); }
.cv2-date { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--cv2-sub-2); }

.cv2-name { font-size: 14px; font-weight: 700; color: var(--cv2-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 12px; }

.cv2-session-cell { padding-right: 12px; min-width: 0; }
.cv2-session-pill {
  display: inline-block;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--cv2-pill-bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--cv2-pill-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.cv2-dauer { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--cv2-text); }

.cv2-active-cell { display: flex; align-items: center; gap: 12px; padding-right: 16px; }
.cv2-active-cell.is-toggle { cursor: pointer; }
.cv2-activity-icon {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; flex: none; border-radius: 50%;
  background: rgba(245,166,35,.14);
  color: var(--cv2-link-h);
  font-size: 10px;
  transition: transform .32s cubic-bezier(.34,1.56,.64,1), background-color .2s ease, color .2s ease;
}
.cv2-active-cell.is-toggle:hover .cv2-activity-icon,
.cv2-card-stat.cv2-activity-toggle.is-toggle:hover .cv2-activity-icon { background: rgba(245,166,35,.26); }
.cv2-group.is-activity-open .cv2-activity-icon,
.cv2-card.is-activity-open .cv2-activity-icon { transform: rotate(180deg); background: var(--cv2-primary); color: #fff; }
.cv2-bar { flex: 1; max-width: 170px; height: 6px; border-radius: 99px; background: #F1EADB; overflow: hidden; }
.cv2-bar-fill { height: 100%; border-radius: 99px; background: var(--cv2-primary); transition: width .35s cubic-bezier(.4,0,.2,1); }
.cv2-active-label { font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 500; color: #4A453B; white-space: nowrap; }

.cv2-menu-cell { display: flex; justify-content: flex-end; }
.cv2-menu-dots { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; color: var(--cv2-sub-3); font-size: 16px; font-weight: 700; letter-spacing: 1px; cursor: default; }

/* ── Smooth Collapse (Grid-Rows-Trick: 0fr→1fr, kein JS-Höhen-Messen nötig) ── */
.cv2-history-wide,
.cv2-history-narrow,
.cv2-activity-wide,
.cv2-activity-narrow {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .34s cubic-bezier(.4,0,.2,1);
}
.cv2-group.is-open .cv2-history-wide,
.cv2-card.is-open .cv2-history-narrow,
.cv2-group.is-activity-open .cv2-activity-wide,
.cv2-card.is-activity-open .cv2-activity-narrow { grid-template-rows: 1fr; }

.cv2-collapse-inner {
  min-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .22s ease, transform .22s ease;
}
.cv2-group.is-open .cv2-history-wide .cv2-collapse-inner,
.cv2-card.is-open .cv2-history-narrow .cv2-collapse-inner,
.cv2-group.is-activity-open .cv2-activity-wide .cv2-collapse-inner,
.cv2-card.is-activity-open .cv2-activity-narrow .cv2-collapse-inner {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .28s ease .08s, transform .28s ease .08s;
}

/* ── History (wide) ── */
.cv2-history-wide-body { background: var(--cv2-input-bg); border-top: 1px solid var(--cv2-border-2); padding: 6px 20px 12px; }
.cv2-history-label { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: #A0977F; font-weight: 700; padding: 8px 0 6px 30px; }
.cv2-history-row { padding: 8px 0; }
.cv2-history-status { display: flex; align-items: center; gap: 8px; padding-left: 30px; min-width: 0; }
.cv2-history-status span:last-child { font-size: 13px; color: #4A453B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv2-history-time { display: flex; align-items: baseline; gap: 8px; }
.cv2-history-time span:first-child { font-size: 13px; font-variant-numeric: tabular-nums; color: #4A453B; }
.cv2-history-date { font-size: 11px; font-variant-numeric: tabular-nums; color: #A79E8B; }
.cv2-history-dauer { font-size: 13px; font-variant-numeric: tabular-nums; color: #4A453B; }

/* ── Aktivität (echte Segmente aus dem Verlauf, keine Beispieldaten) ── */
.cv2-activity-wide .cv2-activity-inner { background: var(--cv2-bg); border-top: 1px solid var(--cv2-border-2); padding: 18px 20px 20px; max-width: 820px; display: flex; flex-direction: column; gap: 12px; }
.cv2-activity-narrow .cv2-activity-inner { background: var(--cv2-bg); border-top: 1px solid var(--cv2-border-2); padding: 16px; display: flex; flex-direction: column; gap: 10px; }

.cv2-activity-label { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: #B08A3A; font-weight: 700; }
.cv2-activity-summary { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.cv2-activity-duration { font-size: 15px; color: var(--cv2-text); }
.cv2-activity-duration strong { font-variant-numeric: tabular-nums; }
.cv2-activity-verdict { font-size: 13px; font-weight: 700; }
.cv2-activity-verdict.is-bad { color: #D02D22; }
.cv2-activity-verdict.is-ok { color: #2E8B57; }

/* Segmentbreiten proportional zur tatsächlichen Statusdauer. */
.cv2-activity-bar { display: flex; gap: 2px; height: 72px; }
.cv2-activity-seg { position: relative; flex: 0 1 0%; min-width: 0; height: 100%; border-radius: 4px; cursor: pointer; transition: filter .12s ease, transform .12s ease; }
.cv2-activity-seg:hover { filter: brightness(0.93); transform: scaleY(1.04); }

/* Tooltip: eigenes fixed-positioniertes Element (siehe verlauf.js), nicht
   CSS-::after – jeder Scroll-/Overflow-Ahnenknoten (z. B. .cv2-scroll)
   hätte einen darüber ausbrechenden Tooltip sonst abgeschnitten. */
.cv2-tooltip {
  position: fixed;
  background: #3B3226;
  color: #FFF8E9;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(40,30,5,.25);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity .1s ease;
}
.cv2-tooltip.is-visible { opacity: 1; visibility: visible; }
.cv2-tooltip-violation { font-weight: 700; color: #FFC9C0; margin-top: 2px; }

.cv2-activity-range { display: flex; justify-content: space-between; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--cv2-sub); }

.cv2-activity-legend { display: flex; gap: 20px; flex-wrap: wrap; }
.cv2-activity-legend-item { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #4A453B; }
.cv2-activity-swatch { width: 13px; height: 13px; border-radius: 4px; flex: none; }

/* ── Footer ── */
.cv2-footer { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; font-size: 13px; color: var(--cv2-sub); }
.cv2-pagination { display: flex; gap: 8px; }
.cv2-page-btn { padding: 6px 12px; border: 1px solid var(--cv2-border); border-radius: 8px; color: #C2BAA6; }

/* ── Filtering ── */
.cv2-group.is-hidden,
.cv2-card.is-hidden { display: none; }

/* ── Mobile card layout ── */
@media (max-width: 900px) {
  .cv2-wide { display: none; }
  .cv2-narrow { display: block; }

  .cv2-card-row { border-bottom: 1px solid var(--cv2-row-border); }
  .cv2-narrow .cv2-card { border-bottom: 1px solid var(--cv2-row-border); display: flex; flex-direction: column; gap: 12px; padding: 16px; }

  .cv2-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .cv2-card-top.is-toggle { cursor: pointer; }
  .cv2-card-status { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .cv2-card-status-text { font-size: 16px; font-weight: 700; color: var(--cv2-text); }
  .cv2-card-time { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; flex: none; }

  .cv2-card-mid { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
  .cv2-card-sep { width: 3px; height: 3px; border-radius: 50%; background: #CFC6B2; flex: none; }

  .cv2-card-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .cv2-card-stat { display: flex; flex-direction: column; gap: 3px; }
  .cv2-label { font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--cv2-sub-2); font-weight: 700; }
  .cv2-value { font-size: 15px; font-variant-numeric: tabular-nums; color: var(--cv2-text); }
  .cv2-card-stat .cv2-bar { max-width: none; margin-top: 3px; }

  .cv2-card-toggle-link { font-size: 13px; font-weight: 700; color: var(--cv2-link); cursor: pointer; }
  .cv2-history-narrow-body { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
  .cv2-history-narrow-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .cv2-history-narrow-row .cv2-history-status span:last-child { font-size: 14px; }
  .cv2-history-narrow-row .cv2-history-time { display: flex; align-items: baseline; gap: 10px; flex: none; }

  .cv2-toolbar { flex-direction: column; align-items: stretch; }
  .cv2-counts { margin-left: 0; justify-content: space-between; }
  .cv2-title { font-size: 22px; }
}

/* Zeitpunkt-Meldungen: unabhängig von der Dauer immer gleich schmal. */
.cv2-activity-seg.cv2-activity-marker { flex: 0 0 3px !important; width: 3px; min-width: 3px; }

/* Verstoss-Phasen auch im Zeitbalken klar rot anzeigen. */
.cv2-activity-bar .cv2-activity-seg.cv2-activity-violation { background-color: #E0362C !important; }

/* Verstoß-Balken auch über das Tooltip-Attribut sicher erkennen. */
.cv2-activity-bar .cv2-activity-seg[data-violation],
.cv2-activity-bar .cv2-activity-seg.cv2-activity-violation { background: #E0362C !important; background-color: #E0362C !important; }

/* Ereignisse sind Zeitpunkte: Symbol statt Dauerbalken. */
.cv2-activity-bar .cv2-activity-seg.cv2-activity-marker.cv2-marker-online,
.cv2-activity-bar .cv2-activity-seg.cv2-activity-marker.cv2-marker-offline,
.cv2-activity-bar .cv2-activity-seg.cv2-activity-marker.cv2-marker-ended {
    flex: 0 0 24px !important;
    width: 24px !important;
    min-width: 24px !important;
    position: relative;
    background: transparent !important;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
/* CD-Player-Symbole: ohne Hintergrund, beide gleich gross und gruen. */
.cv2-activity-bar .cv2-activity-marker.cv2-marker-online::after,
.cv2-activity-bar .cv2-activity-marker.cv2-marker-offline::after,
.cv2-activity-bar .cv2-activity-marker.cv2-marker-ended::after {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none;
    color: #2E7D57;
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: normal;
    line-height: 1;
}
.cv2-activity-bar .cv2-activity-marker.cv2-marker-online::after,
.cv2-activity-bar .cv2-activity-marker.cv2-marker-offline::after {
    content: "\25B6"; /* Play */
}
.cv2-activity-bar .cv2-activity-marker.cv2-marker-ended::after {
    content: ""; /* Stop: geometrisch zentriertes Quadrat */
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 15px;
    height: 15px;
    background: #2E7D57 !important;
}
