/* The file converter (tools.aong.dev/convert): the drop zone, the file rows and the settings, on top of
   the shared look in /css/hub.css (panels, buttons, chips, theme colours). */

.convert .small { font-size: .92rem; color: var(--ink-dim); }
.convert [hidden] { display: none !important; }
.convert-box { display: grid; gap: 16px; padding: 22px; }

/* ---------- drop zone ---------- */
.drop {
  display: grid; justify-items: center; gap: 8px; padding: 34px 20px; border-radius: 14px; cursor: pointer; text-align: center;
  background: var(--panel-sub); box-shadow: inset 0 0 0 2px var(--line);
  outline: 3px dashed transparent; outline-offset: -10px;
  transition: background-color .2s, outline-color .2s, transform .2s;
}
.drop:hover, .drop:focus-within { outline-color: var(--line); }
.drop.is-over { outline-color: var(--leaf); background: color-mix(in srgb, var(--leaf) 18%, transparent); transform: scale(1.01); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { box-shadow: inset 0 0 0 2px var(--line), 0 0 0 3px var(--focus); }
.drop-icon svg { width: 56px; height: 56px; image-rendering: pixelated; shape-rendering: crispEdges; color: var(--ink); }
.drop-title { font: 600 1.4rem/1.1 var(--f-head); }
.drop-title u { text-decoration-color: var(--leaf); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.drop-sub { color: var(--ink-dim); font-size: .95rem; }
@media (prefers-reduced-motion: reduce) { .drop { transition: none; } .drop.is-over { transform: none; } }

/* ---------- batch bar ---------- */
.batch { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.batch[hidden] { display: none; }
.batch-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.btn:disabled, .btn:disabled:hover { opacity: .5; cursor: default; transform: none; filter: none; }
.select {
  padding: 8px 10px; border: 0; border-radius: 10px; max-width: 100%;
  font: 400 .98rem/1.1 var(--f-body); color: var(--ink);
  background: var(--panel-sub); box-shadow: inset 0 0 0 2px var(--line);
}
.select:hover { box-shadow: inset 0 0 0 2px var(--sky); }
select.select { padding-right: 8px; cursor: pointer; }
.select option, .select optgroup { color: var(--ink); background: var(--panel-solid); }
.engine { padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--sun) 16%, transparent); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--sun) 45%, transparent); }
.engine[hidden], .empty[hidden] { display: none; }
.empty { text-align: center; }

/* ---------- file rows ---------- */
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.file {
  --accent: var(--sky);
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; align-items: center; gap: 10px 14px;
  padding: 12px 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 22%, var(--panel-sub)); box-shadow: inset 0 0 0 2px var(--line);
  animation: row-in .25s ease-out;
}
@keyframes row-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .file { animation: none; } }
.kind-image { --accent: var(--leaf); }
.kind-video { --accent: var(--berry); }
.kind-audio { --accent: var(--sun); }
.kind-data, .kind-doc { --accent: var(--sky); }
.kind-archive, .kind-other { --accent: var(--ink-dim); }
.thumb {
  width: 56px; height: 56px; border-radius: 10px; object-fit: cover;
  background: repeating-conic-gradient(rgba(128, 128, 128, .25) 0 25%, transparent 0 50%) 0 0 / 12px 12px;
  box-shadow: inset 0 0 0 2px var(--line);
}
span.thumb {
  display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 22%, transparent);
  font: 400 .78rem/1 var(--f-label); text-transform: uppercase; letter-spacing: .04em; color: var(--ink);
}
.file-main { min-width: 0; display: grid; gap: 4px; }
.file-name { font: 600 1.05rem/1.2 var(--f-head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { display: flex; align-items: center; gap: 8px; color: var(--ink-dim); font-size: .9rem; }
.chip-kind { background: var(--accent); color: #12151c; box-shadow: none; }
.file-to { display: flex; align-items: center; gap: 8px; }
.file-to select { padding: 8px 10px; border: 0; border-radius: 10px; font: 600 .98rem/1.1 var(--f-head); color: var(--ink); background: var(--glass); box-shadow: inset 0 0 0 2px var(--line); cursor: pointer; width: 200px; }
.file-to select:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.file-to select option, .file-to select optgroup { color: var(--ink); background: var(--panel-solid); }
.file-act { display: flex; align-items: center; gap: 6px; }
.file-act .go { min-width: 92px; justify-content: center; }
.icon-x {
  width: 34px; height: 34px; border: 0; border-radius: 10px; cursor: pointer;
  font: 600 1.4rem/1 var(--f-head); color: var(--ink-dim); background: transparent;
}
.icon-x:hover { color: #fff; background: var(--berry-deep); }
.file-out { grid-column: 1 / -1; display: grid; gap: 6px; }
.file-out:empty { display: none; }
.file-out .btn { justify-self: start; }
.out-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; text-decoration: none;
  background: color-mix(in srgb, var(--leaf) 16%, transparent); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--leaf) 50%, transparent);
}
.out-link:hover { color: inherit; background: color-mix(in srgb, var(--leaf) 28%, transparent); }
.out-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.out-size { color: var(--ink-dim); font-size: .9rem; white-space: nowrap; }
.out-get { font: 400 .74rem/1 var(--f-label); letter-spacing: .06em; text-transform: uppercase; padding: 6px 9px 5px; border-radius: 999px; background: var(--leaf); color: #0f1a12; }
.err { padding: 9px 12px; border-radius: 10px; color: var(--ink); background: color-mix(in srgb, var(--berry) 18%, transparent); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--berry) 55%, transparent); overflow-wrap: anywhere; }

/* progress */
.meter { height: 10px; border-radius: 999px; overflow: hidden; background: var(--panel-sub); box-shadow: inset 0 0 0 2px var(--line); }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .25s; }
.meter.is-busy span { background: repeating-linear-gradient(90deg, var(--accent) 0 16px, transparent 16px 26px); animation: busy 1s linear infinite; }
@keyframes busy { to { background-position: 26px 0; } }
@media (prefers-reduced-motion: reduce) { .meter span { transition: none; } .meter.is-busy span { animation: none; } }

/* ---------- settings ---------- */
.settings-box summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; cursor: pointer; list-style: none; }
.settings-box summary::-webkit-details-marker { display: none; }
.settings-box summary::before { content: "\25B8"; font-size: 1.1rem; transition: transform .2s; }
.settings-box[open] summary::before { transform: rotate(90deg); }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 6px; }
.settings fieldset { display: grid; align-content: start; gap: 12px; margin: 0; padding: 14px 16px 16px; border: 0; border-radius: 12px; background: var(--panel-sub); box-shadow: inset 0 0 0 2px var(--line); min-width: 0; }
.settings legend { float: left; width: 100%; padding: 0; font: 400 .78rem/1.2 var(--f-label); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); }
.settings label { display: grid; gap: 6px; font-size: .95rem; }
.settings label.check { grid-template-columns: auto 1fr; align-items: start; gap: 8px; color: var(--ink-dim); }
.settings input[type="range"] { accent-color: var(--leaf); width: 100%; }
.settings input[type="checkbox"] { accent-color: var(--leaf); width: 18px; height: 18px; margin: 2px 0 0; }
.settings input[type="color"] { width: 64px; height: 34px; padding: 2px; border: 0; border-radius: 8px; background: var(--panel-sub); box-shadow: inset 0 0 0 2px var(--line); cursor: pointer; }
.settings output { font-weight: 600; color: var(--ink); }

/* ---------- phones ---------- */
@media (max-width: 640px) {
  .convert-box { padding: 16px; }
  .file { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .thumb { width: 48px; height: 48px; }
  .file-act { display: contents; }
  .file-act .remove { grid-column: 3; grid-row: 1; justify-self: end; }
  .file-act .go { grid-column: 3; grid-row: 2; }
  .file-to { grid-column: 1 / 3; grid-row: 2; }
  .file-to select { width: auto; flex: 1; min-width: 0; }
  .batch-btns { margin-left: 0; }
}
