/* ============================================================
   Oś czasu — style wtyczki. Wszystko pod .osc-root, by nie
   kolidowało z motywem WordPressa. Tryb ciemny: .osc-root.osc-dark
   ============================================================ */

.osc-root {
  /* Tokeny — jasny */
  --osc-bg: #f7f7f9;
  --osc-surface: #ffffff;
  --osc-surface-2: #f1f1f4;
  --osc-fg: #18181b;
  --osc-muted: #71717a;
  --osc-border: #e6e6ea;
  --osc-accent: #4f46e5;
  --osc-accent-fg: #ffffff;
  --osc-accent-soft: #eef0ff;
  --osc-ring: rgba(99, 102, 241, 0.35);
  --osc-danger: #dc2626;
  --osc-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);

  container-type: inline-size;
  position: relative;
  box-sizing: border-box;
  background: var(--osc-bg);
  color: var(--osc-fg);
  border: 1px solid var(--osc-border);
  border-radius: 18px;
  padding: 16px;
  padding-top: 58px; /* miejsce na pasek narzędzi (prawy górny róg) */
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.osc-root.osc-dark {
  --osc-bg: #0a0a0c;
  --osc-surface: #141417;
  --osc-surface-2: #1c1c21;
  --osc-fg: #fafafa;
  --osc-muted: #9b9ba4;
  --osc-border: #27272d;
  --osc-accent: #818cf8;
  --osc-accent-fg: #0a0a0c;
  --osc-accent-soft: #1d1d2b;
  --osc-ring: rgba(129, 140, 248, 0.4);
  --osc-danger: #f87171;
  --osc-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
}

.osc-root *,
.osc-root *::before,
.osc-root *::after {
  box-sizing: border-box;
}

.osc-root :where(h1, h2, h3, p, ul, ol, li) {
  margin: 0;
  padding: 0;
}
.osc-root :where(ul, ol) {
  list-style: none;
}
.osc-root button {
  font: inherit;
  cursor: pointer;
}

/* Pasek narzędzi (prawy górny róg) */
.osc-toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  z-index: 5;
}
.osc-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--osc-border);
  border-radius: 10px;
  background: var(--osc-surface);
  color: var(--osc-muted);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.osc-icon-btn:hover {
  color: var(--osc-fg);
  border-color: var(--osc-accent);
}
.osc-icon-btn svg {
  width: 18px;
  height: 18px;
}

/* ---- Widok formularza ---- */
.osc-hero {
  max-width: 640px;
  margin: 8px auto 0;
  text-align: center;
  padding: 8px 8px 0;
}
.osc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--osc-border);
  background: var(--osc-surface-2);
  color: var(--osc-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
}
.osc-chip svg {
  width: 13px;
  height: 13px;
  color: var(--osc-accent);
}
.osc-hero h1 {
  font-size: clamp(26px, 4cqi, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 14px;
  text-wrap: balance;
}
.osc-hero p {
  margin-top: 12px;
  color: var(--osc-muted);
  font-size: 15px;
  text-wrap: pretty;
}

.osc-form {
  margin-top: 28px;
}
.osc-grid {
  display: grid;
  gap: 20px;
}
@container (min-width: 720px) {
  .osc-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

.osc-card {
  background: var(--osc-surface);
  border: 1px solid var(--osc-border);
  border-radius: 16px;
}
.osc-card-pad {
  padding: 20px;
}
.osc-field + .osc-field {
  margin-top: 18px;
}
.osc-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 7px;
}
.osc-label svg {
  width: 15px;
  height: 15px;
}
.osc-label .osc-opt {
  font-weight: 400;
  color: var(--osc-muted);
}
.osc-accent-ico {
  color: var(--osc-accent);
}
.osc-muted-ico {
  color: var(--osc-muted);
}
.osc-input,
.osc-textarea {
  width: 100%;
  border: 1px solid var(--osc-border);
  background: var(--osc-surface);
  color: var(--osc-fg);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.osc-textarea {
  resize: vertical;
  min-height: 96px;
}
.osc-input:focus,
.osc-textarea:focus {
  outline: none;
  border-color: var(--osc-accent);
  box-shadow: 0 0 0 3px var(--osc-ring);
}
.osc-input::placeholder,
.osc-textarea::placeholder {
  color: var(--osc-muted);
  opacity: 0.75;
}
.osc-help {
  margin-top: 6px;
  font-size: 12px;
  color: var(--osc-muted);
}

/* Przyciski */
.osc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  border-radius: 12px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s;
}
.osc-btn svg {
  width: 18px;
  height: 18px;
}
.osc-btn-primary {
  background: var(--osc-accent);
  color: var(--osc-accent-fg);
  box-shadow: var(--osc-shadow);
}
.osc-btn-primary:hover {
  opacity: 0.9;
}
.osc-btn-primary:disabled {
  opacity: 0.55;
  cursor: default;
}
.osc-btn-ghost {
  background: var(--osc-surface);
  color: var(--osc-fg);
  border-color: var(--osc-border);
  padding: 9px 14px;
  font-size: 13px;
}
.osc-btn-ghost:hover {
  background: var(--osc-surface-2);
}
.osc-actions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
}

.osc-alert {
  margin-top: 20px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid rgba(220, 38, 38, 0.3);
  background: rgba(220, 38, 38, 0.08);
  color: var(--osc-danger);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
}
.osc-alert svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 2px;
}

/* ---- Kalendarz ---- */
.osc-cal {
  background: var(--osc-surface);
  border: 1px solid var(--osc-border);
  border-radius: 16px;
  padding: 14px;
  user-select: none;
}
.osc-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.osc-cal-title {
  font-weight: 700;
  font-size: 15px;
  text-transform: capitalize;
}
.osc-cal-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--osc-border);
  background: var(--osc-surface);
  color: var(--osc-muted);
}
.osc-cal-nav:hover {
  color: var(--osc-fg);
}
.osc-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.osc-cal-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--osc-muted);
  padding: 4px 0;
  text-transform: capitalize;
}
.osc-cal-day {
  aspect-ratio: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--osc-fg);
  border-radius: 10px;
  font-size: 13px;
  transition: background 0.12s, color 0.12s;
}
.osc-cal-day:hover:not(:disabled):not(.osc-cal-empty) {
  background: var(--osc-surface-2);
}
.osc-cal-day.osc-cal-selected {
  background: var(--osc-accent);
  color: var(--osc-accent-fg);
  font-weight: 700;
}
.osc-cal-day.osc-cal-today:not(.osc-cal-selected) {
  color: var(--osc-accent);
  font-weight: 700;
}
.osc-cal-day:disabled {
  color: var(--osc-muted);
  opacity: 0.35;
  cursor: default;
}
.osc-cal-empty {
  visibility: hidden;
}
.osc-deadline-info {
  margin-top: 10px;
  text-align: center;
  font-size: 14px;
  min-height: 22px;
}
.osc-deadline-info b {
  font-weight: 700;
}
.osc-deadline-info .osc-muted {
  color: var(--osc-muted);
}

/* ---- Oś czasu ---- */
.osc-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.osc-plan-head h1 {
  font-size: clamp(19px, 3cqi, 24px);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.osc-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 14px;
  color: var(--osc-muted);
}
.osc-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.osc-meta svg {
  width: 15px;
  height: 15px;
}

.osc-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  margin: 18px 0 8px;
}
.osc-progress-head b {
  font-weight: 600;
}
.osc-progress-head .osc-muted {
  color: var(--osc-muted);
}
.osc-track {
  height: 10px;
  width: 100%;
  background: var(--osc-surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.osc-fill {
  height: 100%;
  background: var(--osc-accent);
  border-radius: 999px;
  width: 0;
  transition: width 0.5s ease;
}

.osc-timeline {
  position: relative;
  margin-top: 28px;
}
.osc-timeline::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: var(--osc-border);
}
.osc-node {
  position: relative;
  padding-left: 48px;
  padding-bottom: 24px;
  animation: oscFade 0.4s ease both;
}
@keyframes oscFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.osc-dot {
  position: absolute;
  left: 11px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid var(--osc-border);
  background: var(--osc-bg);
  display: grid;
  place-items: center;
}
.osc-dot svg {
  width: 10px;
  height: 10px;
  color: var(--osc-accent-fg);
}
.osc-dot.osc-dot-current {
  border-color: var(--osc-accent);
}
.osc-dot.osc-dot-done {
  border-color: var(--osc-accent);
  background: var(--osc-accent);
}

/* Znacznik „Dziś” */
.osc-today {
  position: relative;
  padding-left: 48px;
  padding-bottom: 24px;
}
.osc-today-dot {
  position: absolute;
  left: 12px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--osc-accent);
  box-shadow: 0 0 0 4px var(--osc-accent-soft);
}
.osc-today-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--osc-accent);
}

.osc-module {
  background: var(--osc-surface);
  border: 1px solid var(--osc-border);
  border-radius: 16px;
  overflow: hidden;
}
.osc-module.osc-module-current {
  border-color: color-mix(in srgb, var(--osc-accent) 50%, var(--osc-border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--osc-accent) 18%, transparent);
}
.osc-module-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
}
.osc-module-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.osc-module-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--osc-accent);
}
.osc-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--osc-accent);
  background: var(--osc-accent-soft);
  border: 1px solid color-mix(in srgb, var(--osc-accent) 30%, transparent);
  padding: 2px 8px;
  border-radius: 999px;
}
.osc-module h3 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  text-wrap: pretty;
}
.osc-module-sum {
  margin-top: 4px;
  font-size: 14px;
  color: var(--osc-muted);
}
.osc-badge {
  flex: none;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  color: var(--osc-muted);
  background: var(--osc-surface-2);
  border: 1px solid var(--osc-border);
  padding: 4px 10px;
  border-radius: 999px;
}
.osc-module-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px 12px;
}
.osc-module-meta .osc-track {
  height: 6px;
  flex: 1;
}
.osc-module-meta .osc-mini {
  font-size: 12px;
  color: var(--osc-muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.osc-module-meta .osc-mini svg {
  width: 12px;
  height: 12px;
}
.osc-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--osc-muted);
  border-radius: 8px;
}
.osc-toggle:hover {
  background: var(--osc-surface-2);
  color: var(--osc-fg);
}
.osc-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}
.osc-toggle.osc-open svg {
  transform: rotate(180deg);
}

.osc-checklist {
  border-top: 1px solid var(--osc-border);
  padding: 8px;
}
.osc-check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--osc-fg);
  transition: background 0.12s;
}
.osc-check-item:hover {
  background: color-mix(in srgb, var(--osc-fg) 4%, transparent);
}
.osc-checkbox {
  flex: none;
  width: 20px;
  height: 20px;
  border: 1px solid var(--osc-border);
  border-radius: 7px;
  background: var(--osc-surface);
  display: grid;
  place-items: center;
  transition: background 0.12s, border-color 0.12s;
}
.osc-checkbox svg {
  width: 13px;
  height: 13px;
  color: var(--osc-accent-fg);
  opacity: 0;
}
.osc-check-item.osc-checked .osc-checkbox {
  background: var(--osc-accent);
  border-color: var(--osc-accent);
}
.osc-check-item.osc-checked .osc-checkbox svg {
  opacity: 1;
}
.osc-check-item.osc-checked .osc-check-label {
  color: var(--osc-muted);
  text-decoration: line-through;
}

.osc-footnote {
  margin-top: 6px;
  padding-left: 48px;
  font-size: 14px;
  color: var(--osc-muted);
}

/* Spinner */
.osc-spin {
  animation: oscSpin 0.8s linear infinite;
}
@keyframes oscSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Pełny ekran */
.osc-root:fullscreen,
.osc-root:-webkit-full-screen {
  border-radius: 0;
  overflow-y: auto;
  padding: 64px max(24px, 5vw) 48px;
}
.osc-root:fullscreen .osc-inner,
.osc-root:-webkit-full-screen .osc-inner {
  max-width: 760px;
  margin: 0 auto;
}
