:root {
  color-scheme: light dark;
  --bg: #0b0c10;
  --panel: #14161d;
  --text: #e9ecf1;
  --muted: #aab1bc;
  --border: #262b36;
  --link: #7ab7ff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7fb;
    --panel: #ffffff;
    --text: #10131a;
    --muted: #556070;
    --border: #e7e9f0;
    --link: #0a58ca;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
  background: color-mix(in oklab, var(--bg) 75%, transparent);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.nav a {
  font-weight: 600;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

.status {
  color: var(--muted);
  margin: 8px 0 16px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.item__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item__vendor {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--panel) 70%, var(--link));
}

.item__vendorLabel {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0.85;
}

.item__vendorName {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.item__title {
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}

.item__link {
  width: fit-content;
  font-weight: 600;
}

.item__controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.item__sizeLabel {
  color: var(--muted);
  font-weight: 700;
}

.sizeSelect {
  min-width: 90px;
}

.sizeNote {
  flex-basis: 100%;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  border: 1px solid var(--border);
  user-select: none;
}

.pill--saved {
  background: color-mix(in oklab, var(--panel) 70%, #22c55e);
}

.pill--saving {
  background: color-mix(in oklab, var(--panel) 70%, #f59e0b);
}

.pill--error {
  background: color-mix(in oklab, var(--panel) 70%, #ff3b30);
}

.item__images {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.thumb {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--panel) 85%, black);
}

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

.card {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

textarea {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--panel) 85%, black);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  resize: vertical;
}

input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--panel) 85%, black);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial;
}

select {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--panel) 85%, black);
  color: var(--text);
}

button {
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--panel) 70%, var(--link));
  color: var(--text);
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
}
button:hover {
  filter: brightness(1.05);
}

.row {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 12px;
}

.radio {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.item__sizes {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}

.controls {
  margin-bottom: 12px;
}

.controls__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.controls__row {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.controls__label {
  color: var(--muted);
  font-weight: 700;
}

.controls__check {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-weight: 600;
}

.item__titleRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.iconbtn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--panel) 70%, #ff3b30);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}
.iconbtn:hover {
  filter: brightness(1.05);
}

@media (max-width: 720px) {
  .item {
    grid-template-columns: 1fr;
  }
  .item__images {
    justify-content: flex-start;
  }
  .thumb {
    width: 42vw;
    height: 42vw;
    max-width: 170px;
    max-height: 170px;
  }
}
