:root {
  color-scheme: light dark;
}
* {
  box-sizing: border-box;
}
[hidden] {
  /* biome-ignore lint/complexity/noImportantStyles: author display rules (#viewer-hint's flex) would otherwise beat the hidden attribute */
  display: none !important;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  height: 100vh;
}
header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 2px solid #00a870;
  padding: 0.75rem 1rem;
  flex: none;
}
h1 {
  font-size: 1.2rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
h1 svg {
  height: 1.5rem;
  width: auto;
  display: block;
}
h1 svg path {
  fill: #00a870;
}
h1 span {
  color: #00a870;
}
a {
  color: #00a870;
}
#app {
  display: flex;
  flex: 1;
  min-height: 0;
}

#left-pane {
  width: 380px;
  flex: none;
  overflow-y: auto;
  padding: 1rem;
  border-right: 1px solid #8883;
}
#right-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  overflow-y: auto;
}

h2 {
  font-size: 0.95rem;
  margin: 0 0 0.6rem;
}
.muted {
  color: #888;
  font-size: 0.85rem;
}

#upload-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1.25rem;
}
#upload-status {
  width: 100%;
  margin: 0.3rem 0 0;
}

button,
input[type="submit"] {
  background: #00a870;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
}
button:disabled {
  background: #8886;
  cursor: default;
}
input[type="file"],
input[type="password"] {
  padding: 0.4rem;
  border: 1px solid #8886;
  background: transparent;
  color: inherit;
  max-width: 100%;
}

#assets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.asset-card {
  border: 2px solid transparent;
  padding: 0.4rem;
  cursor: pointer;
  background: #8881;
  min-width: 0;
}
.asset-card:hover {
  background: #00a87014;
}
.asset-card.selected {
  border-color: #00a870;
}
.thumb-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #ffffffb0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.thumb-placeholder {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    #8882,
    #8882 10px,
    #8884 10px,
    #8884 20px
  );
}
.asset-card .asset-id {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#viewer-hint {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
}
#viewer-container {
  width: 100%;
  flex: 1;
  min-height: 320px;
  background: #0000000a;
}
#download-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.fmt-link {
  white-space: nowrap;
}
details summary {
  cursor: pointer;
  color: #00a870;
}

@media (max-width: 700px) {
  #app {
    flex-direction: column;
    overflow-y: auto;
  }
  #left-pane,
  #right-pane {
    width: 100%;
    overflow-y: visible;
    border-right: none;
  }
  #right-pane {
    border-top: 1px solid #8883;
  }
}
