:root {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #0f172a;
  background: #f8fafc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  padding: 1.2rem 1.5rem;
  background: linear-gradient(90deg, #1d4ed8, #0f172a);
  color: #fff;
}

.topbar h1 {
  margin: 0;
}

.topbar-title-link,
.topbar-title-link:visited,
.topbar-title-link:hover,
.topbar-title-link:active {
  color: #ffffff;
  text-decoration: none;
}

.version-tag {
  font-size: 0.7em;
  font-weight: 600;
  opacity: 0.9;
}

.layout {
  width: 100%;
  max-width: min(96vw, 1080px);
  margin: 1rem auto;
  padding: 0 0.5rem 1rem;
}

.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.subtle-text {
  color: #64748b;
  margin: 0.35rem 0;
}

.combination-links {
  margin-top: 0.8rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
  padding: 0.55rem 0.75rem;
  background: #f8fafc;
}

.combination-links summary {
  cursor: pointer;
  color: #1e293b;
  font-weight: 600;
}

.combination-links ul {
  margin: 0.7rem 0 0;
  padding-left: 1.1rem;
  columns: 2;
}

.combination-links a {
  color: #1d4ed8;
  text-decoration: none;
}

.combination-links a:hover {
  text-decoration: underline;
}

.controls {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.btn {
  border: 0;
  border-radius: 0.5rem;
  cursor: pointer;
  padding: 0.7rem 0.95rem;
  font-weight: 600;
  background: #2563eb;
  color: #fff;
}

.btn:hover {
  background: #1d4ed8;
}

.btn.secondary {
  background: #334155;
}

.btn.secondary:hover {
  background: #1e293b;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dropzone {
  margin-top: 0.9rem;
  border: 2px dashed #94a3b8;
  background: #f8fafc;
  border-radius: 0.65rem;
  padding: 1.2rem;
  text-align: center;
  color: #475569;
  cursor: pointer;
}

.dropzone.is-drag-over {
  border-color: #2563eb;
  background: #eff6ff;
}

.options-grid {
  margin-top: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  padding: 0.9rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.options-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: #334155;
  font-weight: 600;
}

.options-grid input,
.options-grid select {
  border: 1px solid #cbd5e1;
  border-radius: 0.45rem;
  padding: 0.55rem;
  font: inherit;
}

.checkbox-label {
  align-self: center;
  flex-direction: row !important;
  align-items: center;
}

.dimension-field.is-hidden {
  display: none;
}

.convert-action {
  margin-top: 1rem;
}

.status {
  margin: 0.9rem 0 0;
  min-height: 1.3rem;
  color: #1e40af;
  font-weight: 600;
}

.status.error {
  color: #b91c1c;
}

.error-list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  color: #b91c1c;
}

.selected-files {
  margin-top: 1rem;
}

.selected-files h3 {
  margin: 0;
  font-size: 1rem;
}

.selected-list {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.selected-item {
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  padding: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: #f8fafc;
}

.selected-thumb {
  width: 52px;
  height: 52px;
  border-radius: 0.45rem;
  object-fit: cover;
  border: 1px solid #cbd5e1;
  background: #ffffff;
}

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

.selected-name {
  margin: 0;
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
}

.selected-size {
  margin: 0.1rem 0 0;
  color: #64748b;
  font-size: 0.9rem;
}

.result-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.converted-files {
  margin-top: 1rem;
}

.converted-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.converted-header h3 {
  margin: 0;
  font-size: 1rem;
}

.result-item {
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  padding: 0.8rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.result-summary p {
  margin: 0.15rem 0;
  color: #334155;
}

.report-bug-hint {
  margin-top: 1rem;
}

.report-bug-hint a {
  color: #1d4ed8;
  font-weight: 600;
  text-decoration: none;
}

.report-bug-hint a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .card {
    padding: 1rem;
  }

  .btn {
    flex: 1 1 100%;
    text-align: center;
  }
}
