:root {
  color-scheme: dark;
  --bg: #090e17;
  --panel: #111925;
  --panel-2: #172131;
  --line: #29364a;
  --text: #f4f7fb;
  --muted: #9caac0;
  --accent: #fb7a24;
  --accent-2: #ff9a45;
  --green: #45d483;
  --danger: #ff6b6b;
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 20% -10%, #1c2b40 0, transparent 33%), var(--bg); color: var(--text); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.app-header { min-height: 76px; padding: 14px clamp(18px, 4vw, 48px); border-bottom: 1px solid var(--line); background: rgba(9,14,23,.9); backdrop-filter: blur(18px); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 0 22px rgba(251,122,36,.2); }
.brand h1 { margin: 0; font-size: clamp(18px, 3vw, 24px); letter-spacing: -.03em; }
.brand h1 span { color: var(--accent-2); font-weight: 600; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.privacy-pill { color: var(--green); border: 1px solid rgba(69,212,131,.3); background: rgba(69,212,131,.08); padding: 8px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }

.workspace { width: min(1380px, calc(100% - 32px)); margin: 28px auto 64px; }
.drop-zone { min-height: 150px; border: 1px dashed #40516a; border-radius: var(--radius); background: rgba(17,25,37,.82); display: flex; align-items: center; justify-content: center; gap: 20px; padding: 28px; transition: .2s ease; }
.drop-zone.dragging { border-color: var(--accent); background: rgba(251,122,36,.08); transform: translateY(-2px); }
.drop-zone.compact { display: none; }
.drop-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(145deg, var(--accent), #e14619); font-size: 30px; box-shadow: 0 12px 30px rgba(251,122,36,.22); }
.drop-zone strong, .drop-zone span { display: block; }
.drop-zone strong { font-size: 18px; }
.drop-zone span { color: var(--muted); margin-top: 5px; }
.start-help {
  flex-basis: min(760px, 100%);
  margin-top: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(251,122,36,.18);
  border-radius: 14px;
  background: rgba(251,122,36,.06);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.start-help p { margin: 0; }
.start-help p + p { margin-top: 6px; }
.start-help strong { display: inline; color: var(--text); font-size: inherit; }
.start-help em { color: var(--accent-2); font-style: normal; font-weight: 800; }

.button { border: 1px solid transparent; border-radius: 10px; padding: 10px 15px; color: var(--text); background: var(--panel-2); font-weight: 700; transition: .18s ease; }
.button:hover { transform: translateY(-1px); filter: brightness(1.12); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.button.primary { background: linear-gradient(145deg, var(--accent-2), var(--accent)); color: #1b0c02; box-shadow: 0 8px 22px rgba(251,122,36,.18); }
.button.secondary { border-color: var(--line); }
.button.danger { color: #ffaaaa; border-color: rgba(255,107,107,.22); background: rgba(255,107,107,.08); }
.button.large { padding: 13px 20px; }
.text-button { border: 0; background: none; color: var(--accent-2); padding: 6px; }

.folder-view { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(17,25,37,.94); overflow: hidden; }
.folder-toolbar { padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); background: rgba(21,31,46,.9); }
.folder-toolbar h2 { margin: 3px 0 0; font-size: 22px; overflow-wrap: anywhere; }
.folder-toolbar p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.folder-actions, .save-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.song-list-wrap { overflow: auto; max-height: calc(100vh - 240px); }
.song-list { width: 100%; border-collapse: collapse; min-width: 820px; }
.song-list th, .song-list td { padding: 13px 14px; border-bottom: 1px solid rgba(41,54,74,.78); text-align: left; font-size: 13px; }
.song-list th { position: sticky; top: 0; z-index: 1; background: #0f1724; color: var(--accent-2); text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }
.song-list tbody tr { transition: .16s ease; cursor: pointer; }
.song-list tbody tr:hover, .song-list tbody tr.active { background: rgba(251,122,36,.11); }
.song-list td { color: #dce5f2; }
.song-list td span { color: var(--muted); }
.empty-list { text-align: center; color: var(--muted) !important; padding: 34px !important; cursor: default; }

.editor { margin-top: 0; }
.file-strip { padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.file-strip strong, .file-strip small { display: block; }
.file-strip strong { margin: 3px 0; overflow-wrap: anywhere; }
.file-strip small { color: var(--muted); }
.file-actions { display: flex; gap: 10px; flex: 0 0 auto; }
.eyebrow { color: var(--accent-2); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 800; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, .75fr); border: 1px solid var(--line); border-top: 0; }
.tag-panel, .cover-panel { padding: clamp(20px, 3vw, 34px); background: rgba(17,25,37,.94); }
.cover-panel { border-left: 1px solid var(--line); background: rgba(14,21,32,.96); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; gap: 12px; }
.section-heading h2 { margin: 3px 0 0; font-size: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.form-grid label { color: #dce5f2; font-size: 13px; font-weight: 700; }
.form-grid label.wide { grid-column: 1 / -1; }
input, textarea { display: block; width: 100%; margin-top: 7px; border: 1px solid #37465c; border-radius: 9px; padding: 11px 12px; background: #0b111b; color: var(--text); outline: none; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(251,122,36,.12); }
textarea { resize: vertical; min-height: 76px; }
.cover-preview { aspect-ratio: 1; max-height: 430px; width: 100%; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #080c13; }
.cover-preview img { width: 100%; height: 100%; object-fit: contain; }
.cover-empty { text-align: center; color: var(--muted); }
.cover-empty span { display: block; font-size: 50px; opacity: .5; }
.cover-meta { min-height: 22px; margin: 12px 0; color: var(--muted); font-size: 12px; }
.cover-actions { display: flex; gap: 10px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.55; }
audio { width: 100%; margin-top: 16px; height: 42px; }
.save-bar { padding: 18px 20px; background: #151f2e; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.save-bar strong, .save-bar span { display: block; }
.save-bar span { color: var(--muted); font-size: 12px; margin-top: 3px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); padding: 12px 18px; border-radius: 10px; background: #eff8f3; color: #11251a; font-weight: 700; opacity: 0; pointer-events: none; transition: .25s ease; box-shadow: 0 14px 40px rgba(0,0,0,.3); z-index: 10; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 850px) {
  .workspace { width: min(100% - 20px, 700px); margin-top: 14px; }
  .editor-grid { grid-template-columns: 1fr; }
  .cover-panel { border-left: 0; border-top: 1px solid var(--line); }
  .cover-preview { max-width: 480px; margin-inline: auto; }
  .drop-zone { flex-wrap: wrap; text-align: center; }
  .file-strip, .save-bar, .folder-toolbar { align-items: stretch; flex-direction: column; }
  .file-actions, .folder-actions, .save-actions, .save-bar .button { width: 100%; }
  .file-actions .button { flex: 1; }
  .folder-actions .button, .save-actions .button { flex: 1; }
}

@media (max-width: 560px) {
  .privacy-pill { display: none; }
  .app-header { padding-inline: 12px; }
  .brand img { width: 32px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid label:nth-last-child(2) { grid-column: 1 / -1; }
  .tag-panel, .cover-panel { padding: 20px 16px; }
  .section-heading { flex-direction: column; }
}
/* THOFI PWA Background 2026-07-02 */
html {
  background: #05000c;
}

body {
  position: relative !important;
  isolation: isolate !important;
  background-color: #05000c !important;
  background-image: none !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 50% 18%, rgba(123, 92, 255, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(5, 0, 12, 0.78), rgba(5, 0, 12, 0.9)),
    url("thofi-site-bg.jpg");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  opacity: 0.9;
}

body > * {
  position: relative;
  z-index: 1;
}
