/* ==========================================================================
   Paddy Prompt Studio — LRC maker & lyric sync
   Layers on /blog/style.css and /tools/shared/tool-common.css.
   ========================================================================== */
.lx { position: relative; }
.lx [hidden] { display: none !important; }
.lx.is-dragging::after {
  content: "Drop it like it\2019s hot (a song, or an .lrc / .srt / .txt)";
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 2rem; text-align: center;
  border: 2px dashed #67e8f9; border-radius: 22px; background: rgba(4, 5, 7, 0.86);
  font-family: "Space Grotesk", Inter, sans-serif; font-size: 1.4rem; font-weight: 800; color: #fff;
}
.lx button:focus-visible, .lx input:focus-visible, .lx textarea:focus-visible, .lx label:focus-within { outline: 2px solid #22d3ee; outline-offset: 2px; }

/* ------------------------------------------------------------ Steps */
.lx-step { display: flex; align-items: center; gap: 0.55rem; margin: 0 0 0.6rem; font-family: "Space Grotesk", Inter, sans-serif; font-size: 1.05rem; font-weight: 800; color: #fff; }
.lx-step b {
  display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; flex: none;
  font-size: 0.85rem; color: #0b0620; background: linear-gradient(135deg, #818cf8, #22d3ee);
}
.lx-step small { font-family: Inter, sans-serif; font-size: 0.8rem; font-weight: 600; color: var(--text-dim); }
.lx-setup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 1rem; }
.lx-block + .lx-block { margin-top: 1.2rem; padding-top: 1.1rem; border-top: 1px solid var(--border-soft); }

/* ------------------------------------------------------------ Song */
.lx-drop {
  display: flex; align-items: center; gap: 0.85rem; cursor: pointer; min-height: 5.2rem;
  padding: 0.9rem 1rem; border-radius: 16px; border: 1.5px dashed rgba(129, 140, 248, 0.45);
  background: rgba(129, 140, 248, 0.06); transition: background 0.15s ease, border-color 0.15s ease;
}
.lx-drop:hover { background: rgba(129, 140, 248, 0.13); border-color: rgba(103, 232, 249, 0.7); }
.lx-drop.has-file { border-style: solid; border-color: rgba(52, 211, 153, 0.45); background: rgba(52, 211, 153, 0.06); }
.lx-drop .ico { font-size: 1.7rem; line-height: 1; flex: none; }
.lx-drop strong { display: block; color: #fff; font-size: 0.98rem; word-break: break-word; }
.lx-drop span span { display: block; font-size: 0.82rem; color: var(--text-muted); margin-top: 0.15rem; }
.lx-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.lx-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.7rem; }
.lx-meta label:last-child { grid-column: 1 / -1; }
.lx-field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.lx-field input { width: 100%; text-transform: none; letter-spacing: 0; font-size: 0.92rem; font-weight: 500; }

/* ------------------------------------------------------------ Lyrics */
.lx-lyrics {
  width: 100%; min-height: 12.5rem; resize: vertical; display: block;
  font: inherit; font-size: 0.95rem; line-height: 1.55; color: var(--text);
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border); border-radius: 14px; padding: 0.75rem 0.85rem;
}
.lx-lyrics::placeholder { color: var(--text-dim); }
.lx-lyr-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem; margin-top: 0.55rem; }
.lx-lyr-tools .chip-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.lx-check { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.84rem; font-weight: 600; color: var(--text-muted); cursor: pointer; min-height: 2.25rem; }
.lx-check input { width: 1rem; height: 1rem; accent-color: #818cf8; margin: 0; }
.lx-info { margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--text-dim); min-height: 1.2em; }

/* ------------------------------------------------------------ Workbench */
.lx-work { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.lx-modebar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; }

.lx-stage-wrap { position: sticky; top: 0.75rem; }
.lx-stage {
  position: relative; overflow: hidden; border-radius: 18px; padding: 1rem 1.1rem 1.1rem;
  min-height: 15.5rem; display: flex; flex-direction: column; justify-content: center; text-align: center;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(99, 102, 241, 0.22), transparent 60%),
    radial-gradient(90% 70% at 50% 110%, rgba(8, 145, 178, 0.2), transparent 60%),
    #07080d;
  border: 1px solid rgba(129, 140, 248, 0.28);
}
.lx-stage-top { position: absolute; top: 0.7rem; left: 0.9rem; right: 0.9rem; display: flex; justify-content: space-between; gap: 0.5rem; }
.lx-label, .lx-count { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; }
.lx-label { color: #a5f3fc; }
.lx-count { color: var(--text-dim); }
.lx-prev, .lx-next { margin: 0; min-height: 1.4em; font-size: 0.95rem; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-prev { margin-top: 1.4rem; opacity: 0.75; }
.lx-now {
  --wipe: 0%;
  margin: 0.55rem 0; font-family: "Space Grotesk", Inter, sans-serif; font-weight: 800;
  font-size: clamp(1.35rem, 2.6vw, 1.95rem); line-height: 1.2; color: #fff; overflow-wrap: anywhere;
}
.is-preview .lx-now {
  color: transparent;
  background: linear-gradient(90deg, #67e8f9 0, #a5b4fc var(--wipe), rgba(255, 255, 255, 0.92) var(--wipe));
  -webkit-background-clip: text; background-clip: text;
}
.lx-stage-wrap.hit .lx-stage { animation: lx-hit 0.32s ease-out; }
@keyframes lx-hit {
  0% { box-shadow: 0 0 0 0 rgba(103, 232, 249, 0.7); border-color: #67e8f9; }
  100% { box-shadow: 0 0 0 16px rgba(103, 232, 249, 0); }
}

.lx-tap {
  display: flex; align-items: center; justify-content: center; gap: 0.7rem; width: 100%; margin-top: 0.7rem;
  min-height: 4.1rem; cursor: pointer; border: 0; border-radius: 16px;
  background: linear-gradient(135deg, #818cf8, #22d3ee); color: #0b0620;
  font: inherit; font-family: "Space Grotesk", Inter, sans-serif; font-size: 1.3rem; font-weight: 800;
  box-shadow: 0 14px 34px -16px rgba(34, 211, 238, 0.8); touch-action: manipulation;
  transition: transform 0.06s ease, filter 0.15s ease;
}
.lx-tap:hover { filter: brightness(1.07); }
.lx-tap:active { transform: scale(0.985); }
.lx-tap kbd { background: rgba(11, 6, 32, 0.16); color: #0b0620; border-color: rgba(11, 6, 32, 0.25); font-size: 0.8rem; }
.lx-tap[disabled] { opacity: 0.45; cursor: not-allowed; }

.lx-transport { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.7rem; flex-wrap: wrap; }
.lx-transport .btn-ghost { min-height: 42px; padding: 0.45rem 0.75rem; font-size: 0.84rem; }
.lx-transport .lx-playbtn { width: 46px; padding: 0; font-size: 1rem; }
.lx-clock { margin-left: auto; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; }
.lx-clock b { color: #fff; font-weight: 700; }
.lx-wave {
  position: relative; height: 72px; margin-top: 0.65rem; border-radius: 12px; cursor: pointer; touch-action: none;
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border-soft); overflow: hidden;
}
.lx-wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lx-wave:focus-visible { outline: 2px solid #22d3ee; outline-offset: 2px; }
.lx-keys { display: flex; flex-wrap: wrap; gap: 0.3rem 0.85rem; margin: 0.65rem 0 0; padding: 0; list-style: none; font-size: 0.78rem; color: var(--text-dim); }
.lx-subrow { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; margin-top: 0.65rem; }
.lx-subrow .pt-label { margin: 0; }

.lx-msg { margin: 0.7rem 0 0; min-height: 1.4em; font-size: 0.9rem; color: var(--text-muted); }
.lx-msg.ok { color: #a7f3d0; }
.lx-msg.err { color: #fca5a5; font-weight: 600; }

/* ------------------------------------------------------------ Line list */
.lx-listhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.4rem; margin-bottom: 0.45rem; }
.lx-listhead p { margin: 0; font-size: 0.85rem; font-weight: 700; color: var(--text-muted); }
.lx-listhead .btn-ghost { min-height: 2.2rem; padding: 0.3rem 0.7rem; font-size: 0.78rem; }
.lx-track { height: 0.4rem; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-bottom: 0.55rem; }
.lx-track span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #34d399, #22d3ee); transition: width 0.2s ease; }
.lx-list {
  list-style: none; margin: 0; padding: 0.3rem; max-height: 27.5rem; overflow-y: auto; position: relative;
  border: 1px solid var(--border-soft); border-radius: 14px; background: rgba(0, 0, 0, 0.22);
  scrollbar-width: thin; scrollbar-color: rgba(129, 140, 248, 0.4) transparent;
}
.lx-empty { padding: 1.2rem 0.8rem; text-align: center; color: var(--text-dim); font-size: 0.9rem; }
.lx-row {
  display: grid; grid-template-columns: 1.6rem auto minmax(0, 1fr) auto; gap: 0.45rem; align-items: center;
  padding: 0.3rem 0.35rem; border-radius: 10px; border: 1px solid transparent;
}
.lx-row + .lx-row { margin-top: 0.12rem; }
.lx-row:hover { background: rgba(255, 255, 255, 0.03); }
.lx-row.is-next { border-color: rgba(252, 211, 77, 0.55); background: rgba(252, 211, 77, 0.07); }
.lx-row.is-live { border-color: rgba(103, 232, 249, 0.6); background: rgba(34, 211, 238, 0.1); }
.lx-row.is-bad .lx-time { border-color: rgba(251, 113, 133, 0.7); color: #fecdd3; }
.lx-n { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.7rem; color: var(--text-dim); text-align: right; }
.lx-tbox { display: inline-flex; align-items: center; gap: 0.15rem; }
.lx-time {
  width: 5.6rem; min-height: 2rem; padding: 0.2rem 0.35rem; text-align: center;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.8rem; color: #a5f3fc;
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border); border-radius: 8px;
}
.untimed .lx-time { color: var(--text-dim); }
.lx-text { font-size: 0.9rem; line-height: 1.35; color: var(--text); overflow-wrap: anywhere; }
.untimed .lx-text { color: var(--text-muted); }
.lx-acts { display: inline-flex; gap: 0.15rem; }
.lx-mini {
  display: inline-grid; place-items: center; width: 1.9rem; height: 2rem; cursor: pointer; padding: 0;
  font: inherit; font-size: 0.85rem; font-weight: 700; color: #c7d2fe; line-height: 1;
  background: rgba(129, 140, 248, 0.08); border: 1px solid var(--border-soft); border-radius: 8px;
}
.lx-mini:hover { background: rgba(129, 140, 248, 0.24); color: #fff; }
.lx-mini[disabled] { opacity: 0.3; cursor: not-allowed; background: transparent; }
.lx-endtag, .lx-badtag {
  display: inline-flex; align-items: center; gap: 0.2rem; margin-left: 0.25rem; padding: 0 0.2rem 0 0.45rem; border-radius: 999px;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.66rem; white-space: nowrap; vertical-align: 1px;
}
.lx-endtag { color: #fde68a; background: rgba(252, 211, 77, 0.1); border: 1px solid rgba(252, 211, 77, 0.3); }
.lx-badtag { color: #fecdd3; background: rgba(251, 113, 133, 0.1); border: 1px solid rgba(251, 113, 133, 0.35); padding-right: 0.45rem; }
.lx-x { cursor: pointer; border: 0; background: none; color: inherit; font: inherit; font-size: 0.9rem; padding: 0 0.2rem; line-height: 1; }

/* ------------------------------------------------------------ Export */
.lx-export { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 1rem; align-items: start; }
.lx-opts { display: flex; flex-direction: column; gap: 0.8rem; }
.lx-num { display: inline-flex; align-items: center; gap: 0.25rem; }
.lx-num input { width: 5.2rem; text-align: center; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.88rem; }
.lx-num .btn-ghost { min-height: 44px; width: 44px; padding: 0; }
.lx-opt-help { margin: 0.3rem 0 0; font-size: 0.78rem; color: var(--text-dim); line-height: 1.45; }
.lx-out {
  margin: 0; max-height: 17rem; min-height: 9rem; overflow: auto; white-space: pre; padding: 0.8rem 0.9rem;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.78rem; line-height: 1.55; color: #c7d2fe;
  background: rgba(0, 0, 0, 0.4); border: 1px solid var(--border); border-radius: 14px;
}
.lx-out-note { margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--text-dim); line-height: 1.5; }
.lx-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }

@media (max-width: 860px) {
  .lx-setup, .lx-work, .lx-export { grid-template-columns: 1fr; }
  .lx-stage-wrap { position: static; }
  .lx-list { max-height: 22rem; }
}
@media (max-width: 520px) {
  .lx-stage { min-height: 13rem; padding: 0.9rem 0.8rem; }
  .lx-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .lx-n { display: none; }
  .lx-row .lx-tbox .lx-mini { display: none; }
  .lx-time { width: 4.9rem; }
  .lx-meta { grid-template-columns: 1fr; }
  .lx-clock { margin-left: 0; width: 100%; text-align: right; }
}
@media (hover: none) and (pointer: coarse) {
  .lx-keys, .lx-tap kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lx-stage-wrap.hit .lx-stage { animation: none; }
}
