:root {
  --bg: #07111f;
  --panel: #111c30;
  --panel-2: #17243a;
  --text: #f8fafc;
  --muted: #9fb2cb;
  --border: #2b3b56;
  --primary: #4f8cff;
  --primary-hover: #6a9dff;
  --danger: #d9534f;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top right, rgba(79, 140, 255, 0.12), transparent 28%), var(--bg);
  color: var(--text);
}

body.light-theme {
  --bg: #eef3f9;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --text: #111827;
  --muted: #5f6b7a;
  --border: #d7deea;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

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

button {
  border: 0;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:hover { background: var(--primary-hover); }
button:disabled { cursor: not-allowed; opacity: 0.65; }
button.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
button.danger { background: var(--danger); }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0.85rem 0.95rem;
}

textarea { resize: vertical; line-height: 1.5; }

.schedule-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
}
.schedule-label { color: var(--muted); font-weight: 700; white-space: nowrap; }
.schedule-select {
  flex: 1 1 200px;
  width: auto;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.4rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text) 50%),
    linear-gradient(135deg, var(--text) 50%, transparent 50%);
  background-position:
    calc(100% - 1.15rem) 50%,
    calc(100% - 0.75rem) 50%;
  background-size: 0.4rem 0.4rem, 0.4rem 0.4rem;
  background-repeat: no-repeat;
  border: 1px solid var(--primary);
  cursor: pointer;
}
.schedule-group input[type="datetime-local"] { flex: 1 1 200px; width: auto; }
.schedule-group button { white-space: nowrap; }
.schedule-status { flex-basis: 100%; margin: 0; font-weight: 650; color: var(--primary); }
.schedule-status.error { color: var(--danger); }
label { display: grid; gap: 0.45rem; margin-bottom: 1rem; color: var(--muted); font-weight: 650; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0.6rem; font-size: clamp(2rem, 4vw, 3.6rem); }
h2 { margin-bottom: 1rem; }
h3 { margin-top: 1.4rem; margin-bottom: 0.75rem; }

.app-shell { width: min(1440px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 4rem; }
.topbar { display: flex; justify-content: space-between; gap: 2rem; align-items: flex-start; margin-bottom: 1.5rem; }
.topbar p { max-width: 760px; color: var(--muted); line-height: 1.6; }
.eyebrow { display: inline-block; margin-bottom: 0.5rem; color: var(--primary); font-size: 0.8rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.grid { display: grid; gap: 1.25rem; }
.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { margin-bottom: 1.25rem; padding: 1.35rem; border: 1px solid var(--border); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.metric { padding: 1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--panel-2); }
.metric span { display: block; color: var(--muted); margin-bottom: 0.4rem; }
.metric strong { font-size: 1.25rem; overflow-wrap: anywhere; }
.lead { color: var(--muted); line-height: 1.7; font-size: 1.05rem; }
.status { margin: 0.85rem 0 0; color: var(--muted); }
.inline-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.85rem; }
.content-list { margin: 0; padding-left: 1.25rem; }
.content-list li + li { margin-top: 0.45rem; }
.queue-list, .activity-list { list-style: none; margin: 0; padding: 0; }
.queue-item, .activity-item { padding: 0.95rem; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); }
.queue-item + .queue-item, .activity-item + .activity-item { margin-top: 0.75rem; }
.queue-meta, .activity-meta { color: var(--muted); font-size: 0.9rem; margin-top: 0.35rem; }
.queue-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.75rem; }
.tag-block { color: var(--primary); line-height: 1.8; }
.empty { color: var(--muted); font-style: italic; }

@media (max-width: 900px) {
  .two-column, .metrics { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; }
  .topbar button { width: 100%; }
}

.modal-overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8, 12, 24, 0.72); z-index: 50; padding: 1rem; }
.modal-overlay[hidden] { display: none; }
.modal { background: var(--panel, #101728); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 14px; padding: 1.4rem; width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto; display: flex; flex-direction: column; gap: 0.7rem; }
.modal .modal-title { font-weight: 700; margin: 0; }
.light-theme .modal { background: #ffffff; border-color: rgba(0, 0, 0, 0.1); }

.legal-links {
  margin-top: 16px;
  font-size: 0.85rem;
  opacity: 0.8;
}

.legal-links a {
  color: inherit;
}

.app-footer {
  margin: 24px 0 8px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.8;
}

.app-footer a {
  color: inherit;
}

.inline-label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; color: var(--muted, #94a3b8); }
.inline-label select { min-width: 220px; }
