/* Toki (newtoki) tab styling — same token palette as app.css / munpia_ui.css. */
.toki-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1180px;
}

/* ---------- header ---------- */
.tk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 22px;
}
.tk-head h2 { margin: 0 0 8px; font-size: 20px; color: var(--ink); }
.tk-note { font-size: 13.5px; color: var(--muted); }
.tk-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.tk-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #a8551d;
  background: rgba(255, 154, 91, 0.15);
  border-radius: 999px;
}

/* ---------- form ---------- */
.tk-form { display: flex; gap: 12px; align-items: flex-end; }
.tk-field { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.tk-field span {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
}
.tk-field input {
  height: 44px;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.tk-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 82, 103, 0.14);
}

/* ---------- series ---------- */
.tk-series {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.tk-series-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 14px;
}
.tk-series-info strong { color: var(--ink); }

.tk-tag {
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(25, 36, 54, 0.07);
  color: var(--muted);
}
.tk-tag.listed { background: rgba(19, 184, 154, 0.14); color: var(--teal); }

.tk-warn {
  padding: 10px 14px;
  font-size: 12.5px;
  color: #a8551d;
  background: rgba(255, 154, 91, 0.14);
  border-radius: 12px;
}

.tk-ep-list {
  display: flex;
  flex-direction: column;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.tk-ep {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.tk-ep:last-child { border-bottom: none; }
.tk-ep .num {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--muted);
}
.tk-ep .ttl {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 999px;
}
.badge.paid { background: rgba(240, 82, 103, 0.15); color: var(--accent); }

/* ---------- toolbar ---------- */
.tk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.tk-mini { display: flex; flex-direction: column; gap: 5px; }
.tk-mini span { font-size: 12px; font-weight: 600; color: var(--muted); }
.tk-mini input {
  width: 170px;
  height: 38px;
  padding: 0 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.tk-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.tk-check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ---------- buttons ---------- */
.tk-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  color: var(--ink);
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.14s ease;
}
.tk-btn:hover { border-color: var(--accent); color: var(--accent); }
.tk-btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}
.tk-btn.primary:hover { filter: brightness(1.05); color: #fff; }
.tk-btn.big { height: 44px; padding: 0 22px; }
.tk-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- running job ---------- */
.tk-job {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.tk-jobhead {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.tk-jobhead strong { color: var(--ink); }
.tk-jobhead span { font-size: 13px; color: var(--muted); }

.tk-progress {
  height: 7px;
  overflow: hidden;
  background: rgba(25, 36, 54, 0.08);
  border-radius: 999px;
}
.tk-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.tk-log {
  max-height: 240px;
  padding: 12px 14px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-wrap;
  background: rgba(25, 36, 54, 0.035);
  border-radius: 12px;
}

.tk-files {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 6px;
  padding: 12px;
  max-height: 260px;
  overflow-y: auto;
  background: rgba(25, 36, 54, 0.03);
  border-radius: 12px;
}
.tk-file {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  font-size: 12.5px;
  color: var(--ink);
  text-decoration: none;
  background: var(--panel-solid);
  border: 1px solid transparent;
  border-radius: 8px;
}
.tk-file:hover { border-color: var(--accent); color: var(--accent); }
.tk-file i { font-style: normal; color: var(--muted); font-size: 11px; }

/* ---------- library ---------- */
.tk-lib {
  display: flex;
  flex-direction: column;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.tk-lib-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(240, 82, 103, 0.05), rgba(109, 94, 246, 0.05));
  border-bottom: 1px solid var(--line);
}
.tk-lib-title { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 200px; }
.tk-lib-title strong { font-size: 16px; color: var(--ink); }
.tk-lib-title small { font-size: 12.5px; color: var(--muted); }

.tk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 0;
}

.tk-book {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  transition: background 0.14s ease;
}
.tk-book:hover { background: rgba(240, 82, 103, 0.03); }
.tk-book-top { display: flex; gap: 14px; align-items: flex-start; }

.tk-cover {
  width: 44px;
  height: 58px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--violet));
  border-radius: 8px;
}
.tk-book-info { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.tk-book-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tk-book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.tk-pill2 {
  padding: 2px 9px;
  background: rgba(25, 36, 54, 0.06);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.tk-pill2.life { color: #a8551d; background: rgba(255, 154, 91, 0.15); font-weight: 600; }
.tk-pill2.life.soon { color: #fff; background: var(--accent); }

.tk-book-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tk-book-actions .tk-btn { flex: 1; justify-content: center; min-width: 130px; }

.tk-chapters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 6px;
  padding: 12px;
  max-height: 300px;
  overflow-y: auto;
  background: rgba(25, 36, 54, 0.03);
  border-radius: 12px;
}
.tk-chap {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  font-size: 12.5px;
  color: var(--ink);
  text-decoration: none;
  background: var(--panel-solid);
  border: 1px solid transparent;
  border-radius: 8px;
  transition: all 0.12s ease;
}
.tk-chap:hover { border-color: var(--accent); color: var(--accent); }
.tk-chap i { font-style: normal; color: var(--muted); font-size: 11px; }

.tk-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 46px 22px;
  font-size: 13.5px;
  color: var(--muted);
  text-align: center;
}
.tk-empty b { font-size: 26px; font-weight: 400; opacity: 0.45; }

.tk-range{border:0;padding:0;margin:0;display:flex;gap:10px;align-items:center;flex-wrap:wrap}.tk-range-inputs{display:flex;gap:6px;align-items:center}.tk-range-inputs input{width:90px}.tk-range legend{font-weight:700}
