* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, "Segoe UI", sans-serif;
  background: #14151b;
  color: #e8e8ec;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #2a2d38;
}

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

#account {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.btn {
  display: inline-block;
  cursor: pointer;
  border: 1px solid #3a3e4c;
  border-radius: 4px;
  background: #34384a;
  color: #e8e8ec;
  padding: 7px 12px;
  font-size: 13px;
  text-decoration: none;
}

.btn:hover {
  background: #40465c;
}

#login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 80px 20px;
  text-align: center;
}

#login-screen[hidden],
#app[hidden] {
  display: none;
}

main {
  padding: 24px;
}

#upload-form {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

#upload-form button {
  cursor: pointer;
  border: 1px solid #3a3e4c;
  border-radius: 4px;
  background: #34384a;
  color: #e8e8ec;
  padding: 8px 14px;
}

#grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.item {
  background: #1b1d24;
  border: 1px solid #2a2d38;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-preview img,
.item-preview video {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 4px;
  background: #0e0f13;
}

.item-meta {
  margin: 0;
  font-size: 11px;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.item-post {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-post [hidden] {
  display: none;
}

.item-post label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  opacity: 0.9;
}

.item-post .field-row {
  display: flex;
  gap: 8px;
}

.item-post .field-row label {
  flex: 1;
}

.item-post select,
.item-post input {
  background: #2a2d38;
  border: 1px solid #3a3e4c;
  border-radius: 4px;
  color: #e8e8ec;
  padding: 6px 8px;
  font-size: 13px;
}

.trim-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trim-video {
  width: 100%;
  max-height: 200px;
  background: #000;
  border-radius: 4px;
}

.trim-timeline {
  position: relative;
  height: 44px;
  border-radius: 4px;
  overflow: hidden;
  background: #0e0f13;
  touch-action: none;
}

.trim-thumbs {
  position: absolute;
  inset: 0;
  display: flex;
}

.trim-thumbs img {
  flex: 1;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.trim-selection {
  position: absolute;
  top: 0;
  bottom: 0;
  border-top: 2px solid #3ddc84;
  border-bottom: 2px solid #3ddc84;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.trim-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 12px;
  margin-left: -6px;
  background: #3ddc84;
  border-radius: 3px;
  cursor: ew-resize;
  z-index: 2;
}

.trim-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 14px;
  background: #14151b;
  transform: translate(-50%, -50%);
}

.trim-times {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  opacity: 0.75;
}

.item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.item-actions button {
  flex: 1;
  cursor: pointer;
  border: 1px solid #3a3e4c;
  border-radius: 4px;
  background: #2a2d38;
  color: #e8e8ec;
  padding: 6px 8px;
  font-size: 12px;
}

.item-actions button:hover {
  background: #34384a;
}

.item-actions .post-btn {
  background: #2f5d3a;
}

.item-actions .delete-btn {
  background: #5d2f2f;
}

.status-msg {
  font-size: 12px;
  opacity: 0.8;
  min-height: 16px;
}
