:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5d6874;
  --line: #d8dee6;
  --panel: #ffffff;
  --surface: #f5f7fa;
  --surface-strong: #e8eef4;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --accent-soft: #d9f3ef;
  --warning: #986a13;
  --warning-soft: #fff3cf;
  --focus: #1a73e8;
  --shadow: 0 18px 45px rgba(29, 43, 58, 0.12);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1320px;
  margin: 0 auto 18px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: 1rem;
}

h3 {
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.privacy-note {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  padding: 9px 14px;
  font-size: 0.9rem;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 18px;
  max-width: 1320px;
  margin: 0 auto;
}

.settings-panel,
.main-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.settings-panel {
  align-self: start;
  border-radius: 8px;
}

.main-panel {
  min-width: 0;
  border-radius: 8px;
  padding: 18px;
}

.panel-section {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-section:last-child {
  border-bottom: 0;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.field:last-child {
  margin-bottom: 0;
}

select,
input[type="number"],
input[type="color"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}

input[type="color"] {
  padding: 4px;
}

input[type="range"] {
  accent-color: var(--accent);
}

select:focus,
input:focus,
button:focus,
.drop-zone:focus {
  outline: 3px solid rgba(26, 115, 232, 0.2);
  outline-offset: 2px;
  border-color: var(--focus);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.check-row input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.actions {
  display: grid;
  gap: 10px;
}

.primary-button,
.secondary-button,
.plain-button,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 800;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-dark);
}

.secondary-button,
.small-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.secondary-button:hover:not(:disabled),
.small-button:hover:not(:disabled) {
  background: var(--surface-strong);
}

.plain-button {
  min-height: 36px;
  background: transparent;
  color: var(--muted);
}

.button-icon {
  font-weight: 900;
  letter-spacing: 0;
}

.drop-zone {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 132px;
  border: 2px dashed #aeb9c6;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 20px;
}

.drop-zone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop-zone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-zone h2 {
  margin-bottom: 4px;
  font-size: 1.2rem;
}

.drop-zone p {
  margin: 0;
  color: var(--muted);
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 2rem;
  font-weight: 600;
}

.compact {
  min-width: 126px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 2px;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 700;
}

.preview-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 280px);
  gap: 18px;
  margin-bottom: 20px;
}

.preview-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #edf1f5 25%, transparent 25%),
    linear-gradient(-45deg, #edf1f5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #edf1f5 75%),
    linear-gradient(-45deg, transparent 75%, #edf1f5 75%);
  background-color: #fff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.preview-frame img {
  display: none;
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
}

.preview-frame.has-image img {
  display: block;
}

.preview-frame.has-image .empty-preview {
  display: none;
}

.empty-preview {
  display: grid;
  gap: 6px;
  color: var(--muted);
  text-align: center;
}

.empty-preview strong {
  color: var(--ink);
}

.result-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

dl,
dd {
  margin: 0;
}

.result-details dl {
  display: grid;
  gap: 13px;
}

.result-details div {
  display: grid;
  gap: 3px;
}

dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  font-size: 1.1rem;
  font-weight: 800;
}

.file-list-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 0;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.9rem;
}

.file-list {
  display: grid;
  gap: 10px;
}

.file-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) minmax(140px, auto);
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.thumb {
  width: 72px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-meta {
  min-width: 0;
}

.file-meta h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.progress-bar {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
}

.progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--accent);
  transition: width 160ms ease;
}

.file-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.badge {
  min-width: 82px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning);
  padding: 5px 9px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 900;
}

.badge.done {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.badge.error {
  background: #fce4e4;
  color: #a01818;
}

.small-button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.86rem;
}

@media (max-width: 980px) {
  .workspace,
  .preview-area {
    grid-template-columns: 1fr;
  }

  .settings-panel {
    order: 2;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .status-row,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .privacy-note {
    width: max-content;
  }

  .main-panel {
    padding: 12px;
  }

  .drop-zone {
    grid-template-columns: 1fr;
  }

  .drop-zone input {
    height: 100%;
  }

  .compact {
    width: 100%;
  }

  .file-item {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .thumb {
    width: 56px;
  }

  .file-actions {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    justify-items: stretch;
  }

  .badge {
    display: grid;
    place-items: center;
  }
}

.web-footer {max-width:1320px;margin:24px auto;color:var(--muted);font-size:.85rem;line-height:1.6}.eyebrow a,.web-footer a{color:var(--accent-dark)}
