* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.28);
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.10);
  --radius-xl: 28px;
  --radius-md: 18px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, .18), transparent 30%),
    radial-gradient(circle at top right, rgba(147, 51, 234, .14), transparent 28%),
    linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  padding: 28px 0 36px;
}

.topbar,
.control-card,
.preview-area,
.sidebar,
footer {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px;
  border-radius: 999px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #0f172a;
  color: white;
  font-weight: 900;
  letter-spacing: -.05em;
}

.studio-name {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
}

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

h1 {
  margin-bottom: 0;
  font-size: 18px;
}


.language-switcher {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
}

.lang-button {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 900;
}

.lang-button.active {
  color: white;
  background: var(--text);
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.ghost-button,
.copy-button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 800;
}

.primary-button {
  color: white;
  background: var(--primary);
}

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

.secondary-button,
.ghost-button,
.copy-button {
  color: var(--text);
  background: #eef2ff;
}

.ghost-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.hero-content {
  max-width: 820px;
  padding: 78px 6px 36px;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .18em;
}

.hero-content h2 {
  margin-bottom: 20px;
  font-size: clamp(42px, 8vw, 88px);
  line-height: .92;
  letter-spacing: -.07em;
}

.hero-content p {
  max-width: 680px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.6;
}

.control-card {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 22px;
  align-items: stretch;
  padding: 22px;
  border-radius: var(--radius-xl);
}

.search-wrapper label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

#search-input {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0 18px;
  outline: none;
  background: white;
  font-size: 16px;
}

#search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.upload-area {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 96px;
  border: 2px dashed rgba(37, 99, 235, .35);
  border-radius: 24px;
  padding: 18px;
  background: rgba(37, 99, 235, .06);
}

.upload-area.dragging {
  border-color: var(--primary);
  background: rgba(37, 99, 235, .12);
  transform: scale(1.01);
}

.upload-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: white;
  background: var(--primary);
  font-size: 26px;
  font-weight: 900;
}

.upload-area p,
.status-message {
  margin: 4px 0 0;
  color: var(--muted);
}

progress {
  display: none;
  grid-column: 1 / -1;
  width: 100%;
  height: 10px;
}

.status-message {
  grid-column: 1 / -1;
  min-height: 22px;
  font-size: 14px;
}

.content-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  margin-top: 24px;
}

.sidebar,
.preview-area {
  border-radius: var(--radius-xl);
  padding: 22px;
}

.sidebar {
  align-self: start;
}

.sidebar-header,
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

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

.folder-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 12px;
  background: white;
  text-align: left;
  font-weight: 800;
}

.folder-item:hover {
  background: #eef2ff;
}

.folder-item.active {
  color: var(--primary-dark);
  background: #dbeafe;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .20);
}

.folder-separator {
  margin: 12px 4px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  color: #1d4ed8;
  background: #dbeafe;
  font-size: 13px;
  font-weight: 900;
}

.icon-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 16px;
}

.icon-list:has(.media-banner),
.icon-list:has(.media-wide),
.icon-list:has(.media-gallery) {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.icon-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: white;
  transition: transform .18s ease, box-shadow .18s ease;
}

.icon-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, .10);
}

.icon-preview {
  width: 100%;
  height: 136px;
  border: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(45deg, #f1f5f9 25%, transparent 25%),
    linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f1f5f9 75%),
    linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}

.icon-preview img {
  width: 100%;
  height: 100%;
  max-width: 72px;
  max-height: 72px;
  object-fit: contain;
}

.media-icon .icon-preview {
  aspect-ratio: 1 / 1;
  height: auto;
}

.media-icon .icon-preview img {
  width: 72px;
  height: 72px;
  max-width: 72px;
  max-height: 72px;
  object-fit: contain;
}

.media-banner .icon-preview {
  aspect-ratio: 16 / 9;
  height: auto;
}

.media-banner .icon-preview img {
  max-width: none;
  max-height: none;
  object-fit: cover;
}

.media-wide .icon-preview,
.media-wide-detected .icon-preview {
  aspect-ratio: 16 / 10;
  height: auto;
}

.media-wide .icon-preview img,
.media-wide-detected .icon-preview img {
  max-width: none;
  max-height: none;
  object-fit: cover;
}

.media-gallery .icon-preview {
  aspect-ratio: 4 / 3;
  height: auto;
}

.media-gallery .icon-preview img {
  max-width: none;
  max-height: none;
  object-fit: contain;
}

.copy-button {
  width: 100%;
  padding: 10px 12px;
}

.empty-state {
  display: none;
  margin-top: 20px;
  padding: 50px;
  border: 1px dashed var(--line);
  border-radius: 24px;
  text-align: center;
  color: var(--muted);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 32px 0;
  padding: 22px;
  border-radius: 24px;
  color: var(--muted);
  font-size: 14px;
}

footer p {
  margin: 0;
}

@media (max-width: 840px) {
  .topbar,
  footer,
  .control-card {
    border-radius: 28px;
  }

  .topbar,
  footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .control-card,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero-content h2 {
    font-size: 52px;
  }

  .icon-list,
  .icon-list:has(.media-banner),
  .icon-list:has(.media-wide),
  .icon-list:has(.media-gallery) {
    grid-template-columns: 1fr;
  }
}
