/* MoxuImage — product styles. Colour, type and geometry come from
   ../shared/moxu-tokens.css; only layout and components live here. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
code { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

/* --- top bar -------------------------------------------------------------- */

.bar {
  height: var(--bar-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand__mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line-bright);
  display: grid; place-items: center; color: var(--accent);
}
.brand__mark svg { width: 16px; height: 16px; }
.brand__name { font-size: 14px; font-weight: 600; letter-spacing: -0.015em; }
.brand__name em { font-style: normal; color: var(--accent); }
.brand__sub { font-size: 11px; color: var(--text-faint); }
.privacy-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text-dim);
  font-size: 11.5px; font-weight: 600;
}
.privacy-pill svg { width: 13px; height: 13px; color: var(--ok); }

/* --- layout --------------------------------------------------------------- */

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.panel__head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-weight: 600;
}
.panel__body { padding: 16px; display: flex; flex-direction: column; gap: 18px; }

/* --- form controls -------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 7px; }
.field__label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-dim);
}
.field__hint {
  font-size: 11.5px; font-weight: 400; letter-spacing: 0;
  text-transform: none; color: var(--text-faint);
}
.field__label .field__hint { font-size: 11px; }
output { font-family: var(--font-mono); color: var(--text); letter-spacing: 0; }

.input, .select {
  width: 100%; height: 38px; padding: 0 11px;
  background: var(--bg-deep); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-md);
  font: inherit;
}
.input::placeholder { color: var(--text-faint); }
.input:hover, .select:hover { border-color: var(--line-bright); }
.input:focus, .select:focus { outline: none; border-color: var(--accent); }
.select { appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a1ac' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 16px; }

.row { display: flex; align-items: center; gap: 8px; }
.times { color: var(--text-faint); }
.unit { position: relative; flex: 1; min-width: 0; }
.unit .input { padding-right: 28px; }
.unit i {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-style: normal; font-size: 11px; color: var(--text-faint); pointer-events: none;
}

.check { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 12.5px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.range { width: 100%; accent-color: var(--accent); }
.range:disabled { opacity: 0.4; }

.note {
  display: flex; gap: 9px; margin: 0; padding: 11px 12px;
  border: 1px solid var(--line-soft); border-radius: var(--r-md);
  background: var(--bg-deep); color: var(--text-dim); font-size: 12px;
}
.note svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--ok); margin-top: 1px; }

/* --- buttons -------------------------------------------------------------- */

.btn {
  height: 36px; padding: 0 16px; border-radius: var(--r-md);
  border: 1px solid transparent; font-weight: 600; font-size: 13px;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), opacity 0.15s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent-deep); color: #04121e; }
.btn--primary:hover:not(:disabled) { background: var(--accent-bright); }
.btn--ghost { color: var(--text-dim); border-color: var(--line); }
.btn--ghost:hover:not(:disabled) { color: var(--text); border-color: var(--line-bright); background: var(--surface); }

/* --- drop zone ------------------------------------------------------------ */

.work { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; padding: 56px 24px;
  border: 1.5px dashed var(--line-bright); border-radius: var(--r-xl);
  background: var(--bg-deep); cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-wash); }
.drop__icon {
  width: 48px; height: 48px; margin-bottom: 8px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line-bright);
  display: grid; place-items: center; color: var(--accent);
}
.drop__icon svg { width: 22px; height: 22px; }
.drop__title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.drop__sub { color: var(--text-dim); font-size: 13px; }
.link { color: var(--accent-bright); text-decoration: underline; text-underline-offset: 3px; }
.work.has-files .drop { padding: 18px 24px; flex-direction: row; gap: 12px; }
.work.has-files .drop__icon { width: 34px; height: 34px; margin: 0; }
.work.has-files .drop__icon svg { width: 17px; height: 17px; }
.work.has-files .drop__title { font-size: 14px; }

/* --- results -------------------------------------------------------------- */

.results { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.results__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line-soft);
}
.summary { color: var(--text-dim); font-size: 13px; }
.summary strong { color: var(--text); font-weight: 600; }
.summary .saved { color: var(--ok); font-weight: 600; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.progress { height: 3px; background: var(--line-soft); }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.15s linear; }

.list { list-style: none; margin: 0; padding: 0; }
.item {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft);
}
.item:last-child { border-bottom: 0; }
.thumb {
  width: 48px; height: 48px; border-radius: var(--r-sm); overflow: hidden;
  background: var(--bg-deep); border: 1px solid var(--line-soft);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb img[hidden] { display: none; }
.item__main { min-width: 0; }
.item__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item__meta { color: var(--text-faint); font-size: 12px; font-family: var(--font-mono); }
.item__meta .arrow { color: var(--text-faint); margin: 0 4px; }
.item__meta .good { color: var(--ok); }
.item__meta .warn { color: var(--text); }
.item__error { color: var(--danger); font-size: 12.5px; margin-top: 2px; }
.item__error b { display: block; font-weight: 600; }
.item__error span { color: var(--text-dim); }
.item__side { display: flex; align-items: center; gap: 8px; }
.tag { font-size: 11px; font-weight: 600; color: var(--text-faint); }
.tag--done { color: var(--ok); }
.icon-btn {
  width: 30px; height: 30px; border-radius: var(--r-sm); display: grid; place-items: center;
  color: var(--text-faint); border: 1px solid transparent; text-decoration: none;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-bright); background: var(--surface-2); }
.icon-btn svg { width: 15px; height: 15px; }

.footnote { color: var(--text-faint); font-size: 12px; margin: 0; max-width: 70ch; }

/* --- small screens -------------------------------------------------------- */

@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; padding: 14px; }
  .work { order: -1; }
  .drop { padding: 36px 16px; }
  .bar .brand__sub { display: none; }
}
