:root {
  --bg: #050505;
  --fg: #f5f5f4;
  --muted: #9ca3af;
  --line: rgba(255, 255, 255, 0.12);
  --line-soft: rgba(255, 255, 255, 0.07);
  --accent: #b8a7ff;
  --accent-2: #8ee7ff;
  --danger: #ff8a9a;
  --ok: #8ee7ff;
  --content-w: min(var(--sz-utility-max, var(--sz-page-max)), calc(100vw - var(--sz-pad-x) * 2));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  margin: 0;
  min-height: 100%;
  background: var(--bg);
}

body.tracklist-page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

input,
textarea,
select,
button {
  font-size: 16px;
}

body {
  font-family: "Onest", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--fg);
  background:
    radial-gradient(ellipse 120% 75% at 18% 0%, rgba(184, 167, 255, 0.14), transparent 58%),
    radial-gradient(ellipse 90% 55% at 82% 6%, rgba(142, 231, 255, 0.08), transparent 52%),
    linear-gradient(180deg, #08080d 0%, #0a0a10 48%, #050507 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  color: #fff;
}

.project-main.tlid-page {
  flex: 1 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

.project-main.tlid-page .page {
  padding-top: 10px;
}

/* layout/topbar/tool-head/input/buttons: site-system.css */

.tracklist-page .tlid-bot-note,
.tlid-bot-note.utility-secondary-note {
  margin-top: 18px;
  max-width: 720px;
  color: rgba(245, 245, 244, 0.46);
  font-size: 14px;
  line-height: 1.42;
  font-weight: 500;
}

.tracklist-page .tlid-bot-note a,
.tlid-bot-note a {
  color: rgba(184, 167, 255, 0.78);
  text-decoration: none;
  font-weight: 700;
}

.tlid-bot-note a:hover {
  color: #fff;
}

.tool-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(184, 167, 255, 0.75);
}

.input-panel {
  transition: margin 0.35s ease;
}

/* input-card / editor / buttons: site-system.css */

.utility-process-float {
  position: sticky;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 6;
  margin-top: 10px;
  padding: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.input-panel.is-processed .utility-process-float {
  display: none;
}

.utility-process-float .process-button,
.utility-process-float .tlid-button-primary {
  margin-top: 0;
  box-shadow:
    0 10px 28px rgba(142, 231, 255, 0.12),
    0 8px 20px rgba(184, 167, 255, 0.1);
  transform: translateY(0);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.utility-process-float .process-button:hover:not(:disabled),
.utility-process-float .tlid-button-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 12px 32px rgba(142, 231, 255, 0.16),
    0 10px 24px rgba(184, 167, 255, 0.12);
}

.input-panel.is-processed {
  margin-bottom: 14px;
}

.input-panel-collapsed {
  display: none;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: rgba(245, 245, 244, 0.9);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
  padding: 10px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: default;
  font: 600 13px/1.2 "Onest", sans-serif;
  text-align: left;
}

.input-panel-collapsed-label {
  flex: 1 1 auto;
  min-width: 0;
}

.input-panel-collapsed-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.input-panel.is-processed .input-panel-collapsed {
  display: flex;
}

.input-panel.is-processed .input-panel-expanded .input-panel-surface,
.input-panel.is-processed .input-panel-expanded .process-button,
.input-panel.is-processed .input-panel-expanded .upload-row,
.input-panel.is-processed .input-panel-expanded .tracks-input,
.input-panel.is-processed .input-panel-expanded .input-hint {
  display: none;
}

.input-panel.is-processed .format-helper-input {
  display: none;
}

.input-panel.is-processed .input-panel-processed-actions {
  display: flex;
}

.input-panel-processed-actions {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.input-panel-surface {
  transition: box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.input-hint {
  margin: 10px 0 0;
  color: rgba(245, 245, 244, 0.48);
  font-size: 13px;
  line-height: 1.45;
}

.format-helper,
.tlid-format-help {
  width: 100%;
  max-width: 100%;
  margin: 12px 0 0;
  color: rgba(245, 245, 244, 0.42);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
}

.format-helper a,
.tlid-format-help a {
  color: rgba(184, 167, 255, 0.72);
  text-decoration: none;
  font-weight: 600;
}

.format-helper a:hover,
.tlid-format-help a:hover {
  color: #fff;
}

.tlid-format-help {
  display: none;
  margin-top: 18px;
  margin-bottom: 0;
}

body.has-result .tlid-format-help {
  display: block;
}

.upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.file-name {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(420px, 100%);
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 13px 16px;
  font: 600 14px/1 "Onest", sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary,
.tlid-file-control {
  width: auto;
  margin-top: 0;
}

.file-label {
  width: auto;
  margin-top: 0;
}

/* .btn-primary / .btn-secondary: site-system.css */

.process-button.is-loading {
  position: relative;
  color: transparent;
}

.process-button.is-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(11, 11, 15, 0.2);
  border-top-color: #0b0b0f;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.status-message {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.status-message.is-error {
  border-color: rgba(255, 138, 154, 0.35);
  background: rgba(255, 90, 120, 0.08);
  color: #ffd7de;
}

.status-message.is-success {
  border-color: rgba(142, 231, 255, 0.28);
  background: rgba(142, 231, 255, 0.08);
  color: #dffcff;
}

.tlid-result-panel {
  position: relative;
  overflow: hidden;
  margin-top: 8px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(circle at 18% 10%, rgba(184, 167, 255, 0.16), transparent 34%),
    radial-gradient(circle at 82% 20%, rgba(142, 231, 255, 0.1), transparent 36%),
    rgba(255, 255, 255, 0.045);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
  padding: 18px 18px 16px;
}

.tlid-result-panel::before {
  content: "";
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(circle at 20% 30%, rgba(184, 167, 255, 0.1), transparent 34%),
    radial-gradient(circle at 74% 48%, rgba(142, 231, 255, 0.08), transparent 36%),
    radial-gradient(circle at 52% 84%, rgba(255, 132, 72, 0.055), transparent 30%);
  pointer-events: none;
  opacity: 0.9;
}

.tlid-result-head,
.tlid-result-text,
.download-hint,
.result-copy-hint {
  position: relative;
  z-index: 1;
}

.tlid-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tlid-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.tlid-result-title {
  margin: 0;
  font-size: clamp(20px, 4vw, 26px);
  letter-spacing: -0.04em;
  font-weight: 700;
}

.tlid-result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font: 600 12px/1 "Onest", sans-serif;
  cursor: pointer;
}

.btn-ghost:hover {
  color: var(--fg);
  border-color: rgba(184, 167, 255, 0.35);
  background: rgba(184, 167, 255, 0.08);
}

.download-hint {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.result-copy-hint {
  margin: 0 0 10px;
  color: rgba(245, 245, 244, 0.42);
  font-size: 12px;
}

.tlid-result-text {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
  color: #f8fafc;
  font: 500 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
  overflow-x: auto;
  overflow-y: auto;
  max-height: min(58vh, 520px);
  -webkit-overflow-scrolling: touch;
  cursor: copy;
}

.tlid-result-panel.is-copyable {
  cursor: copy;
}

.tlid-result-panel.is-copyable .tlid-result-actions,
.tlid-result-panel.is-copyable .btn-ghost {
  cursor: pointer;
}

.copy-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(12px);
  z-index: 20;
  margin: 0;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(184, 167, 255, 0.35);
  background: rgba(12, 12, 18, 0.92);
  color: #fff;
  font: 600 13px/1 "Onest", sans-serif;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.copy-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.site-footer {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  margin-top: clamp(56px, 9vh, 120px);
  padding: 28px 0 calc(34px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(245, 245, 244, 0.42);
  font-size: 13px;
  letter-spacing: -0.015em;
}

.site-footer-scroll {
  width: 100%;
}

.site-footer-inner {
  width: var(--content-w);
  max-width: calc(100% - 40px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.site-footer-copy {
  flex: 0 0 auto;
  color: rgba(245, 245, 244, 0.42);
}

.site-footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 14px 18px;
  min-width: 0;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(245, 245, 244, 0.58);
  text-decoration: none;
  transition: color 0.18s ease;
}

.site-footer a:hover {
  color: rgba(245, 245, 244, 0.94);
}

.site-footer-contact {
  white-space: nowrap;
}

.footer-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(245, 245, 244, 0.72);
  background:
    radial-gradient(circle at 30% 20%, rgba(184, 167, 255, 0.34), rgba(184, 167, 255, 0.14) 45%, rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(184, 167, 255, 0.24);
  box-shadow:
    0 0 24px rgba(184, 167, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.site-footer a:hover .footer-icon {
  color: rgba(255, 255, 255, 0.96);
  border-color: rgba(184, 167, 255, 0.42);
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .tracklist-page .tlid-bot-note,
  .tracklist-page .tlid-bot-note.utility-secondary-note {
    margin-top: 16px;
    font-size: 13px;
    line-height: 1.38;
  }

  .format-helper,
  .tlid-format-help {
    font-size: 13px;
    margin-top: 14px;
  }

  .site-footer {
    width: 100%;
    max-width: 100%;
    min-height: auto;
    padding: 18px 0 calc(22px + env(safe-area-inset-bottom));
    overflow-x: clip;
  }

  .site-footer-inner,
  .site-footer-links {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 18px;
  }

  .site-footer-inner {
    width: auto;
    max-width: none;
    margin: 0;
    justify-content: flex-start;
  }

  .site-footer-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 20px;
  }

  .site-footer-scroll::-webkit-scrollbar {
    display: none;
  }

  .site-footer-copy,
  .site-footer a,
  .site-footer-contact {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .site-footer-links {
    justify-content: flex-start;
  }

  .footer-icon {
    width: 28px;
    height: 28px;
  }

  .tlid-result-head {
    flex-direction: column;
    align-items: stretch;
  }

  .input-panel-collapsed {
    flex-wrap: wrap;
    border-radius: 20px;
  }

  .input-panel-collapsed-meta {
    width: 100%;
    white-space: normal;
  }
}
