/* Colors and window chrome follow app/src/styles.css. */
:root {
  --text: #f1eeee;
  --muted: #8d878b;
  --border: rgba(255, 255, 255, 0.11);
  --font:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html {
  background: #181818;
}
body {
  margin: 0;
  overflow-x: clip;
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration-color: #5a5a5a;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-color: currentColor;
}

/* Header */
.app-icon {
  flex: none;
}
/* Window */
.window {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 16px 40px rgba(0, 0, 0, 0.4);
  user-select: none;
}
.app-shell {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #202020;
  font-size: 13px;
  line-height: normal;
}
.lights {
  position: absolute;
  z-index: 25;
  top: 16px;
  left: 18px;
  display: flex;
  gap: 8px;
}
.lights i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.2);
}
.lights i:nth-child(2) {
  background: #febc2e;
}
.lights i:nth-child(3) {
  background: #28c840;
}
.glass {
  background: rgba(32, 32, 32, 0.72);
  border: 1px solid var(--border);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.24),
    inset 0 1px rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.topbar {
  position: absolute;
  z-index: 20;
  top: 5px;
  left: 5px;
  right: 5px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  height: 34px;
}
.search-pill,
.grid-pill {
  display: flex;
  align-items: center;
  height: 34px;
  border-radius: 11px;
}
.search-pill {
  min-width: 0;
  padding: 2px 4px 2px 80.5px;
  overflow: hidden;
}
.app-logo {
  flex: 0 0 52px;
  width: 52px;
  height: 16px;
  margin-right: 4px;
}
.query {
  margin: 0 3px;
  padding: 0 2px;
  font-size: 12px;
  letter-spacing: -0.1px;
  white-space: nowrap;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
}
.icon-button.subtle {
  opacity: 0.5;
}
.icon {
  display: block;
  width: 16px;
  height: 16px;
  opacity: 0.86;
  filter: brightness(0) invert(1);
}
.bar-separator {
  flex: none;
  width: 1px;
  height: 16px;
  margin: 0 5px;
  background: rgba(255, 255, 255, 0.12);
}
.grid-pill {
  flex: none;
  gap: 5px;
  min-width: 224px;
  padding: 2px 8px 2px 7px;
}
.range {
  position: relative;
  width: 150px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
}
.range i {
  position: absolute;
  top: 50%;
  left: 21%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d1ced2;
  transform: translate(-50%, -50%);
}
.columns {
  min-width: 18px;
  color: #bcb8bc;
  font-size: 12px;
  text-align: right;
}

/* Masonry: shortest column first, as in app/src/GalleryGrid.tsx. */
.masonry {
  position: absolute;
  inset: 48px 16px 0;
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
}
.column {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: var(--gap);
}
.tile {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #292729, #343135 55%, #292729);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.32s ease-out;
}
.tile img.ready {
  opacity: 1;
}
.tile.focused {
  outline: 3px solid #d7d0ff;
  outline-offset: -3px;
  box-shadow:
    0 0 0 4px rgba(154, 143, 255, 0.92),
    0 0 0 8px rgba(130, 109, 255, 0.24),
    0 12px 28px rgba(57, 35, 122, 0.45);
}

.gallery-footer {
  position: absolute;
  z-index: 24;
  left: 5px;
  right: 5px;
  bottom: 5px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.shortcut-strip {
  flex: 0 1 439px;
  min-width: 0;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  padding: 0 6px;
  border-radius: 11px;
  overflow: hidden;
}
.shortcut-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  white-space: nowrap;
}
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 20px;
  padding: 0 4px;
  font: 11px var(--font);
  color: #fff;
  background: #212121;
  border-radius: 4px;
}
.download-status {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  min-width: 98px;
  padding: 0 8px;
  justify-content: center;
  border-radius: 11px;
  color: #dedbdd;
  font-size: 12px;
}

/* Footer */
/* Toolbar controls drop out as the window narrows, like the app. */
@media (max-width: 900px) {
  .search-pill .secondary {
    display: none;
  }
  .grid-pill {
    min-width: 0;
  }
  .range {
    width: 84px;
  }
}
@media (max-width: 820px) {
  .window {
    flex: none;
    height: 420px;
  }
  .masonry {
    inset: 48px 10px 0;
  }
  .shortcut-hint:nth-child(n + 2):nth-child(-n + 4) {
    display: none;
  }
}
@media (max-width: 520px) {
  .grid-pill {
    display: none;
  }
  .query {
    display: none;
  }
}
