.m3u8tk {
  margin: 24px 0;
  padding: 24px;
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

.m3u8tk * { box-sizing: border-box; }

.m3u8tk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.m3u8tk-head h2 {
  margin: 5px 0 6px;
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.18;
}

.m3u8tk-head p {
  margin: 0;
  max-width: 780px;
  color: #64748b;
  font-size: 0.98rem;
  line-height: 1.65;
}

.m3u8tk-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2563eb;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .74rem;
}

.m3u8tk-badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: .82rem;
  font-weight: 700;
}

.m3u8tk-input-row,
.m3u8tk-playlist-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 16px 0;
}

.m3u8tk-playlist-form {
  grid-template-columns: minmax(140px, 0.35fr) minmax(180px, 1fr) auto;
}

.m3u8tk input,
.m3u8tk textarea {
  width: 100%;
  border: 1px solid rgba(100, 116, 139, 0.24);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  color: #0f172a;
  outline: none;
  font: inherit;
}

.m3u8tk textarea {
  resize: vertical;
  min-height: 150px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .88rem;
}

.m3u8tk input:focus,
.m3u8tk textarea:focus {
  border-color: rgba(37, 99, 235, .7);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .1);
}

.m3u8tk-btn,
.m3u8tk-file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(100, 116, 139, 0.22);
  border-radius: 14px;
  padding: 11px 14px;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  font-weight: 750;
  font: inherit;
  line-height: 1.2;
  text-decoration: none;
}

.m3u8tk-btn:hover,
.m3u8tk-file-label:hover {
  border-color: rgba(37, 99, 235, .45);
  color: #1d4ed8;
}

.m3u8tk-btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, .18);
}

.m3u8tk-btn-primary:hover { color: #fff; background: #1d4ed8; }

.m3u8tk-player-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 18px;
  align-items: stretch;
  margin-top: 18px;
}

.m3u8tk-video-wrap {
  border-radius: 20px;
  overflow: hidden;
  background: #020617;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.m3u8tk-video {
  display: block;
  width: 100%;
  min-height: 320px;
  aspect-ratio: 16 / 9;
  background: #020617;
}

.m3u8tk-side-panel,
.m3u8tk-report-block,
.m3u8tk-command-card,
.m3u8tk-detail-panel details {
  border: 1px solid rgba(100, 116, 139, .14);
  background: #f8fafc;
  border-radius: 20px;
  padding: 16px;
}

.m3u8tk-health-box {
  border: 1px solid rgba(37, 99, 235, .12);
  background: rgba(37, 99, 235, .05);
  border-radius: 16px;
  padding: 12px 14px;
  margin: 12px 0;
  color: #334155;
}

.m3u8tk-health-box ul,
.m3u8tk-detail-panel ul { margin: 8px 0 0 18px; padding: 0; }

.m3u8tk-status {
  white-space: pre-line;
  border: 1px solid rgba(100, 116, 139, .14);
  border-radius: 16px;
  background: #f8fafc;
  color: #334155;
  padding: 14px;
  line-height: 1.6;
  margin: 14px 0;
}

.m3u8tk-status.is-ok { background: #ecfdf5; border-color: rgba(34, 197, 94, .22); color: #166534; }
.m3u8tk-status.is-warn { background: #fffbeb; border-color: rgba(245, 158, 11, .24); color: #92400e; }
.m3u8tk-status.is-error { background: #fef2f2; border-color: rgba(239, 68, 68, .22); color: #991b1b; }
.m3u8tk-status.is-loading { background: #eff6ff; border-color: rgba(37, 99, 235, .22); color: #1e40af; }

.m3u8tk-actions,
.m3u8tk-actions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 12px 0;
}

.m3u8tk-actions-inline { margin: 0; }

.m3u8tk-history-block { margin-top: 16px; }
.m3u8tk-history-block strong { display: block; margin-bottom: 10px; }

.m3u8tk-history-list,
.m3u8tk-playlist-list {
  display: grid;
  gap: 9px;
}

.m3u8tk-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(100, 116, 139, .14);
  background: #fff;
  border-radius: 14px;
  padding: 11px 12px;
}

.m3u8tk-list-item strong,
.m3u8tk-list-item span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m3u8tk-list-item span {
  color: #64748b;
  font-size: .86rem;
  margin-top: 4px;
}

.m3u8tk-mini-actions {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.m3u8tk-mini-actions .m3u8tk-btn { padding: 8px 10px; border-radius: 11px; font-size: .84rem; }

.m3u8tk-empty {
  display: grid;
  gap: 4px;
  border: 1px dashed rgba(100, 116, 139, .28);
  border-radius: 14px;
  padding: 14px;
  color: #64748b;
}

.m3u8tk-empty strong { color: #0f172a; }

.m3u8tk-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.m3u8tk-result-card {
  border: 1px solid rgba(100, 116, 139, .14);
  background: #fff;
  border-radius: 18px;
  padding: 15px;
  min-height: 88px;
}

.m3u8tk-result-card strong {
  display: block;
  font-size: 1.15rem;
  margin-bottom: 8px;
  word-break: break-word;
}

.m3u8tk-result-card span { color: #64748b; line-height: 1.45; }

.m3u8tk-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.m3u8tk-detail-panel { margin: 14px 0; }
.m3u8tk-detail-panel details { padding: 0; overflow: hidden; }
.m3u8tk-detail-panel summary { cursor: pointer; padding: 14px 16px; font-weight: 800; }
.m3u8tk-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 16px 16px; }

.m3u8tk-table-wrap { overflow-x: auto; padding: 0 16px 16px; }
.m3u8tk table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
.m3u8tk th,
.m3u8tk td { border-bottom: 1px solid rgba(100, 116, 139, .14); padding: 10px; text-align: left; vertical-align: top; }
.m3u8tk th { color: #334155; background: #f1f5f9; font-size: .86rem; }
.m3u8tk td code { word-break: break-all; white-space: normal; }

.m3u8tk-command-card { margin-top: 16px; }
.m3u8tk-command-card p { color: #64748b; line-height: 1.6; }
.m3u8tk-command-card pre {
  overflow-x: auto;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 16px;
  padding: 14px;
}

.m3u8tk-file-label input { display: none; }

.m3u8tk-note {
  margin-top: 18px;
  border: 1px solid rgba(100, 116, 139, .14);
  border-radius: 16px;
  padding: 12px 14px;
  color: #64748b;
  background: #f8fafc;
  font-size: .92rem;
  line-height: 1.55;
}

@media (max-width: 980px) {
  .m3u8tk-player-grid,
  .m3u8tk-detail-grid { grid-template-columns: 1fr; }
  .m3u8tk-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .m3u8tk { padding: 18px; border-radius: 20px; }
  .m3u8tk-head { display: grid; }
  .m3u8tk-input-row,
  .m3u8tk-playlist-form { grid-template-columns: 1fr; }
  .m3u8tk-result-grid { grid-template-columns: 1fr; }
  .m3u8tk-report-head { align-items: flex-start; flex-direction: column; }
  .m3u8tk-list-item { grid-template-columns: 1fr; }
  .m3u8tk-mini-actions { flex-wrap: wrap; }
  .m3u8tk-video-wrap,
  .m3u8tk-video { min-height: 220px; }
}


/* V0.4 static export health block */
.m3u8tk-static-health .m3u8tk-card span { display: block; margin-top: 6px; font-size: 18px; font-weight: 800; color: #0f172a; }
.m3u8tk-static-health .m3u8tk-card small { display: block; margin-top: 6px; color: #64748b; line-height: 1.5; }


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

@media (max-width: 900px) {
  .m3u8tk-checklist-grid { grid-template-columns: 1fr; }
}
