:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --bg-subtle: #f0f0ec;
  --panel: #ffffff;
  --panel-warm: #ecece7;
  --border: #e2e2dc;
  --border-strong: #111111;
  --text: #111111;
  --muted: #6b6b66;
  --hint: #8c8c85;
  --accent: #d8ff06;
  --accent-hover: #c7eb00;
  --dark: #141416;
  --dark-hover: #222226;
  --dark-border: rgba(255, 255, 255, 0.16);
  --green: #15803d;
  --green-bg: #dcfce7;
  --red: #b91c1c;
  --red-bg: #fee2e2;
  --yellow: #b45309;
  --yellow-bg: #fef3c7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p {
  margin: 0;
}

h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 15px;
  font-weight: 700;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.hint {
  font-size: 12px;
  color: var(--hint);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-all;
}

/* Controls */
button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  padding: 8px 18px;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

button:hover:not(:disabled) {
  border-color: #111111;
  background: #fdfdfd;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.primary {
  background: var(--dark);
  color: #ffffff;
  border-color: var(--dark);
  font-weight: 700;
  padding: 10px 22px;
}

button.primary:hover:not(:disabled) {
  background: var(--dark-hover);
  border-color: var(--dark-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button.accent {
  background: var(--accent);
  color: #111111;
  border-color: var(--accent);
  font-weight: 700;
  padding: 10px 22px;
}

button.accent:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
}

button.outline {
  background: transparent;
  border: 1.5px solid var(--dark);
  color: var(--dark);
}

button.outline:hover:not(:disabled) {
  background: var(--dark);
  color: #ffffff;
}

button.danger {
  border-color: var(--red);
  background: #ffffff;
  color: var(--red);
}

button.danger:hover:not(:disabled) {
  background: var(--red-bg);
}

button.text-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  text-decoration: underline;
  border-radius: 0;
}

input, select, textarea {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #111111;
  box-shadow: 0 0 0 3px rgba(216, 255, 6, 0.4);
}

input[type="search"] {
  border-radius: 999px;
  padding-left: 18px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

textarea {
  resize: vertical;
  min-height: 90px;
}

.check {
  width: 17px;
  height: 17px;
  accent-color: #111111;
  cursor: pointer;
}

/* Header */
.header {
  height: 72px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.brand-icon {
  width: 30px;
  height: 30px;
  background: #111111;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 16px;
  font-weight: 900;
}

.brand span {
  color: var(--muted);
  font-weight: 500;
}

.header .spacer {
  flex: 1;
}

.header select {
  border-radius: 999px;
  padding: 7px 16px;
  font-weight: 600;
  font-size: 13px;
  max-width: 220px;
}

.nav {
  display: flex;
  gap: 8px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 6px 32px;
}

.nav button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  transition: all 0.15s ease;
}

.nav button:hover {
  background: var(--bg-subtle);
  color: #111111;
}

.nav button.active {
  background: #111111;
  color: #ffffff;
}

.avatar {
  width: 34px;
  height: 34px;
  background: var(--accent);
  color: #111111;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  border: 1.5px solid #111111;
}

/* Layout */
main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 32px 80px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.between {
  justify-content: space-between;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* MediaSkill Hero Section */
.hero-section {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 40px;
  align-items: center;
  padding: 24px 0 36px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero-overline {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #111111;
}

.hero-title {
  font-size: 52px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: #111111;
}

.hero-highlight {
  background: var(--accent);
  color: #111111;
  display: inline-block;
  padding: 2px 16px;
  border-radius: 6px;
  transform: rotate(-0.5deg);
}

.hero-desc {
  font-size: 16px;
  line-height: 1.55;
  color: #333330;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.hero-link {
  font-weight: 700;
  font-size: 14px;
  color: #111111;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.hero-footnote {
  font-size: 12px;
  color: var(--hint);
  margin-top: 4px;
}

/* Right Showcase in Hero */
.hero-showcase {
  background: var(--panel-warm);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.showcase-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #111111;
}

.showcase-cards {
  position: relative;
  padding: 10px 0;
}

.card-dark {
  background: var(--dark);
  color: #ffffff;
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 86%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.card-dark .card-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a0a0a5;
}

.card-dark .card-title {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.card-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.card-pills span {
  border: 1px solid var(--dark-border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #e5e5eb;
}

.card-lime {
  background: var(--accent);
  color: #111111;
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  margin-top: -36px;
  margin-left: 14%;
  width: 86%;
  transform: rotate(-1.5deg);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.14);
}

.card-lime .card-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #333330;
}

.card-lime .card-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.card-lime .card-meta {
  font-size: 12px;
  font-weight: 600;
  color: #222220;
}

.card-lime .card-btn {
  align-self: flex-end;
  background: #111111;
  color: #ffffff;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 700;
  border: none;
}

.showcase-caption {
  font-size: 12px;
  color: #555550;
  text-align: left;
}

/* Feature Strip Bar */
.feature-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  margin: 18px 0 28px;
  font-size: 12px;
  font-weight: 700;
  color: #111111;
  text-align: center;
  background: #ffffff;
  border-radius: 12px;
}

.feature-strip div:not(:last-child) {
  border-right: 1px solid var(--border);
}

/* Bottom Marquee Ribbon (MediaSkill style) */
.marquee-ribbon {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0d0d0f;
  color: var(--accent);
  padding: 12px 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 15;
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid #222226;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
}

.marquee-content {
  display: inline-block;
  animation: marquee 28s linear infinite;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee-plus {
  color: #ffffff;
  margin: 0 18px;
  font-weight: 900;
}

/* Status Pills */
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--bg-subtle);
  color: var(--text);
  white-space: nowrap;
}

.pill.active {
  background: var(--accent);
  color: #111111;
}

.pill.stopped, .pill.paused {
  background: #ebebe6;
  color: #555550;
}

.pill.in_review, .pill.pending, .pill.running {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.pill.declined, .pill.failed, .pill.error, .pill.unknown {
  background: var(--red-bg);
  color: var(--red);
}

.pill.completed, .pill.succeeded {
  background: var(--green-bg);
  color: var(--green);
}

/* Metrics */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 20px 0;
}

.metric, .card {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.metric:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.metric .label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric .value {
  font-size: 28px;
  font-weight: 800;
  color: #111111;
  letter-spacing: -0.03em;
  margin: 6px 0;
}

/* Toolbar & Table */
.toolbar {
  padding: 14px 20px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar input[type="search"] {
  min-width: 260px;
}

.toolbar select {
  border-radius: 999px;
  padding: 7px 14px;
}

.toolbar .spacer {
  flex: 1;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  max-height: 60vh;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  text-align: left;
  font-size: 13px;
}

th {
  color: #555550;
  background: #fafaf8;
  position: sticky;
  top: 0;
  z-index: 2;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1.5px solid var(--border);
}

td, th {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0eb;
  white-space: nowrap;
}

td {
  background: #ffffff;
}

tr:hover td {
  background: #fbfbf9;
}

td.text-cell {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pin {
  position: sticky;
  left: 0;
  z-index: 1;
  box-shadow: 2px 0 0 var(--border);
}

th.pin {
  z-index: 3;
}

.sort {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.btn-edit-row {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.btn-edit-row:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #111111;
}

/* Page footer */
.page-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

/* Drawer / Modals */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.45);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  justify-content: flex-end;
}

.drawer {
  width: min(600px, 100%);
  background: #ffffff;
  border-left: 1px solid var(--border);
  height: 100%;
  overflow-y: auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
}

.drawer h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #ffffff;
  font-size: 16px;
  display: grid;
  place-items: center;
}

.drawer-close:hover {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}

.drawer form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.drawer-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}

.quick-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.quick-pill {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--border);
  cursor: pointer;
}

.quick-pill:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #111111;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.preview {
  background: var(--bg-subtle);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

/* Empty states & Errors */
.empty {
  text-align: center;
  padding: 56px 24px;
  border: 2px dashed var(--border);
  border-radius: 16px;
  background: #ffffff;
}

.empty h2, .empty h3 {
  font-weight: 800;
  margin-bottom: 8px;
}

.empty p {
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 20px;
}

.error-box {
  padding: 14px 18px;
  border: 1px solid #fecaca;
  background: #fff5f5;
  border-radius: 10px;
  color: var(--red);
  font-weight: 600;
}

/* Jobs card */
.job {
  margin-top: 16px;
}

.job progress {
  width: 100%;
  accent-color: #111111;
  height: 6px;
  border-radius: 999px;
  margin: 8px 0;
}

.job ol {
  padding-left: 20px;
  margin: 8px 0;
}

.job li {
  margin: 6px 0;
  font-size: 12px;
  word-break: break-all;
}

/* Settings grid */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.settings-grid .wide {
  grid-column: 1 / -1;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

/* Toast */
#toast {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 110;
  background: #111111;
  color: #ffffff;
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Chart */
.chart {
  height: 220px;
  width: 100%;
  display: block;
  margin: 18px 0;
}

.chart text {
  fill: var(--muted);
  font-size: 11px;
}

.chart line {
  stroke: var(--border);
}

/* Auth View */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: #ffffff;
}

.auth-art {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12%;
  border-right: 1px solid var(--border);
}

.auth-art h1 {
  font-size: 46px;
  line-height: 1.1;
  margin: 24px 0 16px;
}

.auth-art p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
  max-width: 440px;
}

.auth-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.auth-form form {
  width: 380px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.columns-row {
  display: grid;
  grid-template-columns: 24px 1fr 80px 65px 34px 34px;
  gap: 8px;
  align-items: center;
}

.columns-row input[type="number"] {
  width: 80px;
}

/* Responsive */
@media (max-width: 1060px) {
  .hero-section {
    grid-template-columns: 1fr;
  }
  .feature-strip {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .feature-strip div:not(:last-child) {
    border-right: none;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .header {
    padding: 10px 16px;
    height: auto;
    flex-wrap: wrap;
  }
  .nav {
    padding: 4px 16px;
  }
  main {
    padding: 18px 16px 80px;
  }
  .hero-title {
    font-size: 34px;
  }
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-art {
    display: none;
  }
  .metrics {
    grid-template-columns: 1fr;
  }
  .feature-strip {
    grid-template-columns: 1fr;
  }
}
