/* ==========================================================
   ThePremiums Tools — style.css
   Layout: satu kolom; alat (input | output) menjadi "hero",
   konten penjelasan di bawahnya dengan lebar baca nyaman.
   Semua class diawali "tp-" dan semua variabel "--tp-",
   jadi aman dipasang di tema WordPress mana pun.
   Ganti warna cukup di blok :root di bawah.
   ========================================================== */

:root {
  /* Warna (tema terang) */
  --tp-bg: #f2f5f4;          /* latar halaman, abu kehijauan */
  --tp-surface: #ffffff;     /* kartu / editor */
  --tp-surface-2: #e8eeec;   /* gutter nomor baris, header panel */
  --tp-line: #d3ddda;        /* garis batas */
  --tp-ink: #10201d;         /* teks utama */
  --tp-muted: #5a6b67;       /* teks sekunder */
  --tp-accent: #0f6b5c;      /* aksen teal tua */
  --tp-accent-ink: #ffffff;
  --tp-accent-soft: #dcefea;
  --tp-mark: #ffe36e;        /* warna stabilo untuk duplikat */
  --tp-mark-ink: #3b3000;
  --tp-danger: #b42318;

  /* Tipografi */
  --tp-font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --tp-font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tp-font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Editor: ukuran huruf & tinggi baris HARUS sama untuk gutter dan textarea */
  --tp-code-size: 0.875rem;
  --tp-code-lh: 1.5rem;

  --tp-radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tp-bg: #0e1514;
    --tp-surface: #151f1d;
    --tp-surface-2: #1c2826;
    --tp-line: #2a3936;
    --tp-ink: #e6efec;
    --tp-muted: #93a7a2;
    --tp-accent: #4fc2ac;
    --tp-accent-ink: #06201b;
    --tp-accent-soft: rgba(79, 194, 172, 0.14);
    --tp-mark: rgba(255, 227, 110, 0.24);
    --tp-mark-ink: #ffe9a0;
    --tp-danger: #f97066;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --tp-bg: #0e1514;
  --tp-surface: #151f1d;
  --tp-surface-2: #1c2826;
  --tp-line: #2a3936;
  --tp-ink: #e6efec;
  --tp-muted: #93a7a2;
  --tp-accent: #4fc2ac;
  --tp-accent-ink: #06201b;
  --tp-accent-soft: rgba(79, 194, 172, 0.14);
  --tp-mark: rgba(255, 227, 110, 0.24);
  --tp-mark-ink: #ffe9a0;
  --tp-danger: #f97066;
  color-scheme: dark;
}

/* ---------- Dasar ---------- */
.tp {
  background: var(--tp-bg);
  color: var(--tp-ink);
  font-family: var(--tp-font-body);
  font-size: 1rem;
  line-height: 1.6;
  padding-inline: 16px;
  padding-block: 0 48px;
  -webkit-font-smoothing: antialiased;
}
.tp *, .tp *::before, .tp *::after { box-sizing: border-box; }
.tp [hidden] { display: none !important; }
.tp-wrap { max-width: 1180px; margin-inline: auto; }
.tp a { color: var(--tp-accent); }
.tp :focus-visible { outline: 2px solid var(--tp-accent); outline-offset: 2px; }

/* ---------- Header ---------- */
.tp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-block: 18px;
}
.tp-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--tp-font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--tp-ink);
  text-decoration: none;
}
.tp .tp-brand { color: var(--tp-ink); }
/* Logo: tiga garis, garis tengah dicoret stabilo = baris duplikat */
.tp-logo {
  display: grid;
  gap: 3px;
  width: 22px;
}
.tp-logo i { display: block; height: 3px; border-radius: 2px; background: var(--tp-accent); }
.tp-logo i:nth-child(2) { background: var(--tp-mark); outline: 1px solid var(--tp-line); width: 70%; }
.tp-nav { display: flex; gap: 20px; flex-wrap: wrap; font-size: 0.9rem; }
.tp .tp-nav a { color: var(--tp-muted); text-decoration: none; }
.tp .tp-nav a:hover { color: var(--tp-ink); }
.tp .tp-nav a[aria-current="page"] { color: var(--tp-ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--tp-accent); text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* ---------- Judul halaman ---------- */
.tp-hero { padding-block: 20px 24px; max-width: 760px; }
.tp-h1 {
  margin: 0 0 8px;
  font-family: var(--tp-font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.tp-h1 mark {
  background: linear-gradient(transparent 55%, var(--tp-mark) 55%, var(--tp-mark) 92%, transparent 92%);
  color: inherit;
  padding-inline: 2px;
}
.tp-lead { margin: 0; color: var(--tp-muted); font-size: 1.05rem; max-width: 62ch; }
.tp-privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--tp-accent-soft);
  color: var(--tp-accent);
  font-size: 0.82rem;
  font-weight: 600;
}
.tp-privacy-pill::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--tp-accent);
}

/* ---------- Kartu alat ---------- */
.tp-tool {
  background: var(--tp-surface);
  border: 1px solid var(--tp-line);
  border-radius: 14px;
  box-shadow: 0 1px 0 var(--tp-line), 0 18px 40px -28px rgba(16, 32, 29, 0.35);
  overflow: hidden;
}

/* Baris opsi */
.tp-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--tp-line);
  margin: 0;
  border-inline: 0;
  border-top: 0;
}
.tp-options legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tp-opt-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tp-muted);
  margin-right: 4px;
}

/* Chip checkbox */
.tp-chip { position: relative; display: inline-flex; }
.tp-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tp-chip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--tp-line);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tp-ink);
  background: var(--tp-surface);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.tp-chip span::before {
  content: "";
  width: 14px; height: 14px;
  border: 1.5px solid var(--tp-muted);
  border-radius: 4px;
  flex: none;
  transition: background 0.15s, border-color 0.15s;
}
.tp-chip span:hover { border-color: var(--tp-accent); }
.tp-chip input:checked + span {
  background: var(--tp-accent-soft);
  border-color: var(--tp-accent);
}
.tp-chip input:checked + span::before {
  background: var(--tp-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
  border-color: var(--tp-accent);
}
.tp-chip input:focus-visible + span { outline: 2px solid var(--tp-accent); outline-offset: 2px; }
.tp-chip input:disabled + span { opacity: 0.45; cursor: not-allowed; }
.tp-chip small { color: var(--tp-muted); font-size: 0.78rem; font-weight: 400; }

/* Segmented control urutan */
.tp-seg {
  display: inline-flex;
  border: 1px solid var(--tp-line);
  border-radius: 8px;
  overflow: hidden;
  margin-left: auto;
}
.tp-seg-title { padding: 7px 10px; font-size: 0.82rem; color: var(--tp-muted); border-right: 1px solid var(--tp-line); background: var(--tp-surface-2); }
.tp-seg label { position: relative; }
.tp-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tp-seg span {
  display: block;
  padding: 7px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border-right: 1px solid var(--tp-line);
}
.tp-seg label:last-child span { border-right: 0; }
.tp-seg input:checked + span { background: var(--tp-accent); color: var(--tp-accent-ink); }
.tp-seg input:focus-visible + span { outline: 2px solid var(--tp-accent); outline-offset: -3px; }

/* Dua panel */
.tp-panels { display: grid; grid-template-columns: 1fr 1fr; }
.tp-panel { min-width: 0; display: flex; flex-direction: column; }
.tp-panel + .tp-panel { border-left: 1px solid var(--tp-line); }
.tp-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 52px;
  padding: 8px 12px 8px 16px;
  border-bottom: 1px solid var(--tp-line);
}
.tp-panel-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--tp-font-display);
  font-weight: 700;
  font-size: 1.02rem;
}
.tp-count {
  font-family: var(--tp-font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--tp-muted);
  font-variant-numeric: tabular-nums;
}
.tp-mini-actions { display: flex; gap: 4px; flex-wrap: wrap; }

/* Tombol kecil di header panel */
.tp-link-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--tp-muted);
  font: 500 0.83rem/1 var(--tp-font-body);
  padding: 7px 9px;
  border-radius: 7px;
  cursor: pointer;
}
.tp-link-btn:hover { color: var(--tp-ink); background: var(--tp-surface-2); }
.tp-link-btn[aria-selected="true"] { color: var(--tp-ink); background: var(--tp-surface-2); border-color: var(--tp-line); }
.tp-link-btn b { font-family: var(--tp-font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }

/* Editor dengan nomor baris */
.tp-editor {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  height: 380px;
  min-height: 200px;
  resize: vertical;
  overflow: hidden;
  background: var(--tp-surface);
}
.tp-gutter {
  margin: 0;
  overflow: hidden;
  padding: 12px 10px 60px 12px;
  min-width: 3.4em;
  text-align: right;
  background: var(--tp-surface-2);
  color: var(--tp-muted);
  font-family: var(--tp-font-mono);
  font-size: var(--tp-code-size);
  line-height: var(--tp-code-lh);
  user-select: none;
  font-variant-numeric: tabular-nums;
  white-space: pre;
  opacity: 0.8;
}
.tp-textarea {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  resize: none;
  background: transparent;
  color: var(--tp-ink);
  font-family: var(--tp-font-mono);
  font-size: var(--tp-code-size);
  line-height: var(--tp-code-lh);
  white-space: pre;
  overflow: auto;
  tab-size: 4;
}
.tp-textarea:focus { outline: none; }
.tp-editor:focus-within { box-shadow: inset 0 0 0 2px var(--tp-accent); }
.tp-textarea::placeholder { color: var(--tp-muted); opacity: 0.75; }
.tp-editor.is-drop { box-shadow: inset 0 0 0 2px var(--tp-accent); background: var(--tp-accent-soft); }
.tp-drop-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 600;
  color: var(--tp-accent);
  pointer-events: none;
}

/* Daftar duplikat */
.tp-dupes {
  height: 380px;
  min-height: 200px;
  overflow: auto;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  font-family: var(--tp-font-mono);
  font-size: var(--tp-code-size);
}
.tp-dupes li {
  display: grid;
  grid-template-columns: 4.2em minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding: 3px 14px;
}
.tp-dupes li:nth-child(even) { background: var(--tp-surface-2); }
.tp-dupe-no { color: var(--tp-muted); text-align: right; font-variant-numeric: tabular-nums; }
.tp-dupe-text { overflow-wrap: anywhere; }
.tp-dupe-text mark {
  background: var(--tp-mark);
  color: var(--tp-mark-ink);
  padding: 0 3px;
  border-radius: 2px;
  white-space: pre-wrap;
}
.tp-dupe-ref { color: var(--tp-muted); font-size: 0.78rem; white-space: nowrap; }
.tp-empty { padding: 32px 16px; text-align: center; color: var(--tp-muted); font-family: var(--tp-font-body); }

/* Bar aksi & statistik */
.tp-actionbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-top: 1px solid var(--tp-line);
  background: var(--tp-surface-2);
}
.tp-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.tp-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 9px;
  border: 1px solid var(--tp-line);
  background: var(--tp-surface);
  color: var(--tp-ink);
  font: 600 0.92rem/1 var(--tp-font-body);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
}
.tp-btn:hover:not(:disabled) { border-color: var(--tp-accent); }
.tp-btn:active:not(:disabled) { transform: translateY(1px); }
.tp-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.tp-btn--primary {
  background: var(--tp-accent);
  border-color: var(--tp-accent);
  color: var(--tp-accent-ink);
  padding-inline: 22px;
}
.tp-btn--primary:hover:not(:disabled) { filter: brightness(1.08); }
.tp-btn kbd {
  font: 500 0.7rem/1 var(--tp-font-mono);
  padding: 3px 5px;
  border-radius: 4px;
  border: 1px solid currentColor;
  opacity: 0.7;
}
.tp-btn--danger:hover:not(:disabled) { color: var(--tp-danger); border-color: var(--tp-danger); }
.tp-btn.is-done { color: var(--tp-accent); border-color: var(--tp-accent); background: var(--tp-accent-soft); }

/* Statistik */
.tp-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; }
.tp-stat { display: flex; flex-direction: column; line-height: 1.15; }
.tp-stat dt { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--tp-muted); }
.tp-stat dd { margin: 0; font-family: var(--tp-font-mono); font-size: 1.15rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.tp-stat--dupe dd { color: var(--tp-mark-ink); }
.tp-stat--dupe dd span { background: var(--tp-mark); padding: 0 4px; border-radius: 3px; }
.tp-stats dl { display: flex; gap: 6px 22px; flex-wrap: wrap; margin: 0; }

/* Meter: proporsi baris unik vs duplikat */
.tp-meter {
  display: flex;
  width: 140px;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--tp-line);
}
.tp-meter-unique { background: var(--tp-accent); transition: width 0.3s; }
.tp-meter-dupe { background: var(--tp-mark); transition: width 0.3s; }

.tp-summary {
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid var(--tp-line);
  font-size: 0.88rem;
  color: var(--tp-muted);
}
.tp-summary strong { color: var(--tp-ink); }

/* Toast */
.tp-toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 16px);
  padding: 10px 16px;
  border-radius: 9px;
  background: var(--tp-ink);
  color: var(--tp-bg);
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
  max-width: calc(100% - 32px);
}
.tp-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Konten penjelasan ---------- */
.tp-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px 56px;
  padding-top: 56px;
}
.tp-section { min-width: 0; }
.tp-section--wide { grid-column: 1 / -1; }
.tp-h2 {
  margin: 0 0 14px;
  font-family: var(--tp-font-display);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}
.tp-section p { margin: 0 0 12px; max-width: 65ch; }
.tp-muted { color: var(--tp-muted); }

/* Langkah (urutan nyata, maka bernomor) */
.tp-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.tp-steps li {
  counter-increment: step;
  padding: 18px;
  border-top: 2px solid var(--tp-accent);
  background: var(--tp-surface);
}
.tp-steps li::before {
  content: "Langkah " counter(step);
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tp-accent);
}
.tp-steps strong { display: block; margin-bottom: 4px; font-family: var(--tp-font-display); font-size: 1.05rem; }
.tp-steps p { margin: 0; color: var(--tp-muted); font-size: 0.95rem; }

/* Penjelasan opsi */
.tp-deflist { margin: 0; display: grid; gap: 14px; }
.tp-deflist div { display: grid; gap: 2px; }
.tp-deflist dt { font-weight: 600; }
.tp-deflist dd { margin: 0; color: var(--tp-muted); font-size: 0.95rem; }
.tp-deflist code, .tp-section code {
  font-family: var(--tp-font-mono);
  font-size: 0.85em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--tp-surface-2);
}

.tp-list { margin: 0; padding-left: 1.1em; display: grid; gap: 8px; }
.tp-list li::marker { color: var(--tp-accent); }

/* FAQ */
.tp-faq { display: grid; border-top: 1px solid var(--tp-line); }
.tp-faq details { border-bottom: 1px solid var(--tp-line); }
.tp-faq summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 2px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.tp-faq summary::-webkit-details-marker { display: none; }
.tp-faq summary::after { content: "+"; font-family: var(--tp-font-mono); color: var(--tp-accent); font-size: 1.1rem; line-height: 1; }
.tp-faq details[open] summary::after { content: "−"; }
.tp-faq details p { margin: 0 0 16px; color: var(--tp-muted); max-width: 70ch; }

.tp-footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--tp-line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 0.85rem;
  color: var(--tp-muted);
}

/* ---------- Responsif ---------- */
@media (max-width: 900px) {
  .tp-panels { grid-template-columns: 1fr; }
  .tp-panel + .tp-panel { border-left: 0; border-top: 1px solid var(--tp-line); }
  .tp-editor, .tp-dupes { height: 260px; }
  .tp-content { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .tp-steps { grid-template-columns: minmax(0, 1fr); }
  .tp-seg { margin-left: 0; }
}
@media (max-width: 520px) {
  .tp-actionbar { flex-direction: column; align-items: stretch; }
  .tp-buttons { display: grid; grid-template-columns: 1fr 1fr; }
  .tp-btn--primary { grid-column: 1 / -1; padding-block: 14px; }
  .tp-btn kbd { display: none; }
  .tp-chip small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tp *, .tp-toast { transition: none !important; }
}

/* Nama brand: "ThePremiums" tebal, "Tools" lebih ringan */
.tp-brand-sub { font-weight: 500; color: var(--tp-muted); }

/* ==========================================================
   Header: menu antar-alat
   ========================================================== */
.tp-nav-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tp-muted); }
.tp-nav { align-items: center; }

/* ==========================================================
   Halaman daftar alat (index.html utama)
   ========================================================== */
.tp-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.tp .tp-hub-card {
  display: grid;
  gap: 6px;
  padding: 22px;
  border: 1px solid var(--tp-line);
  border-radius: 12px;
  background: var(--tp-surface);
  color: var(--tp-ink);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.tp .tp-hub-card:hover { border-color: var(--tp-accent); transform: translateY(-2px); }
.tp-hub-card strong { font-family: var(--tp-font-display); font-size: 1.2rem; }
.tp-hub-card span { color: var(--tp-muted); font-size: 0.95rem; }
.tp-hub-card em { font-style: normal; color: var(--tp-accent); font-weight: 600; font-size: 0.9rem; }

/* ==========================================================
   Email Splitter
   ========================================================== */
.tp-sp-sourcebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--tp-line);
}
.tp-seg--source { margin-left: 0; }
.tp-sp-linecount { font-family: var(--tp-font-mono); font-size: 0.85rem; color: var(--tp-muted); font-variant-numeric: tabular-nums; }
.tp-sp-linecount b { color: var(--tp-ink); font-weight: 500; }
.tp-sp-editor { height: 340px; border-bottom: 1px solid var(--tp-line); }

.tp-sp-drop {
  min-height: 240px;
  margin: 16px;
  border: 2px dashed var(--tp-line);
  border-radius: 12px;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  transition: border-color 0.15s, background 0.15s;
}
.tp-sp-drop.is-drop { border-color: var(--tp-accent); background: var(--tp-accent-soft); }
.tp-sp-drop-inner { display: grid; justify-items: center; gap: 8px; text-align: center; }
.tp-sp-drop-inner span, .tp-sp-drop-inner small { color: var(--tp-muted); }
.tp-sp-filelist { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 560px; display: grid; gap: 8px; }
.tp-sp-filelist li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--tp-line);
  border-radius: 9px;
  background: var(--tp-surface);
}
.tp-sp-filelist .tp-sp-fname { font-weight: 600; overflow-wrap: anywhere; }
.tp-sp-filelist .tp-sp-fmeta { grid-column: 1; font-family: var(--tp-font-mono); font-size: 0.8rem; color: var(--tp-muted); }
.tp-sp-filelist .tp-sp-factions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: center; padding-top: 6px; }

.tp-sp-options { border-top: 1px solid var(--tp-line); }
.tp-sp-editor + .tp-sp-drop + .tp-sp-options, .tp-sp-editor + .tp-sp-options { border-top: 0; }
.tp-sp-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}
.tp-sp-size input, .tp-sp-prefix input {
  width: 6.5em;
  padding: 8px 10px;
  border: 1.5px solid var(--tp-line);
  border-radius: 8px;
  background: var(--tp-surface);
  color: var(--tp-ink);
  font: 500 0.95rem/1 var(--tp-font-mono);
  font-variant-numeric: tabular-nums;
}
.tp-sp-size input:focus, .tp-sp-prefix input:focus { outline: none; border-color: var(--tp-accent); box-shadow: 0 0 0 3px var(--tp-accent-soft); }
.tp-sp-size input[aria-invalid="true"] { border-color: var(--tp-danger); }
.tp-sp-presets { display: inline-flex; gap: 2px; margin-right: 8px; }
.tp-sp-presets .tp-link-btn { font-family: var(--tp-font-mono); }
.tp-sp-presets .tp-link-btn.is-active { color: var(--tp-accent); background: var(--tp-accent-soft); border-color: var(--tp-accent); }

/* Output Area */
.tp-sp-output { padding-top: 40px; }
.tp-sp-output-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tp-sp-output-head .tp-h2 { margin-bottom: 4px; }
.tp-sp-progress { margin: 0; font-size: 0.92rem; }
.tp-sp-output-actions { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.tp-sp-prefix { display: grid; gap: 4px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--tp-muted); }
.tp-sp-prefix input { width: 11em; font-family: var(--tp-font-mono); text-transform: none; letter-spacing: 0; }

.tp-sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.tp-sp-placeholder {
  grid-column: 1 / -1;
  padding: 40px 16px;
  text-align: center;
  color: var(--tp-muted);
  border: 1.5px dashed var(--tp-line);
  border-radius: 12px;
}
.tp-sp-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--tp-surface);
  border: 1px solid var(--tp-line);
  border-radius: 12px;
  overflow: hidden;
}
.tp-sp-card.is-copied { border-color: var(--tp-accent); }
.tp-sp-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--tp-line);
}
.tp-sp-card-title { font-family: var(--tp-font-display); font-weight: 700; font-size: 1.02rem; }
.tp-sp-card-meta { font-family: var(--tp-font-mono); font-size: 0.76rem; color: var(--tp-muted); font-variant-numeric: tabular-nums; text-align: right; }
.tp-sp-card textarea {
  display: block;
  width: 100%;
  height: 150px;
  margin: 0;
  padding: 10px 14px;
  border: 0;
  resize: vertical;
  background: var(--tp-surface);
  color: var(--tp-ink);
  font-family: var(--tp-font-mono);
  font-size: 0.8rem;
  line-height: 1.35rem;
  white-space: pre;
  overflow: auto;
}
.tp-sp-card textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--tp-accent); }
.tp-sp-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  border-top: 1px solid var(--tp-line);
  background: var(--tp-surface-2);
}
.tp-sp-card-foot .tp-btn { padding: 8px 12px; font-size: 0.85rem; }
.tp-sp-card-foot .tp-buttons { gap: 6px; }
.tp-sp-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--tp-muted);
}
.tp-sp-card.is-copied .tp-sp-badge { color: var(--tp-accent); }
.tp-sp-more { display: flex; justify-content: center; padding-top: 18px; }

@media (max-width: 520px) {
  .tp-sp-output-actions { width: 100%; }
  .tp-sp-prefix { flex: 1; }
  .tp-sp-prefix input { width: 100%; }
  .tp-sp-card-foot .tp-buttons { display: flex; }
  .tp-sp-presets { margin-right: 0; }
}
