/* TRW Free Music Style Generator. Every selector is scoped to .trw-msg. */
.trw-msg {
	--m-ink: #17302a; --m-muted: #50655e; --m-green: #0b7a52; --m-green-deep: #075a3c; --m-gold: #f2b52c;
	--m-wash: #edf5f0; --m-line: #cddcd4;
	--m-font: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
	font-family: var(--m-font); color: var(--m-ink); font-size: 16px; line-height: 1.5; max-width: 860px; margin: 0 auto 2.5em; text-align: left;
}
.trw-msg *, .trw-msg *::before, .trw-msg *::after { box-sizing: border-box; }
.trw-msg [hidden] { display: none !important; }
.trw-msg p { margin: 0; }
.trw-msg .trw-msg-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.trw-msg .trw-msg-title { font-family: var(--m-font); font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); line-height: 1.12; font-weight: 800; letter-spacing: -0.02em; color: var(--m-ink); margin: 0 0 6px; padding: 0; }
.trw-msg .trw-msg-lede { color: var(--m-muted); font-size: 1.05rem; margin-bottom: 12px; }
.trw-msg .trw-msg-privacy { display: inline-block; background: var(--m-wash); color: var(--m-green-deep); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 0.9rem; line-height: 1.35; }
.trw-msg .trw-msg-card { background: #fff; border: 1px solid var(--m-line); border-radius: 18px; padding: 16px; margin-top: 14px; }
@media (min-width: 700px) { .trw-msg .trw-msg-card { padding: 20px 24px; } }
.trw-msg .trw-msg-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--m-font); font-size: 1.12rem; font-weight: 800; color: var(--m-ink); margin: 20px 0 10px; padding: 0; }
.trw-msg .trw-msg-card > .trw-msg-h:first-child { margin-top: 0; }
.trw-msg .trw-msg-h span { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--m-green); color: #fff; font-size: 0.9rem; }
.trw-msg .trw-msg-bpm { font-size: 0.95rem; font-weight: 700; color: var(--m-green-deep); background: var(--m-wash); padding: 2px 10px; border-radius: 999px; }
.trw-msg .trw-msg-group { font-weight: 800; font-size: 0.82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--m-muted); margin: 6px 0 6px; }
.trw-msg .trw-msg-styles { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin-bottom: 8px; }
.trw-msg .trw-msg-style, .trw-msg .trw-msg-chip { position: relative; margin: 0; cursor: pointer; }
.trw-msg .trw-msg-style input, .trw-msg .trw-msg-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.trw-msg .trw-msg-style span { display: flex; flex-direction: column; gap: 2px; min-height: 64px; height: 100%; padding: 10px 12px; border: 2px solid var(--m-line); border-radius: 14px; background: #fff; }
.trw-msg .trw-msg-style small { color: var(--m-muted); font-size: 0.8rem; line-height: 1.3; }
.trw-msg .trw-msg-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.trw-msg .trw-msg-chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 2px solid var(--m-line); border-radius: 999px; background: #fff; font-weight: 700; font-size: 0.92rem; }
.trw-msg .trw-msg-style input:checked + span, .trw-msg .trw-msg-chip input:checked + span { border-color: var(--m-green); background: var(--m-wash); color: var(--m-green-deep); }
.trw-msg .trw-msg-style input:focus-visible + span, .trw-msg .trw-msg-chip input:focus-visible + span { outline: 3px solid var(--m-gold); outline-offset: 2px; }
.trw-msg .trw-msg-chip.is-off { cursor: not-allowed; }
.trw-msg .trw-msg-chip.is-off span { opacity: .4; text-decoration: line-through; }
.trw-msg .trw-msg-bpm-in { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; margin: 0; }
.trw-msg .trw-msg-bpm-in input { width: 84px; min-height: 44px; padding: 6px 10px; border: 2px solid var(--m-line); border-radius: 12px; font: inherit; font-size: 16px; }
.trw-msg .trw-msg-btn, .trw-msg button.trw-msg-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; margin: 0; width: auto;
	border: 2px solid transparent; border-radius: 12px; font-family: var(--m-font); font-size: 1rem; font-weight: 700; line-height: 1.2;
	text-transform: none; letter-spacing: 0; text-decoration: none; text-shadow: none; box-shadow: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.trw-msg button.trw-msg-btn--primary { background: var(--m-green); color: #fff; }
.trw-msg button.trw-msg-btn--primary:hover { background: var(--m-green-deep); color: #fff; }
.trw-msg button.trw-msg-btn--secondary { background: #fff; color: var(--m-green-deep); border-color: var(--m-green); }
.trw-msg button.trw-msg-btn--ghost { background: transparent; color: var(--m-muted); border-color: var(--m-line); }
.trw-msg button.trw-msg-btn--wide { width: 100%; min-height: 58px; font-size: 1.12rem; margin-top: 22px; }
.trw-msg button.trw-msg-btn:disabled { opacity: .45; cursor: not-allowed; }
.trw-msg button:focus-visible, .trw-msg input:focus-visible { outline: 3px solid var(--m-gold); outline-offset: 2px; }
.trw-msg .trw-msg-help { color: var(--m-muted); font-size: 0.88rem; margin-top: 8px; }
.trw-msg .trw-msg-msg { margin-top: 10px; font-size: 0.95rem; }
.trw-msg .trw-msg-msg:empty { display: none; }
.trw-msg .trw-msg-msg.is-error { background: #fde8e6; color: #7a1712; padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.trw-msg .trw-msg-msg.is-ok, .trw-msg .trw-msg-msg.is-info { color: var(--m-green-deep); font-weight: 600; }
.trw-msg .trw-msg-progress { margin-top: 14px; }
.trw-msg .trw-msg-progress progress { display: block; width: 100%; height: 12px; border: 0; border-radius: 999px; overflow: hidden; background: #e2ebe6; accent-color: var(--m-green); -webkit-appearance: none; appearance: none; }
.trw-msg .trw-msg-progress progress::-webkit-progress-bar { background: #e2ebe6; }
.trw-msg .trw-msg-progress progress::-webkit-progress-value { background: var(--m-green); }
.trw-msg .trw-msg-progress p { margin: 8px 0; }
.trw-msg .trw-msg-facts { font-weight: 700; color: var(--m-green-deep); margin-bottom: 12px; }
.trw-msg .trw-msg-player { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--m-wash); }
.trw-msg button.trw-msg-round { width: 52px; height: 52px; min-height: 52px; padding: 0; margin: 0; border: 0; border-radius: 50%; background: var(--m-green); color: #fff; font-size: 1.15rem; cursor: pointer; flex: none; box-shadow: none; }
.trw-msg button.trw-msg-round--light { background: #fff; color: var(--m-green-deep); border: 2px solid var(--m-line); width: 44px; height: 44px; min-height: 44px; }
.trw-msg .trw-msg-player input[type="range"] { flex: 1; min-width: 60px; height: 36px; margin: 0; accent-color: var(--m-green); }
.trw-msg .trw-msg-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.9rem; flex: none; }
.trw-msg .trw-msg-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.trw-msg .trw-msg-row > * { flex: 1 1 180px; }
.trw-msg .trw-msg-result [data-role="clear"] { margin-top: 12px; }

/* v0.2: reference music */
.trw-msg .trw-msg-ref { margin-top: 14px; padding: 14px; border-radius: 14px; background: #f7fbf9; border: 1px solid var(--m-line); }
.trw-msg .trw-msg-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.trw-msg button.trw-msg-btn--wide2 { width: 100%; }
.trw-msg dl.trw-msg-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin: 12px 0; font-size: 0.95rem; }
.trw-msg dl.trw-msg-dl dt { font-weight: 700; color: var(--m-muted); }
.trw-msg dl.trw-msg-dl dd { margin: 0; overflow-wrap: anywhere; }
.trw-msg audio.trw-msg-refplayer { display: block; width: 100%; margin: 4px 0 6px; }
.trw-msg .trw-msg-analysis { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--m-line); }
.trw-msg .trw-msg-h4 { font-family: var(--m-font); font-size: 1rem; font-weight: 800; margin: 0; padding: 0; color: var(--m-ink); }
.trw-msg .trw-msg-tempo-pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.trw-msg .trw-msg-suggest { font-weight: 700; color: var(--m-green-deep); background: var(--m-wash); padding: 10px 12px; border-radius: 10px; margin-bottom: 10px; }
.trw-msg button.trw-msg-link { background: none; border: 0; padding: 4px; margin: 0 0 0 8px; min-height: 0; color: var(--m-green-deep); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; box-shadow: none; text-transform: none; }
.trw-msg .trw-msg-msg.is-warn { background: #fff5d9; color: #5a4300; padding: 10px 14px; border-radius: 10px; }

/* v0.3 reference-influence + format selection; responsive on phones and tablets */
.trw-msg .trw-msg-influence { padding: 12px 14px; margin: 18px 0 6px; border-radius: 12px; background: var(--m-wash); }
.trw-msg .trw-msg-influence label { display:flex; justify-content:space-between; gap: 12px; align-items:center; color:var(--m-green-deep); }
.trw-msg .trw-msg-influence input { display:block; width:100%; margin:12px 0 6px; accent-color: var(--m-green); }
.trw-msg .trw-msg-download-format { display:flex; flex-direction:column; gap:6px; margin: 12px 0; }
.trw-msg .trw-msg-download-format select { width:100%; padding:12px 14px; min-height:48px; border:2px solid var(--m-line); border-radius:12px; background:#fff; font:inherit; color:var(--m-ink); }
@media (max-width:480px) { .trw-msg .trw-msg-download-format select { font-size:15px; } }

/* v0.5 non-destructive producer; touch-friendly in Android Chrome. */
.trw-msg .trw-msg-producer { border: 1px solid var(--m-line); border-radius: 15px; padding: 14px; margin: 16px 0; background: #f7fbf9; }
.trw-msg .trw-msg-producer-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.trw-msg .trw-msg-producer-title h4 { margin: 0; color: var(--m-green-deep); font-size: 1.15rem; }
.trw-msg .trw-msg-producer-title span { color: var(--m-muted); font-size: .86rem; }
.trw-msg .trw-msg-producer-track { background: white; border: 1px solid var(--m-line); border-radius: 12px; padding: 10px; margin: 10px 0; }
.trw-msg .trw-msg-producer-track.is-muted { opacity: .74; }
.trw-msg .trw-msg-producer-trackhead { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.trw-msg .trw-msg-producer-trackhead b { font-size: .98rem; }
.trw-msg .trw-msg-producer-track-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.trw-msg button.trw-msg-tiny { border: 1px solid var(--m-line); border-radius: 8px; min-height: 42px; padding: 6px 12px; background: #fff; color: var(--m-green-deep); font: inherit; font-weight: 700; cursor: pointer; }
.trw-msg button.trw-msg-tiny.is-active { color: #fff; background: var(--m-green); border-color: var(--m-green); }
.trw-msg .trw-msg-producer-row { display: grid; grid-template-columns: 1fr minmax(100px,1fr); gap: 8px 14px; align-items: center; margin-top: 10px; }
.trw-msg .trw-msg-producer-row label { font-size: .86rem; font-weight: 700; }
.trw-msg .trw-msg-producer-row input[type="range"] { width: 100%; accent-color: var(--m-green); }
.trw-msg .trw-msg-producer-row select { min-width: 0; width: 100%; background:#fff; border:1px solid var(--m-line); min-height: 44px; border-radius: 9px; color: var(--m-ink); font:inherit; font-size:16px; padding: 6px; }
@media (max-width:520px) { .trw-msg .trw-msg-producer-row { grid-template-columns: 90px 1fr; } .trw-msg .trw-msg-producer { padding:10px; } }

/* v0.6 instrument studio additions */
.trw-msg .trw-msg-sound-hint{margin:4px 0 8px;color:var(--m-muted);font-size:.8rem;line-height:1.4}
.trw-msg .trw-msg-tone-advice{margin:12px 0 16px;padding:12px 14px;border-radius:12px;background:var(--m-wash);border:1px solid var(--m-line)}
.trw-msg .trw-msg-tone-advice h5{margin:0;font-size:1rem;font-weight:800;color:var(--m-green-deep)}
.trw-msg .trw-msg-tone-advice [data-role="producer-suggestion-desc"]{overflow-wrap:anywhere;line-height:1.5}
.trw-msg .trw-msg-tone-advice button{max-width:100%;white-space:normal}
/* v0.7: accessible and non-destructive Reference Match Assistant */
.trw-msg .trw-msg-match{border:1px solid var(--m-line);background:#fff;border-radius:12px;padding:14px;margin:15px 0}
.trw-msg .trw-msg-match h5{margin:0 0 6px;font-weight:800;color:var(--m-green-deep);font-size:1rem}
.trw-msg .trw-msg-match h5 small{font-size:.72rem;font-weight:600;color:var(--m-muted)}
.trw-msg .trw-msg-match h6{font-size:.95rem;margin:18px 0 8px;color:var(--m-green-deep)}
.trw-msg .trw-msg-match .trw-msg-match-measures{display:grid;gap:7px;margin:12px 0}
.trw-msg .trw-msg-match-metric{display:grid;grid-template-columns: minmax(110px,1fr) minmax(100px,1fr);gap:8px;align-items:center;border-bottom:1px solid var(--m-line);padding:6px 0;font-size:.86rem}
.trw-msg .trw-msg-match-metric b{font-size:.89rem}
.trw-msg .trw-msg-match-metric span{color:var(--m-muted);overflow-wrap:anywhere}
.trw-msg .trw-msg-match-choice{display:flex;align-items:flex-start;gap:12px;padding:10px;background:var(--m-wash);border:1px solid var(--m-line);border-radius:10px;margin-bottom:8px;font-size:.91rem;line-height:1.45;cursor:pointer}
.trw-msg .trw-msg-match-choice input{flex:none;width:21px;height:21px;accent-color:var(--m-green);margin:2px 0 0}
.trw-msg .trw-msg-match-choice span{display:block;color:var(--m-muted);font-size:.83rem;margin-top:2px}
.trw-msg .trw-msg-match [data-role="match-run"]{width:100%;white-space:normal}

/* v0.8 automatic matching controls */
.trw-msg .trw-msg-auto-check { display:flex; align-items:flex-start; gap:10px; padding:12px 0; font-weight:650; line-height:1.45; }
.trw-msg .trw-msg-auto-check input { margin-top:4px; flex-shrink:0; width:18px; height:18px; }
.trw-msg [data-role="auto-panel"] { margin-block:18px; }
.trw-msg [data-role="auto-panel"] { margin-block:18px; }

/* v0.11 Closest Match report */
.trw-msg-closest{margin:12px 0;padding:12px 14px;border:1px solid #cfe3d4;border-radius:10px;background:#f4fbf6}
.trw-msg-closest-list{list-style:none;margin:6px 0 4px;padding:0}
.trw-msg-closest-list li{margin:3px 0;font-size:14px;line-height:1.45}
.trw-msg-closest-list li.is-ok b{color:#17713a}
.trw-msg-closest-list li.is-off b{color:#7a5a00}

/* v0.12 simpler layout */
.trw-msg details.trw-msg-more,.trw-msg details.trw-msg-advanced,.trw-msg details.trw-msg-finetune{margin:14px 0;border:1px solid #d9e6dc;border-radius:12px;background:#fbfdfb}
.trw-msg details>summary{cursor:pointer;padding:12px 16px;font-weight:700;color:#0f6e45;list-style:none}
.trw-msg details>summary::-webkit-details-marker{display:none}
.trw-msg details>summary::before{content:"\25B8";display:inline-block;margin-right:8px;transition:transform .15s}
.trw-msg details[open]>summary::before{transform:rotate(90deg)}
.trw-msg details[open]>summary{border-bottom:1px solid #e3ece5}
.trw-msg details>*:not(summary){margin-left:16px;margin-right:16px}
.trw-msg details.trw-msg-advanced>.trw-msg-producer{margin:12px}
.trw-msg-closest-list li.is-part b{color:#8a5a00}
.trw-msg-closest-list li em{font-style:normal;color:#555;font-size:13px}

/* v0.13 song recipes */
.trw-msg .trw-msg-recipe textarea{width:100%;box-sizing:border-box;min-height:200px;padding:12px;border:1px solid #cfdcd2;border-radius:10px;font:14px/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;background:#fff;color:#1d2b22}
.trw-msg .trw-msg-recipe code{background:#eef4ef;padding:1px 5px;border-radius:4px}
.trw-msg .trw-msg-styles:has(> label:nth-child(3)){grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
