jadwal-timetable {
  display: block;
  width: 100%;
  direction: rtl;
  font-family: sans;
  --jt-accent: #f64417;
  --jt-accent-dim: #f6441726;
  --jt-accent-text: #f64417;
  --jt-bg: #ffffff;
  --jt-bg-soft: #f7f6f4;
  --jt-card: #ffffff;
  --jt-border: rgba(20, 18, 16, 0.09);
  --jt-text: #18140f;
  --jt-text-soft: #6e6a63;
  --jt-text-faint: #a6a199;
  --jt-done-bg: #f2f1ee;
  --jt-radius: 16px;
  --jt-radius-sm: 10px;
  color: var(--jt-text);
}

jadwal-timetable[data-theme="dark"] {
  --jt-bg: #15130f;
  --jt-bg-soft: #1c1a15;
  --jt-card: #201d18;
  --jt-border: rgba(255, 255, 255, 0.08);
  --jt-text: #f3efe8;
  --jt-text-soft: #b0aaa0;
  --jt-text-faint: #756f66;
  --jt-done-bg: #1a1814;
}

@media (prefers-color-scheme: dark) {
  jadwal-timetable:not([data-theme="light"]) {
    --jt-bg: #15130f;
    --jt-bg-soft: #1c1a15;
    --jt-card: #201d18;
    --jt-border: rgba(255, 255, 255, 0.08);
    --jt-text: #f3efe8;
    --jt-text-soft: #b0aaa0;
    --jt-text-faint: #756f66;
    --jt-done-bg: #1a1814;
  }
}

.jt-root {
  background: var(--jt-bg);
  border-radius: var(--jt-radius);
  padding: 5px;
  box-sizing: border-box;
}

.jt-root * { box-sizing: border-box; }

/* ---------- Hero / countdown ---------- */
.jt-hero {
  position: relative;
  background: linear-gradient(160deg, var(--jt-accent) 0%, #d6360e 100%);
  border-radius: var(--jt-radius);
  padding: 22px 22px 20px;
  color: #fff;
  overflow: hidden;
  margin-bottom: 22px;
  isolation: isolate;
}

.jt-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 100% 0%, rgba(255,255,255,0.16), transparent 55%);
  pointer-events: none;
}

.jt-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.jt-hero-label {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  background: rgba(255,255,255,0.18);
  padding: 5px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.jt-hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: jt-pulse 1.6s ease-in-out infinite;
}

@keyframes jt-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

.jt-hero-cost {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.92;
}

.jt-hero-subject {
  font-size: 21px;
  font-weight: 700;
  margin: 0 0 4px;
  position: relative;
  z-index: 1;
}

.jt-hero-date {
  font-size: 13.5px;
  opacity: 0.85;
  margin: 0 0 18px;
  position: relative;
  z-index: 1;
}

.jt-countdown {
  display: flex;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.jt-cd-unit {
  flex: 1;
  background: rgba(255,255,255,0.16);
  border-radius: 12px;
  padding: 10px 6px 8px;
  text-align: center;
  min-width: 0;
}

.jt-cd-num {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  display: block;
}

.jt-cd-unit-label {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 4px;
  display: block;
}

.jt-hero-empty {
  font-size: 15px;
  font-weight: 600;
  position: relative;
  z-index: 1;
  padding: 6px 0 2px;
}

/* ---------- Filters ---------- */
.jt-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.jt-filters::-webkit-scrollbar { display: none; }

.jt-filter-btn {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--jt-border);
  background: var(--jt-bg-soft);
  color: var(--jt-text-soft);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.jt-filter-btn:hover {
  border-color: var(--jt-accent);
}

.jt-filter-btn.is-active {
  background: var(--jt-accent);
  border-color: var(--jt-accent);
  color: #fff;
}

/* ---------- Timeline ---------- */
.jt-timeline {
  position: relative;
  padding-right: 28px;
}

.jt-spine {
  position: absolute;
  top: 6px;
  bottom: 6px;
  right: 7px;
  width: 2px;
  background: linear-gradient(to bottom, var(--jt-border), var(--jt-border));
}

.jt-item {
  position: relative;
  padding-bottom: 16px;
}

.jt-item:last-child { padding-bottom: 0; }

.jt-node {
  position: absolute;
  top: 18px;
  right: -28px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--jt-bg);
  border: 2px solid var(--jt-text-faint);
  z-index: 1;
}

.jt-item.is-done .jt-node {
  border-color: var(--jt-text-faint);
  background: var(--jt-text-faint);
}

.jt-item.is-live .jt-node {
  border-color: var(--jt-accent);
  background: var(--jt-accent);
  box-shadow: 0 0 0 4px var(--jt-accent-dim);
  animation: jt-node-pulse 1.6s ease-in-out infinite;
}

@keyframes jt-node-pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--jt-accent-dim); }
  50% { box-shadow: 0 0 0 7px transparent; }
}

.jt-item.is-next .jt-node {
  border-color: var(--jt-accent);
  background: var(--jt-bg);
}

.jt-card {
  background: var(--jt-card);
  border: 1px solid var(--jt-border);
  border-radius: var(--jt-radius-sm);
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

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

.jt-card:active {
  transform: scale(0.985);
}

.jt-card:focus-visible {
  outline: 2px solid var(--jt-accent);
  outline-offset: 1px;
}

.jt-item.is-done .jt-card {
  background: var(--jt-done-bg);
}

.jt-item.is-done .jt-subject,
.jt-item.is-done .jt-meta,
.jt-item.is-done .jt-date-badge {
  opacity: 0.65;
}

.jt-item.is-done .jt-result-hint {
  opacity: 1;
}

.jt-item.is-live .jt-card {
  border-color: var(--jt-accent);
  box-shadow: 0 0 0 1px var(--jt-accent-dim);
}

.jt-item.is-next .jt-card {
  border-color: var(--jt-accent);
}

.jt-date-badge {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--jt-bg-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.jt-item.is-live .jt-date-badge,
.jt-item.is-next .jt-date-badge {
  background: var(--jt-accent-dim);
}

.jt-date-day {
  font-size: 17px;
  font-weight: 700;
  color: var(--jt-text);
}

.jt-item.is-live .jt-date-day,
.jt-item.is-next .jt-date-day {
  color: var(--jt-accent-text);
}

.jt-date-month {
  font-size: 10.5px;
  color: var(--jt-text-soft);
  margin-top: 1px;
}

.jt-body {
  flex: 1;
  min-width: 0;
}

.jt-subject {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jt-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--jt-text-soft);
}

.jt-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.jt-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--jt-text-faint);
}

.jt-result-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--jt-accent-text);
  margin-top: 6px;
}

.jt-result-hint-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--jt-accent-dim);
  font-size: 9px;
  line-height: 1;
  flex-shrink: 0;
}

.jt-status {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.jt-status.st-done {
  background: var(--jt-bg-soft);
  color: var(--jt-text-faint);
}

.jt-status.st-live {
  background: var(--jt-accent);
  color: #fff;
}

.jt-status.st-next {
  background: var(--jt-accent-dim);
  color: var(--jt-accent-text);
}

.jt-status.st-upcoming {
  background: var(--jt-bg-soft);
  color: var(--jt-text-soft);
}

.jt-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--jt-text-soft);
  font-size: 14px;
}

/* ---------- Total cost summary ---------- */
.jt-total-cost {
  margin-top: 18px;
  background: var(--jt-bg-soft);
  border: 1px solid var(--jt-border);
  border-radius: var(--jt-radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.jt-total-cost-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--jt-text-soft);
}

.jt-total-cost-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--jt-accent-text);
  direction: ltr;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  flex-direction: row-reverse;
}

.jt-total-cost-currency {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--jt-text-soft);
}

/* ---------- Loading skeleton ---------- */
.jt-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.jt-skel-hero {
  position: relative;
  height: 168px;
  border-radius: var(--jt-radius);
  background: var(--jt-bg-soft);
  overflow: hidden;
  margin-bottom: 22px;
}

.jt-skel-timeline {
  position: relative;
  padding-right: 28px;
}

.jt-skel-item {
  position: relative;
  display: flex;
  margin-bottom: 16px;
}

.jt-skel-node {
  position: absolute;
  top: 18px;
  right: -28px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--jt-bg-soft);
  border: 2px solid var(--jt-border);
  z-index: 1;
}

.jt-skel-card {
  flex: 1;
  background: var(--jt-card);
  border: 1px solid var(--jt-border);
  border-radius: var(--jt-radius-sm);
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  position: relative;
}

.jt-skel-badge {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--jt-bg-soft);
}

.jt-skel-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.jt-skel-line {
  height: 11px;
  border-radius: 6px;
  background: var(--jt-bg-soft);
}

.jt-skel-line-wide { width: 70%; }
.jt-skel-line-narrow { width: 40%; }

.jt-skel-shimmer,
.jt-skel-hero::after,
.jt-skel-badge::after,
.jt-skel-line::after,
.jt-skel-node::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(246, 68, 23, 0.12) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: jt-shimmer 1.6s ease-in-out infinite;
}

.jt-skel-shimmer { position: absolute; inset: 0; }
.jt-skel-badge, .jt-skel-line, .jt-skel-node { position: relative; }

@keyframes jt-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .jt-skel-shimmer,
  .jt-skel-hero::after,
  .jt-skel-badge::after,
  .jt-skel-line::after,
  .jt-skel-node::after {
    animation: none;
  }
}

@media (max-width: 420px) {
  .jt-hero-subject { font-size: 18px; }
  .jt-cd-num { font-size: 21px; }
  .jt-card { padding: 11px; gap: 10px; }
  .jt-date-badge { width: 44px; height: 44px; }
  .jt-subject { font-size: 14px; }
}
