/* Free Luma tools (/luma/tools/…, /luma/en/tools/…). Builds on luma.css tokens. */

.tool-head { padding: 150px 0 34px; }
.tool-head h1 { max-width: 1000px; margin: 0; font-family: var(--font-display); font-size: clamp(38px, 4.8vw, 68px); font-weight: 500; line-height: .98; letter-spacing: -.045em; text-wrap: balance; }
.tool-head h1 > span { display: block; color: #5d7a6b; font-weight: 400; }
.tool-head .lead { max-width: 760px; }

/* ── Tag editor shell ── */
.te-section { padding-bottom: 40px; }
.te { position: relative; border: 1px solid var(--line); border-radius: 28px; background: var(--white); box-shadow: 0 30px 90px rgba(16, 60, 36, .08); }
.te.is-over::after { content: ''; position: absolute; inset: 8px; border: 2px dashed var(--green); border-radius: 22px; background: rgba(220, 243, 228, .45); pointer-events: none; }

.te-drop { display: flex; flex-direction: column; align-items: center; padding: 64px 24px 52px; text-align: center; }
.te-drop[hidden] { display: none; }
.te-drop > svg { width: 54px; height: 54px; margin-bottom: 18px; fill: none; stroke: var(--green); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.te-drop h2 { margin: 0; font-family: var(--font-display); font-size: clamp(24px, 2.6vw, 32px); font-weight: 500; letter-spacing: -.03em; line-height: 1.15; }
.te-drop > p { max-width: 560px; margin: 10px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 1.6; }
.te-drop-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.te-drop-actions label { cursor: pointer; }
.te-drop-actions label:focus-within { outline: 2px solid var(--green); outline-offset: 4px; }
.te-drop .checks { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; margin-top: 30px; color: var(--ink-soft); }
.te-drop .checks li { font-size: 14px; }
.te noscript p { margin: 0 0 40px; padding: 0 24px; color: #9a3412; text-align: center; }

.te-app { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; min-height: 620px; }
.te-app[hidden] { display: none; }

/* list */
.te-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.te-list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 16px 12px 18px; border-bottom: 1px solid var(--line); }
.te-check { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.te-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); }
.te-list-actions { display: flex; gap: 6px; }
.te-rows { flex: 1; max-height: 640px; margin: 0; padding: 6px; overflow-y: auto; list-style: none; }
.te-rows li { position: relative; display: grid; grid-template-columns: 18px 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; cursor: pointer; user-select: none; -webkit-user-select: none; }
.te-rows li:hover { background: var(--paper); }
.te-rows li[aria-selected="true"] { background: var(--green-pale); }
.te-box { width: 16px; height: 16px; border: 1.5px solid rgba(11, 30, 21, .3); border-radius: 5px; }
li[aria-selected="true"] .te-box { border-color: var(--green); background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/11px no-repeat; }
.te-thumb { width: 40px; height: 40px; overflow: hidden; border-radius: 8px; background: var(--paper-soft); }
.te-thumb img { width: 40px; height: 40px; object-fit: cover; }
.te-ph { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #e4ece7, #d3e0d8); }
.te-row-main { min-width: 0; }
.te-row-main b, .te-row-main small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.te-row-main b { font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.te-row-main small { margin-top: 2px; color: var(--ink-faint); font-size: 12.5px; }
.te-row-main small span + span::before { content: ', '; }
.te-row-main .te-err { color: #9a3412; }
.te-fmt { color: var(--ink-faint); font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.te-dot { position: absolute; top: 9px; left: 54px; width: 9px; height: 9px; border: 2px solid var(--white); border-radius: 50%; background: #e08a00; }
.te-x { position: absolute; right: 6px; top: 50%; width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--white); color: var(--ink-faint); font-size: 18px; line-height: 1; opacity: 0; transform: translateY(-50%); cursor: pointer; }
.te-rows li:hover .te-x, .te-x:focus-visible { opacity: 1; }
.te-x:hover { color: var(--ink); background: var(--paper-soft); }
li.is-loading { opacity: .55; }
li.is-error { cursor: default; }

/* editor */
.te-edit { min-width: 0; padding: 22px 26px 18px; }
.te-empty { margin: 40px 0; color: var(--ink-faint); text-align: center; }
.te-file { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 18px; }
.te-file b { min-width: 0; overflow-wrap: anywhere; font-size: 15px; }
.te-file span { color: var(--ink-faint); font-size: 13px; }
.te-multi { margin: 0 0 18px; padding: 12px 14px; border-radius: 12px; background: var(--green-pale); color: var(--ink); font-size: 14px; line-height: 1.5; }
.te-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 26px; align-items: start; }
.te-cover { display: flex; flex-direction: column; gap: 8px; border-radius: 16px; }
.te-art { display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink-faint); font-size: 13px; text-align: center; }
.te-art img { width: 100%; height: 100%; object-fit: cover; }
.te-art span { padding: 16px; }
.te-cover small { color: var(--ink-faint); font-size: 12px; line-height: 1.4; }
.te-cover-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.te.is-over .te-cover .te-art { border-color: var(--green); }

.te-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.te-fields .w2 { grid-column: span 2; }
.te-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.te-field > span, .te-field > label, .te-lyrics summary { color: var(--ink-soft); font-size: 12.5px; font-weight: 600; }
.te-field input, .te-field textarea, .te-lyrics textarea { width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid rgba(11, 30, 21, .16); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: 14.5px; line-height: 1.4; transition: border-color 150ms ease, box-shadow 150ms ease; }
.te-field textarea, .te-lyrics textarea { resize: vertical; }
.te-field input:focus, .te-field textarea:focus, .te-lyrics textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(11, 122, 58, .14); }
.te-field input::placeholder, .te-field textarea::placeholder { color: #9a6a00; font-style: italic; }
.te-pair > div { display: flex; align-items: center; gap: 8px; }
.te-pair > div input { flex: 1; }
.te-pair > div span { color: var(--ink-faint); font-size: 13px; }
.te-lyrics summary { cursor: pointer; padding: 4px 0; }
.te-lyrics textarea { margin-top: 6px; }

.te-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.te-mini { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid rgba(11, 30, 21, .14); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background 150ms ease, border-color 150ms ease; }
.te-mini:hover { border-color: rgba(11, 30, 21, .3); background: var(--paper); }
label.te-mini:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }

/* bottom bar */
.te-bar { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 16px 18px 16px 22px; border-top: 1px solid var(--line); border-radius: 0 0 28px 28px; background: rgba(243, 246, 244, .7); }
.te-status { margin: 0; color: var(--ink-soft); font-size: 14px; }
.te-dl { display: flex; flex-wrap: wrap; gap: 10px; }
.te-dl .button { min-height: 46px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; }
.te-dl .button:disabled { opacity: .5; cursor: progress; transform: none; }

/* ── content below the tool ── */
.tool-content .ftiles { margin-top: 50px; }
.tool-content h2.big { max-width: 900px; }
.tool-content .intro { max-width: 760px; margin: 22px 0 0; color: var(--ink-soft); font-size: 16.5px; line-height: 1.75; }
.tag-table { margin-top: 44px; }
.tag-table td:first-child { color: var(--ink); font-weight: 600; white-space: nowrap; }
.tag-table code, .tool-content code { padding: 1px 5px; border-radius: 5px; background: var(--paper-soft); color: var(--ink); font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .86em; white-space: nowrap; }
.tips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 50px; }
.tips article { padding: 28px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255, 255, 255, .62); }
.tips h3 { margin: 0 0 8px; font-size: 22px; line-height: 1.15; }
.tips p { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.7; }
.tips p + p { margin-top: 10px; }
.tips a, .tool-content .intro a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 1080px) {
  .te-app { grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); }
  .te-grid { grid-template-columns: 1fr; }
  .te-cover { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .te-art { width: 140px; }
  .te-cover small { flex: 1 1 140px; }
  .te-cover-actions { flex-basis: 100%; }
}
@media (max-width: 860px) {
  .te-app { grid-template-columns: 1fr; grid-template-rows: auto; }
  .te-list { border-right: 0; border-bottom: 1px solid var(--line); }
  .te-rows { max-height: 300px; }
  .te-x { opacity: 1; position: static; transform: none; }
  .te-rows li { grid-template-columns: 18px 40px minmax(0, 1fr) auto auto; }
  .tips { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .tool-head { padding-top: 118px; }
  .te { border-radius: 22px; }
  .te-drop { padding: 44px 18px 36px; }
  .te-edit { padding: 18px 16px; }
  .te-fields { grid-template-columns: 1fr; }
  .te-fields .w2 { grid-column: auto; }
  .te-bar { border-radius: 0 0 22px 22px; padding: 14px 16px; }
  .te-dl, .te-dl .button { width: 100%; justify-content: center; }
  .tag-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tag-table tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .tag-table td { display: block; padding: 2px 0; border: 0; white-space: normal; }
  .tag-table td:first-child { padding-bottom: 6px; }
  .tag-table td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-faint); font-weight: 600; }
}
