:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1d252c;
  --muted: #66717c;
  --line: #d7dde3;
  --brand: #246a73;
  --brand-dark: #17484e;
  --accent: #d99058;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 700;
}

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

button.secondary {
  background: #e7ebef;
  color: var(--text);
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

h1,
h2,
p {
  margin: 0;
}

h2 {
  font-size: 20px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(36, 106, 115, .16), transparent 42%),
    var(--bg);
}

.login-shell {
  width: min(420px, 100%);
}

.login-panel,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(29, 37, 44, .08);
}

.login-panel {
  padding: 28px;
}

.stack {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

#session-user {
  color: var(--muted);
  margin-left: 10px;
}

.layout {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel {
  padding: 20px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.asset-card {
  display: grid;
  grid-template-rows: 100px auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  background: #fbfcfd;
  min-width: 0;
}

.asset-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  background: #eef2f4;
}

.asset-card pre {
  display: grid;
  place-items: center;
  margin: 0;
  border-radius: 6px;
  background: #eef2f4;
  color: var(--accent);
  font-weight: 800;
}

.asset-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.empty {
  color: var(--muted);
  font-size: 14px;
}

#toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #17202a;
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}

#toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 760px) {
  .topbar {
    padding: 0 16px;
  }

  .layout {
    grid-template-columns: 1fr;
    width: min(100% - 24px, 1180px);
  }

  .upload-form {
    grid-template-columns: 1fr;
  }
}
