/* shotlist.css — TillyGen App-Shell + Shotlist-Tabelle als eigenständiges CSS.
 * Nachbau der echten App-Komponenten (app-shell, sidebar-nav, project-header,
 * creatives-page, shotlist-table) mit den Original-Tokens aus tokens.css.
 * Alle Maße/Borders/Typo entsprechen den Tailwind-Klassen der App. */

/* ========================================================================
 * Base
 * ===================================================================== */
* {
  box-sizing: border-box;
  border-color: var(--border);
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-weight: var(--fw-regular);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01", "ss03";
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
::selection {
  background: var(--primary-soft-strong);
  color: var(--foreground);
}

.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.icon-sm {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.icon-xs {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* Typografie-Klassen (.t-*) — CD-Source-of-Truth */
.t-page-title {
  font: var(--fw-medium) var(--text-2xl) / 32px var(--font-page-title);
  letter-spacing: var(--tracking-tight);
}
.t-body-sm {
  font: var(--fw-regular) var(--text-sm) / var(--leading-normal) var(--font-sans);
}
.t-label {
  font: var(--fw-medium) var(--text-xs) / var(--leading-snug) var(--font-sans);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.t-meta {
  font: var(--fw-regular) var(--text-xs) / var(--leading-snug) var(--font-sans);
  color: var(--muted-foreground);
}
.t-mono-xs {
  font: var(--fw-regular) var(--text-xs) / var(--leading-snug) var(--font-mono);
  letter-spacing: var(--tracking-mono);
  font-variant-numeric: tabular-nums;
}

.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}
.scrollbar-thin::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}

/* ========================================================================
 * Buttons (components/ui/button.tsx)
 * ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px; /* size=sm → h-7 */
  padding: 0 10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}
.btn:active {
  transform: translateY(1px);
}
.btn--primary {
  background: var(--primary);
  color: var(--primary-foreground);
}
.btn--primary:hover {
  background: var(--primary-hover);
}
.btn--outline {
  border-color: var(--input);
  background: transparent;
  color: var(--foreground);
}
.btn--outline:hover {
  background: var(--accent);
}
.btn--ghost {
  background: transparent;
  color: var(--muted-foreground);
}
.btn--ghost:hover {
  background: var(--muted);
  color: var(--foreground);
}
.btn--icon {
  width: 28px;
  padding: 0;
}

/* ========================================================================
 * App-Shell: Grid Sidebar | Main (components/app/app-shell.tsx)
 * ===================================================================== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  background: var(--background);
}

/* ========================================================================
 * Sidebar (components/app/sidebar-nav.tsx)
 * ===================================================================== */
.sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  height: var(--topbar-h);
  padding: 0 8px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand__logo {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 8px;
  border-radius: var(--radius-md);
  color: var(--foreground);
}
.sidebar-brand__logo:hover {
  background: var(--muted);
}
.sidebar-brand__logo svg {
  height: 20px;
  width: auto;
  display: block;
}
.sidebar-brand__toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--muted-foreground);
}
.sidebar-brand__toggle:hover {
  background: var(--muted);
  color: var(--foreground);
}
.sidebar-brand__toggle svg {
  width: 20px;
  height: 20px;
}

.sidebar-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  padding: 12px 12px;
}

.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 36px;
  padding: 0 8px;
  border-radius: var(--radius-md);
  color: var(--muted-foreground);
  text-decoration: none;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
  text-align: left;
  width: 100%;
}
.quick-action:hover {
  background: var(--muted);
  color: var(--foreground);
}
.quick-action.is-active {
  background: var(--accent);
  color: var(--foreground);
}
.quick-action span {
  font-size: var(--text-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-tree {
  flex: 1;
  overflow-y: auto;
  margin-top: 16px;
  padding: 0 4px;
}
.tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 8px 0;
}
.tree-header__toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted-foreground);
}
.tree-header__toggle:hover {
  color: var(--foreground);
}
.tree-header__plus {
  display: grid;
  place-items: center;
  padding: 4px;
  border-radius: var(--radius-md);
  color: var(--muted-foreground);
}
.tree-header__plus:hover {
  background: var(--muted);
  color: var(--foreground);
}
.tree-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tree-item {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-md);
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  text-decoration: none;
  cursor: pointer;
}
.tree-item:hover {
  background: var(--muted);
  color: var(--foreground);
}
.tree-item.is-active {
  background: var(--accent);
  color: var(--foreground);
}
.tree-item svg {
  color: var(--icon-subtle);
}
.tree-item span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  text-align: left;
}
.user-card:hover {
  background: var(--muted);
}
.user-card__avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-pressed) 100%);
  color: var(--primary-foreground);
  font-size: var(--text-2xs);
  font-weight: var(--fw-semibold);
}
.user-card__meta {
  min-width: 0;
  flex: 1;
}
.user-card__name {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-card__sub {
  font-size: var(--text-2xs);
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========================================================================
 * Main + Projekt-Header (components/app/project-header.tsx)
 * ===================================================================== */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.project-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  height: var(--topbar-h);
  flex-shrink: 0;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}
.project-header__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--foreground);
}
.project-header__tabs {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
}
.project-header__tab {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--radius-md);
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}
.project-header__tab:hover {
  color: var(--foreground);
}
.project-header__tab.is-active {
  background: var(--accent);
  color: var(--foreground);
  font-weight: var(--fw-medium);
  box-shadow: var(--shadow-sm);
}
.project-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* ========================================================================
 * Creatives-Kopfzeile: Segmented View-Switcher (components/ui/tabs.tsx)
 * ===================================================================== */
.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.seg {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 3px;
  border-radius: var(--radius-lg);
  background: var(--muted);
  color: var(--muted-foreground);
}
.seg__tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: calc(100% - 1px);
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--muted-foreground);
  white-space: nowrap;
  transition: color var(--duration-fast) var(--ease-out);
}
.seg__tab:hover {
  color: var(--foreground);
}
.seg__tab.is-active {
  border-color: var(--input);
  background: rgba(51, 51, 51, 0.3);
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
}
.light .seg__tab.is-active {
  background: var(--background);
  border-color: transparent;
}

/* ========================================================================
 * Shotlist-Toolbar (Zähler links, Einstellungen rechts)
 * ===================================================================== */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.table-toolbar__count {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
.table-toolbar__spacer {
  flex: 1;
}

/* ========================================================================
 * Shotlist-Tabelle (components/creatives/shotlist-table.tsx)
 * Spalten: Nr 104 | Bild 76 | Action 260 | On Screen 200 | Audio 220 |
 *          Talents 200 | Locations 200 | Dauer 128 | Aktionen 44  (= 1432px)
 * Nr+Bild+Action links gepinnt, Dauer+Aktionen rechts gepinnt.
 * ===================================================================== */
.table-scroll {
  flex: 1;
  overflow: auto;
  position: relative;
}
.shotlist {
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  width: 1432px;
  --l-image: 104px;
  --l-action: 180px;
  --r-duration: 44px;
}

/* Sticky-Zellen: opaker Grund + Row-Tint als background-image-Layer
 * (Muster aus app/globals.css: cell-sticky + row-tint-*). */
.shotlist td {
  background-color: var(--background);
  background-image: var(--row-tint, none);
}
.row-tint-20 {
  --row-tint: linear-gradient(rgba(255, 255, 255, 0.008), rgba(255, 255, 255, 0.008));
}
.row-tint-40 {
  --row-tint: linear-gradient(rgba(255, 255, 255, 0.016), rgba(255, 255, 255, 0.016));
}
.light .row-tint-20 {
  --row-tint: linear-gradient(rgba(0, 0, 0, 0.008), rgba(0, 0, 0, 0.008));
}
.light .row-tint-40 {
  --row-tint: linear-gradient(rgba(0, 0, 0, 0.016), rgba(0, 0, 0, 0.016));
}

.shotlist thead {
  position: sticky;
  top: 0;
  z-index: 30;
}
.shotlist th {
  position: sticky;
  background: var(--card);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px;
  text-align: left;
  font: var(--fw-medium) var(--text-xs) / var(--leading-snug) var(--font-sans);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shotlist th.col-dur,
.shotlist td.col-dur {
  text-align: right;
}

/* Pinning */
.pin-l0 {
  position: sticky;
  left: 0;
  z-index: 10;
}
.pin-l1 {
  position: sticky;
  left: var(--l-image);
  z-index: 10;
}
.pin-l2 {
  position: sticky;
  left: var(--l-action);
  z-index: 10;
}
.pin-r1 {
  position: sticky;
  right: var(--r-duration);
  z-index: 10;
}
.pin-r0 {
  position: sticky;
  right: 0;
  z-index: 10;
}
/* Frozen-Kanten: weicher Schatten nach außen (pin-shadow aus globals.css) */
.pin-shadow-r {
  box-shadow: 8px 0 10px -10px rgba(250, 250, 250, 0.16);
}
.pin-shadow-l {
  box-shadow: -8px 0 10px -10px rgba(250, 250, 250, 0.16);
}
.light .pin-shadow-r {
  box-shadow: 8px 0 10px -10px rgba(10, 10, 11, 0.16);
}
.light .pin-shadow-l {
  box-shadow: -8px 0 10px -10px rgba(10, 10, 11, 0.16);
}

.shotlist td {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 4px 8px;
  vertical-align: top;
  font-size: var(--text-sm);
}
.shotlist td.col-dur {
  border-left: 1px solid var(--border);
}

/* Zeilen-Typen */
.row--creative td {
  padding-top: 6px;
  padding-bottom: 6px;
}
.row--segment {
  position: relative;
}

.cellwrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.cellwrap--segment {
  padding-left: 16px;
}
.cellwrap--angle {
  padding-left: 20px;
  gap: 6px;
}

.chev {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--muted-foreground);
}
.chev:hover {
  color: var(--foreground);
}
.grip {
  color: var(--subtle-foreground);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
  cursor: grab;
  display: flex;
  align-items: center;
}
tr:hover .grip {
  opacity: 1;
}

.creative-cover {
  position: relative;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--muted);
  display: grid;
  place-items: center;
  color: var(--icon-subtle);
}
.creative-title {
  font-weight: var(--fw-medium);
  min-width: 128px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.count-badge {
  color: var(--muted-foreground);
  font: var(--fw-regular) var(--text-xs) / var(--leading-snug) var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.segment-title {
  min-width: 112px;
  font-size: var(--text-sm);
  font-weight: var(--fw-regular);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Segment-Zeit-Pill (Ist/Soll, farbcodiert) */
.seg-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--radius-md);
  padding: 4px 8px;
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
  transition:
    background-color var(--duration-slow) var(--ease-out),
    color var(--duration-slow) var(--ease-out);
}
.seg-pill.is-ok {
  background: var(--success-soft);
  color: var(--success-foreground);
}
.seg-pill.is-over {
  background: var(--destructive-soft);
  color: var(--destructive);
}
.seg-pill .sep {
  opacity: 0.4;
}

/* Kapazitätsbalken am Zeilenboden des Segment-Headers. Wie in der App liegt
 * er in der rechten Sticky-Zelle und läuft von dort über die volle sichtbare
 * Breite nach links (width = Tabellenbreite, der Scroll-Container clippt). */
.capacity {
  position: absolute;
  right: 0;
  bottom: 0;
  height: 2px;
  width: 1432px;
  background: rgba(42, 42, 42, 0.4);
  pointer-events: none;
  z-index: 11;
}
.capacity__fill {
  height: 100%;
  width: 0%;
  background: var(--success);
  transition: width 300ms var(--ease-out);
}
.capacity__fill.is-over {
  background: var(--destructive);
}

/* Shot-Nummer */
.shot-nr {
  font: var(--fw-regular) var(--text-xs) / var(--leading-snug) var(--font-mono);
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
.angle-badge {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 4px;
  font: var(--fw-regular) var(--text-xs) / 16px var(--font-mono);
  color: var(--muted-foreground);
}
.angle-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--primary);
}

/* Bild-Slot: Höhe fix 96px, Breite folgt dem Format (9:16 → 54px) */
.thumb {
  position: relative;
  height: 96px;
  width: 54px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--muted);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--icon-subtle);
}
.thumb--wide {
  width: 171px; /* 16:9 */
}
.thumb__img {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-out);
}
.thumb__img::after {
  /* leichter Foto-Glanz, damit die Gradient-Platzhalter nach Bild aussehen */
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 60% at 20% 0%, rgba(255, 255, 255, 0.22), transparent 55%),
    linear-gradient(200deg, transparent 55%, rgba(0, 0, 0, 0.35));
}
.thumb.is-done .thumb__img {
  opacity: 1;
}

/* ImageGen-Loader: Punktraster mit Drift (imagegen-grid aus globals.css) */
@keyframes imagegen-drift {
  to {
    background-position: 16px 16px;
  }
}
.thumb__loader {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-out);
  background-image: radial-gradient(rgba(250, 250, 250, 0.12) 1px, transparent 1.5px);
  background-size: 16px 16px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 35%, transparent 72%);
  mask-image: radial-gradient(ellipse at center, black 35%, transparent 72%);
  animation: imagegen-drift 5s linear infinite;
}
.thumb.is-loading .thumb__loader {
  opacity: 1;
}
.thumb.is-loading .thumb__placeholder,
.thumb.is-done .thumb__placeholder {
  opacity: 0;
}
.thumb__placeholder {
  transition: opacity var(--duration-base) var(--ease-out);
}

/* Text-Zellen */
.cell-text {
  white-space: pre-wrap;
  word-break: break-word;
}
.cell-text:empty::before {
  content: "";
}
.cell-placeholder {
  color: var(--subtle-foreground);
}

/* Chips (MultiRefPicker) */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 22px;
  align-items: center;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--muted);
  padding: 2px 8px 2px 4px;
  font-size: var(--text-xs);
  color: var(--foreground);
  white-space: nowrap;
}
.chip__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: rgba(191, 191, 191, 0.15);
  color: var(--muted-foreground);
  font-size: var(--text-3xs);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
}
.chip__avatar--rounded {
  border-radius: 3px;
}
.chips .hint {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

/* Dauer-Feld (ruhiges graues Feld) */
.dur-field {
  display: inline-flex;
  justify-content: flex-end;
  border-radius: var(--radius-md);
  background: var(--muted);
  padding: 4px 8px;
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
  min-width: 48px;
}
.dur-field:empty {
  visibility: hidden;
}

/* Aktionen-Spalte (⋯ nur bei Hover) */
.row-actions {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  color: var(--muted-foreground);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}
tr:hover .row-actions {
  opacity: 1;
}
.row-actions:hover {
  background: var(--muted);
  color: var(--foreground);
}

/* Footer (Σ) */
.shotlist tfoot {
  position: sticky;
  bottom: 0;
  z-index: 30;
}
.shotlist tfoot td {
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: none;
  padding: 8px;
  font: var(--fw-regular) var(--text-xs) / var(--leading-snug) var(--font-mono);
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.shotlist tfoot td .sum {
  color: var(--foreground);
}

/* Empty-State */
.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 48px;
  color: var(--muted-foreground);
}
.empty-state__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: var(--muted);
  color: var(--icon-subtle);
  margin-bottom: 4px;
}
.empty-state__title {
  font-size: var(--text-base);
  font-weight: var(--fw-medium);
  color: var(--foreground);
}
.empty-state__desc {
  font-size: var(--text-sm);
}
.empty-state.is-hidden {
  display: none;
}

/* ========================================================================
 * Animation: Zeilen-Eintritt, Typewriter-Caret, Tilly-Status
 * ===================================================================== */
.row-enter {
  animation: row-enter var(--duration-slow) var(--ease-out) both;
}
@keyframes row-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chip-enter {
  animation: chip-enter 240ms var(--ease-out) both;
}
@keyframes chip-enter {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.caret {
  display: inline-block;
  width: 1px;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: var(--primary);
  animation: caret-blink 0.9s step-end infinite;
}
@keyframes caret-blink {
  50% {
    opacity: 0;
  }
}

/* Tilly-Statuspill (Position/Look des Tilly-Widgets: bottom-right, popover) */
.tilly-status {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  border-radius: var(--radius-full);
  background: var(--popover);
  box-shadow: var(--shadow-popover);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}
.tilly-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.tilly-status__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--foreground);
}
.tilly-status__icon svg {
  height: 22px;
  width: auto;
}
.tilly-status__text {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}

/* Tilly-Hop (Denk-Indikator, 1:1 aus globals.css) */
@keyframes tilly-hop {
  0% {
    transform: translateY(0) rotate(0deg) scaleY(1);
    animation-timing-function: ease-in;
  }
  12% {
    transform: translateY(8%) rotate(0deg) scaleY(0.9);
    animation-timing-function: cubic-bezier(0.25, 0.7, 0.3, 1);
  }
  36% {
    transform: translateY(-34%) rotate(-8deg) scaleY(1.05);
    animation-timing-function: ease-in-out;
  }
  50% {
    transform: translateY(-31%) rotate(6deg) scaleY(1);
    animation-timing-function: cubic-bezier(0.6, 0, 0.9, 0.5);
  }
  64% {
    transform: translateY(0) rotate(0deg) scaleY(0.9);
    animation-timing-function: ease-out;
  }
  76% {
    transform: translateY(-9%) rotate(0deg) scaleY(1.03);
    animation-timing-function: ease-in;
  }
  86%,
  100% {
    transform: translateY(0) rotate(0deg) scaleY(1);
  }
}
.tilly-hop {
  animation: tilly-hop 1.45s infinite;
  transform-origin: center bottom;
}

/* Text-Shimmer („arbeitet gerade", 1:1 aus globals.css) */
@keyframes text-shimmer {
  0% {
    background-position: 200% center;
  }
  100% {
    background-position: -200% center;
  }
}
.text-shimmer {
  background: linear-gradient(
    100deg,
    var(--muted-foreground) 35%,
    var(--foreground) 50%,
    var(--muted-foreground) 65%
  );
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: text-shimmer 1.8s linear infinite;
}
.tilly-status.is-done .text-shimmer {
  animation: none;
  -webkit-text-fill-color: var(--foreground);
}
.tilly-status.is-done .tilly-hop {
  animation: none;
}
.tilly-status__check {
  display: none;
  color: var(--primary);
}
.tilly-status.is-done .tilly-status__check {
  display: inline-flex;
}

/* Demo-Steuerung (nicht Teil des App-Designs — per ?controls=0 ausblendbar) */
.demo-controls {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: var(--radius-lg);
  background: var(--popover);
  box-shadow: var(--shadow-popover);
}
.demo-controls.is-hidden {
  display: none;
}
.demo-controls select {
  height: 28px;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--foreground);
  font-size: var(--text-xs);
  padding: 0 6px;
}

@media (prefers-reduced-motion: reduce) {
  .tilly-hop,
  .text-shimmer,
  .thumb__loader,
  .caret {
    animation: none;
  }
  .text-shimmer {
    -webkit-text-fill-color: var(--muted-foreground);
  }
}
