* {
  box-sizing: border-box;
}

body {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  color: #222;
  background: #fff;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h1 {
  font-size: 1.2rem;
  margin: 0;
}

h2 {
  font-size: 1rem;
  margin: 16px 0 8px;
}

#settingsLink {
  font-size: 0.9rem;
  color: #2563eb;
}

#tagTabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

#tagTabs button {
  padding: 8px 12px;
  border: 1px solid #999;
  border-radius: 4px;
  background: #fff;
  font-size: 0.9rem;
}

#tagTabs button.active {
  background: #333;
  color: #fff;
  border-color: #333;
}

#picker {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

#picker button {
  flex: 1;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #333;
  border-radius: 4px;
  background: #333;
  color: #fff;
}

#status {
  min-height: 1.4em;
  margin: 8px 0;
  font-size: 0.9rem;
}

#status.error {
  color: #c0392b;
}

#pendingRow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px;
  font-size: 0.85rem;
}

#pendingInfo {
  color: #555;
}

#retryBtn {
  padding: 4px 10px;
  font-size: 0.85rem;
  border: 1px solid #999;
  border-radius: 4px;
  background: #fff;
}

#recentList {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

#recentList figure {
  margin: 0;
}

#recentList img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border-radius: 4px;
  background: #eee;
}

#recentList figcaption {
  font-size: 0.75rem;
  margin-top: 4px;
  word-break: break-all;
}

.dlRow {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.dlBtn {
  padding: 4px 6px;
  font-size: 0.7rem;
  border: 1px solid #999;
  border-radius: 4px;
  background: #fff;
}
