:root {
  color-scheme: dark;
  --bg: #0a0a0f;
  --bg-2: #0e0e15;
  --surface: #14141c;
  --surface-2: #1a1a24;
  --surface-3: #20202c;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.10);
  --text: #ececf0;
  --text-2: #b8b8c4;
  --muted: #6b6b78;
  --accent: #a78bfa;
  --accent-soft: rgba(167, 139, 250, 0.14);
  --ok: #34d399;
  --err: #f87171;
  --warn: #fbbf24;
  --glow: 1;
  --shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.42);
  font-family: "Geist", "Noto Sans SC", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7f9;
  --bg-2: #f0f0f4;
  --surface: #ffffff;
  --surface-2: #fafafc;
  --surface-3: #f3f3f7;
  --border: rgba(0, 0, 0, 0.07);
  --border-strong: rgba(0, 0, 0, 0.12);
  --text: #1a1a22;
  --text-2: #4a4a55;
  --muted: #8a8a98;
  --accent-soft: rgba(167, 139, 250, 0.16);
  --shadow: 0 26px 58px -24px rgba(20, 20, 30, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-feature-settings: "tnum" 1;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

.bg-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 12% -10%, color-mix(in oklab, var(--accent) 14%, transparent), transparent 60%),
    radial-gradient(800px 500px at 100% 110%, color-mix(in oklab, var(--accent) 8%, transparent), transparent 60%);
  opacity: calc(var(--glow) * 1);
}

:root[data-theme="light"] .bg-fx {
  background:
    radial-gradient(900px 600px at 12% -10%, color-mix(in oklab, var(--accent) 10%, transparent), transparent 65%),
    radial-gradient(800px 500px at 100% 110%, color-mix(in oklab, var(--accent) 6%, transparent), transparent 65%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 70px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}

.brand,
.brand-meta,
.topbar-right,
.field-head,
.tabs,
.card-head,
.actions,
.fileRow,
.detailHeader,
.detailActions {
  display: flex;
  align-items: center;
}

.brand {
  min-width: 0;
  gap: 14px;
}

.logo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 30%, #1a1a24), #1a1a24);
  box-shadow:
    0 0 24px color-mix(in oklab, var(--accent) 30%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
}

.brand-tag {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 500;
}

.brand-meta {
  gap: 8px;
  min-width: 0;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.conn-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}

.email {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text-2);
}

.topbar-right {
  gap: 10px;
}

.icon-btn,
.iconButton {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:hover,
.iconButton:hover {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.icon-btn-lg {
  width: 34px;
  height: 34px;
  border-color: var(--border);
}

.main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 28px;
  height: calc(100vh - 70px);
  min-height: 0;
  max-width: 1640px;
  margin: 0 auto;
  padding: 28px;
  align-items: stretch;
  overflow: hidden;
}

.create {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--surface) 92%, var(--accent) 8%), var(--surface));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, var(--shadow);
}

.create-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.create-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

.create-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field-head {
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.field-label {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.field-hint {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.nativeControl {
  display: none;
}

.numberControl {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
}

.numberControl:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent);
}

.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.seg-btn {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  padding: 8px 10px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.seg-btn:hover {
  color: var(--text);
}

.seg-btn.is-on {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 0 0 1px var(--border-strong);
}

.seg-btn.is-disabled,
.seg-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  color: var(--muted);
}

.seg-btn.is-disabled:hover,
.seg-btn:disabled:hover {
  color: var(--muted);
}

.seg-sm .seg-btn {
  min-height: 32px;
  padding: 7px 8px;
  font-size: 12px;
}

.providerHint {
  margin: 8px 0 0;
  color: var(--warn);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.assetPane {
  display: grid;
  gap: 12px;
}

.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 156px;
  overflow: hidden;
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
  background: repeating-linear-gradient(135deg, transparent 0 12px, color-mix(in oklab, var(--accent) 4%, transparent) 12px 13px);
  color: var(--text-2);
  padding: 28px 16px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.drop:hover {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 5%, var(--surface-2));
}

.drop input {
  position: absolute;
  inset: 0;
  z-index: 4;
  opacity: 0;
  cursor: pointer;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--accent);
}

.drop-title {
  color: var(--text);
  font-size: 13px;
  text-align: center;
}

.drop-sub {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.link {
  color: var(--accent);
  font-weight: 500;
}

#preview,
#lastPreview {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.referenceGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.filePicker {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 86px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 10px;
  cursor: pointer;
}

.filePicker:hover {
  border-color: var(--accent);
}

.filePicker input {
  width: 100%;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.filePicker span {
  font-size: 12px;
}

.filePicker strong {
  color: var(--text);
  font-size: 16px;
}

.referenceMentions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.mentionChip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  padding: 5px 9px;
  cursor: pointer;
}

.mentionChip:hover {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
}

.mentionChip span {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
}

.mentionChip small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.promptField {
  position: relative;
}

.ta {
  width: 100%;
  min-height: 132px;
  max-height: 280px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ta:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.ta::placeholder {
  color: var(--muted);
}

.mentionPopup {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 30;
  display: grid;
  gap: 4px;
  max-height: min(260px, 42vh);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.22);
  padding: 6px;
}

.mentionOption {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 34px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 7px 8px;
  text-align: left;
  cursor: pointer;
}

.mentionOption:hover,
.mentionOption.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.mentionOption span {
  font-size: 13px;
  font-weight: 700;
}

.mentionOption small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.select {
  position: relative;
}

.select select {
  width: 100%;
  min-height: 40px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  padding: 10px 36px 10px 14px;
  font-size: 13px;
  cursor: pointer;
}

.select select:focus {
  border-color: var(--accent);
}

.select option {
  background: var(--surface);
  color: var(--text);
}

.select-chev,
.select-i {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.select-chev {
  right: 12px;
}

.select-i {
  left: 12px;
}

.select-filter select {
  padding-left: 36px;
}

.cost-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 12px 14px;
}

.cost-l {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.cost-v {
  color: var(--accent);
  font-size: 16px;
  font-weight: 600;
}

.cost-r {
  min-width: 0;
  color: var(--text-2);
  font-size: 12px;
  text-align: right;
}

.creditEstimate.unknown .cost-v {
  color: var(--warn);
}

.message {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.message.error,
.error {
  color: var(--err);
}

.generate {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 55%, #60a5fa));
  color: #fff;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow:
    0 8px 24px -8px color-mix(in oklab, var(--accent) 80%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.15s ease;
}

.generate:hover {
  transform: translateY(-1px);
  box-shadow:
    0 14px 36px -10px color-mix(in oklab, var(--accent) 80%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.generate:disabled,
.miniButton:disabled,
.icon-btn:disabled,
.iconButton:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.providerAdmin {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in oklab, var(--surface-2) 86%, var(--accent) 14%);
}

.providerAdminHead,
.providerAdminRow {
  display: flex;
  align-items: center;
}

.providerAdminHead {
  justify-content: space-between;
  gap: 12px;
}

.providerAdminHead h2,
.providerAdminHead p {
  margin: 0;
}

.providerAdminHead h2 {
  font-size: 13px;
  font-weight: 650;
}

.providerAdminHead p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.providerAdminList {
  display: grid;
  gap: 8px;
}

.providerAdminRow {
  gap: 10px;
}

.providerSwitch {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 128px;
  flex: 0 0 auto;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.providerSwitch input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.providerReason {
  min-width: 0;
  flex: 1;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
  font-size: 12px;
  outline: none;
}

.providerReason:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 16%, transparent);
}

.gen-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(120px 60px at 20% 50%, rgba(255, 255, 255, 0.25), transparent 70%);
  pointer-events: none;
}

.gen-icon,
.gen-kbd {
  position: relative;
}

.gen-kbd {
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
  padding: 1px 6px;
  font-size: 11px;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.feed-toolbar {
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) 200px auto;
  gap: 14px;
  align-items: center;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 4px;
}

.tab {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
}

.tab.is-on,
.tab.active {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.tab-count {
  margin-left: 6px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

.dateTabs {
  display: inline-flex;
  gap: 4px;
  justify-self: end;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 4px;
}

.dateTab {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.dateTab:hover {
  color: var(--text);
}

.dateTab.is-on {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  padding: 10px 60px 10px 38px;
  font-size: 13px;
  transition: border-color 0.15s ease;
}

.search input::placeholder {
  color: var(--muted);
}

.search input:focus {
  border-color: var(--accent);
}

.search-i {
  position: absolute;
  left: 12px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.search-kbd {
  position: absolute;
  right: 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--muted);
  padding: 2px 6px;
  font-size: 10.5px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 16px 18px;
  transition: border-color 0.2s ease;
}

.stat:hover {
  border-color: var(--border-strong);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-label {
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

.stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}

.stat-ok .stat-dot {
  background: var(--ok);
}

.stat-err .stat-dot {
  background: var(--err);
}

.stat-value {
  color: var(--text);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
}

.stat-accent {
  color: var(--accent);
}

.stat-hint {
  color: var(--muted);
  font-size: 11px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.taskGrid {
  display: grid;
  gap: 24px;
}

.taskDateGroup {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.taskDateHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.taskDateHead h2 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
}

.taskDateHead span {
  color: var(--muted);
  font-size: 11px;
}

@media (min-width: 1500px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5);
  transform: translateY(-2px);
}

.card-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--surface-3);
}

.thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 78% 26%, color-mix(in oklab, var(--accent) 36%, transparent), transparent 18%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 14px),
    linear-gradient(135deg, #1b1340, #20202c 48%, #0e2236);
}

:root[data-theme="light"] .thumb {
  background:
    radial-gradient(circle at 78% 26%, color-mix(in oklab, var(--accent) 30%, transparent), transparent 18%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 14px),
    linear-gradient(135deg, #25213c, #3b2d68 48%, #17344f);
}

.card-media.has-image .thumb {
  display: none;
}

.thumb-mono {
  position: absolute;
  left: 14px;
  bottom: 12px;
  color: rgba(255, 255, 255, 0.55);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.thumb-play {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
  backdrop-filter: blur(6px);
}

.card:hover .thumb-play {
  opacity: 1;
}

.previewImage,
.detailMedia video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.previewImage {
  position: absolute;
  inset: 0;
}

.meta-overlay {
  position: absolute;
  left: 12px;
  top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ov-chip {
  border-radius: 6px;
  background: rgba(10, 10, 15, 0.65);
  color: #fff;
  padding: 4px 8px;
  font-size: 11px;
  backdrop-filter: blur(8px);
}

.status-overlay {
  position: absolute;
  right: 12px;
  top: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: rgba(10, 10, 15, 0.65);
  color: #fff;
  padding: 4px 10px 4px 8px;
  font-size: 11.5px;
  font-weight: 500;
  backdrop-filter: blur(8px);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}

.badge.success .badge-dot {
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}

.badge.running .badge-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.badge.failed .badge-dot {
  background: var(--err);
  box-shadow: 0 0 8px var(--err);
}

.previewSpinner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 10, 16, 0.28);
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.mediaLoading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.74);
  padding: 24px;
  text-align: center;
}

.statusVisual {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  padding: 8px 12px;
  font-weight: 700;
  transform: translate(-50%, -50%);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px 18px;
}

.card-head {
  justify-content: space-between;
  gap: 12px;
}

.card-date {
  color: var(--muted);
  font-size: 11.5px;
}

.prompt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-2);
  padding: 3px 9px;
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.chip-accent {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

.kv-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: 10px;
  background: var(--surface-2);
  padding: 10px 12px;
}

.kv {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 4px 0;
  font-size: 11.5px;
  text-align: left;
}

.kv-copy {
  width: 100%;
  cursor: pointer;
  transition: color 0.15s ease;
}

.kv-copy:hover {
  color: var(--text);
}

.kv-k {
  min-width: 60px;
  flex: 0 0 auto;
  color: var(--muted);
}

.kv-v {
  min-width: 0;
  color: var(--text-2);
}

.kv-icon {
  margin-left: auto;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.kv-copy:hover .kv-icon {
  opacity: 1;
}

.kv-icon-static {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--muted);
}

.cardError {
  margin: 0;
  color: var(--err);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.actions {
  gap: 6px;
}

.act,
.miniButton {
  flex: 1;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-2);
  padding: 8px 9px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.act:hover,
.miniButton:hover {
  background: var(--surface-3);
  color: var(--text);
}

.act-primary {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
}

.act-primary:hover {
  background: color-mix(in oklab, var(--accent) 22%, transparent);
  color: var(--accent);
}

.dangerButton {
  color: var(--err);
}

.dangerButton:hover {
  border-color: color-mix(in oklab, var(--err) 45%, transparent);
  background: color-mix(in oklab, var(--err) 10%, var(--surface-2));
  color: var(--err);
}

.emptyState {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 300px;
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
}

.emptyState span {
  color: var(--muted);
  font-size: 13px;
}

.detailDialog {
  width: min(1160px, calc(100vw - 32px));
  height: min(780px, calc(100vh - 32px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  padding: 0;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

.detailDialog::backdrop {
  background: rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(8px);
}

.detailShell {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(350px, 0.85fr);
  height: 100%;
  min-height: 0;
}

.detailMedia {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  background: #050507;
  color: #f5f5f7;
}

.posterWrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.detailPoster {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.playButton {
  position: absolute;
  left: 50%;
  top: 50%;
  min-width: 92px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(9, 10, 14, 0.72);
  color: #fff;
  font-weight: 760;
  cursor: pointer;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(12px);
}

.playButton:hover {
  background: rgba(9, 10, 14, 0.9);
}

.detailSide {
  min-height: 0;
  overflow: auto;
  border-left: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 92%, var(--accent) 8%);
  padding: 18px;
}

.detailHeader {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.detailHeader h2 {
  margin: 8px 0 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.detailMeta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0 0 16px;
}

.detailMeta div {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 10px;
}

.detailMeta dt {
  color: var(--muted);
  font-size: 12px;
}

.detailMeta dd {
  margin: 5px 0 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.detailSection {
  margin-top: 16px;
}

.detailSection h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.detailPrompt,
.detailOutput {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.detailOutput {
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 12px;
}

.detailFiles {
  display: grid;
  gap: 8px;
}

.fileRow {
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 9px;
}

.fileRow span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.detailActions {
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.muted {
  color: var(--muted);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1100px) {
  .main {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .create {
    overflow: visible;
  }

  .feed {
    overflow: visible;
    padding-right: 0;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feed-toolbar {
    grid-template-columns: 1fr;
  }

  .dateTabs {
    justify-self: stretch;
    width: 100%;
  }

  .dateTab {
    flex: 1;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    padding: 14px 16px;
  }

  .main {
    padding: 16px;
  }

  .create {
    padding: 18px;
  }

  .providerAdminRow {
    align-items: stretch;
    flex-direction: column;
  }

  .providerSwitch {
    width: auto;
  }

  .row-2,
  .referenceGrid,
  .stats,
  .detailMeta {
    grid-template-columns: 1fr;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
  }

  .actions {
    flex-wrap: wrap;
  }

  .act,
  .miniButton {
    flex: 1 1 calc(50% - 6px);
  }

  .detailDialog {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .detailShell {
    grid-template-columns: 1fr;
  }

  .detailMedia {
    min-height: 44vh;
  }

  .detailSide {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}
