* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: #f5f5f5;
  color: #1a1a1a;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 48px 24px;
}

.panel {
  width: min(960px, 100%);
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 36px;
}

h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.subtitle {
  color: #666;
  font-size: 14px;
  margin-bottom: 28px;
}

.stack { display: grid; gap: 6px; }

.row { display: flex; gap: 10px; }

label {
  font-size: 12px;
  font-weight: 500;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input, select, button {
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  background: #fafafa;
  color: #1a1a1a;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.4;
  transition: border-color 0.15s, background-color 0.15s;
}

input { flex: 1; }

input:focus, select:focus {
  border-color: #1a1a1a;
  outline: none;
  background: #ffffff;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

input::placeholder { color: #aaa; }

button {
  cursor: pointer;
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #ffffff;
  font-weight: 500;
  white-space: nowrap;
  padding: 10px 20px;
}

button:hover:not(:disabled) { background: #333; border-color: #333; }
button:disabled { opacity: 0.35; cursor: not-allowed; }

#download-btn {
  margin-top: 8px;
  width: 100%;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.status {
  min-height: 20px;
  color: #666;
  font-size: 12px;
  margin-top: 10px;
}

.status.error { color: #d32f2f; }

.results {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.preview-card, .controls {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 20px;
}

.preview-card h2, .controls h2 {
  font-size: 12px;
  font-weight: 500;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.preview-box {
  min-height: 200px;
  display: grid;
  place-items: center;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  margin-bottom: 16px;
  padding: 24px;
}

.preview-box img {
  max-width: 128px;
  max-height: 128px;
  width: 128px;
  height: 128px;
  object-fit: contain;
  image-rendering: auto;
}

.meta {
  display: grid;
  gap: 6px;
  font-size: 13px;
  word-break: break-all;
  color: #666;
}

.meta strong {
  color: #1a1a1a;
  font-weight: 500;
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1px;
}

.icon-list {
  display: grid;
  gap: 1px;
  margin-bottom: 16px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #e0e0e0;
}

.icon-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 12px;
  align-items: center;
  text-align: left;
  background: #ffffff;
  border: none;
  border-left: 2px solid transparent;
  padding: 10px 14px;
  font-size: 13px;
  color: #1a1a1a;
  font-weight: 400;
  cursor: pointer;
  border-radius: 0;
  margin: 0;
  width: 100%;
}

.icon-item:hover { background: #f5f5f5; }

.icon-item.active {
  border-left-color: #1a1a1a;
  background: #f5f5f5;
}

.icon-item img {
  grid-row: 1 / span 2;
  width: 36px;
  height: 36px;
  object-fit: contain;
  background: #fafafa;
  border-radius: 3px;
  padding: 2px;
  border: 1px solid #e0e0e0;
}

.icon-item small { color: #999; font-size: 11px; }

.hidden { display: none; }

@media (max-width: 768px) {
  .app { padding: 24px 16px; }
  .panel { padding: 24px; }
  .results { grid-template-columns: 1fr; }
  .row { flex-direction: column; }
}
