:root {
  color-scheme: light;
  --bg: #f4f5f6;
  --bg-top: #fafafa;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --surface-raised: rgba(255, 255, 255, 0.88);
  --sidebar: #fbfbfa;
  --sidebar-glow: rgba(255, 255, 255, 0.78);
  --bar-bg: rgba(250, 250, 250, 0.78);
  --button-hover: #f7f7f8;
  --field-bg: rgba(255, 255, 255, 0.86);
  --control-bg: rgba(17, 17, 19, 0.04);
  --placeholder-bg: #ececef;
  --pill-bg: rgba(17, 17, 19, 0.035);
  --pill-line: rgba(17, 17, 19, 0.08);
  --pill-ink: #5c5f65;
  --hover-bg: rgba(17, 17, 19, 0.045);
  --range-track: rgba(17, 17, 19, 0.16);
  --thumb-border: #ffffff;
  --primary-hover: #000000;
  --success: #248a3d;
  --ink: #171719;
  --muted: #64666b;
  --muted-2: #a2a5aa;
  --line: rgba(23, 23, 25, 0.1);
  --line-strong: rgba(23, 23, 25, 0.18);
  --accent: #2563eb;
  --green: #35b76e;
  --gold: #b6832b;
  --blue: #6578d8;
  --danger: #d92d20;
  --shadow: 0 1px 2px rgba(17, 17, 19, 0.04), 0 18px 44px rgba(17, 17, 19, 0.07);
  --shadow-hover: 0 2px 4px rgba(17, 17, 19, 0.06), 0 26px 58px rgba(17, 17, 19, 0.12);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101114;
  --bg-top: #17191e;
  --surface: #191b20;
  --surface-soft: #20232a;
  --surface-raised: rgba(31, 34, 40, 0.9);
  --sidebar: #14161b;
  --sidebar-glow: rgba(255, 255, 255, 0.04);
  --bar-bg: rgba(17, 19, 23, 0.82);
  --button-hover: #242832;
  --field-bg: rgba(21, 23, 28, 0.9);
  --control-bg: rgba(255, 255, 255, 0.06);
  --placeholder-bg: #292d35;
  --pill-bg: rgba(255, 255, 255, 0.07);
  --pill-line: rgba(255, 255, 255, 0.1);
  --pill-ink: #c3c8d2;
  --hover-bg: rgba(255, 255, 255, 0.06);
  --range-track: rgba(255, 255, 255, 0.2);
  --thumb-border: #101114;
  --primary-hover: #e8ebf0;
  --success: #62d383;
  --ink: #f4f5f7;
  --muted: #a4a9b3;
  --muted-2: #737984;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --accent: #8cb4ff;
  --green: #4ecb82;
  --gold: #e2b557;
  --blue: #93a5ff;
  --danger: #ff6b5f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 18px 44px rgba(0, 0, 0, 0.28);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.24), 0 26px 58px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, var(--bg-top) 0, var(--bg) 260px),
    var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--ink);
  cursor: pointer;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

button:hover {
  background: var(--button-hover);
  border-color: var(--line-strong);
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.05);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button:disabled:hover {
  background: var(--surface);
  border-color: var(--line);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 72%, white);
  outline-offset: 2px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field-bg);
  color: var(--ink);
  box-shadow: inset 0 1px 1px rgba(17, 17, 19, 0.03);
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 11%, transparent);
}

textarea {
  resize: vertical;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(330px, 368px) 1fr;
}

.sidebar {
  min-width: 0;
  min-height: 100vh;
  padding: 20px 18px 18px;
  overflow: auto;
  background:
    linear-gradient(180deg, var(--sidebar-glow), transparent 220px),
    var(--sidebar);
  border-right: 1px solid var(--line);
}

.brand-bar,
.workspace-bar,
.dialog-head,
.section-title-row,
.dialog-actions,
.dialog-actions > div {
  display: flex;
  align-items: center;
}

.brand-bar,
.workspace-bar,
.dialog-head,
.section-title-row,
.dialog-actions {
  justify-content: space-between;
  gap: 14px;
}

.brand-bar {
  justify-content: flex-start;
  padding: 3px 2px 20px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 38px;
  min-width: 38px;
  aspect-ratio: 1;
  display: inline-block;
  border: 1px solid rgba(17, 17, 19, 0.1);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at center, #f8fafc 0 12%, #1b1b1f 13% 33%, #f7f7f8 34% 42%, #1d1d20 43% 100%);
  box-shadow: 0 10px 24px rgba(17, 17, 19, 0.1);
}

.brand-bar p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
}

.theme-toggle {
  min-height: 32px;
  margin-left: auto;
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.42rem;
  font-weight: 760;
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 0.82rem;
  font-weight: 760;
  letter-spacing: 0;
}

.search-title-row {
  margin-bottom: 12px;
}

.search-title-row h2 {
  margin-bottom: 0;
}

.icon-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 1.28rem;
  font-weight: 600;
}

.add-record-button {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  font-size: 1.05rem;
}

.control-group {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 560;
}

.field input,
.field select,
.field textarea {
  color: var(--ink);
  font-size: 0.92rem;
}

.sidebar-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
  align-items: end;
}

.sidebar-search .field {
  margin-bottom: 0;
}

.catalog-results {
  display: grid;
  gap: 8px;
  max-height: min(520px, 46vh);
  overflow: auto;
  margin-top: 12px;
}

.catalog-result {
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  cursor: grab;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.catalog-result:hover {
  border-color: var(--line-strong);
  box-shadow: 0 10px 28px rgba(17, 17, 19, 0.08);
  transform: translateY(-1px);
}

.catalog-result.is-dragging {
  opacity: 0.48;
  cursor: grabbing;
}

.catalog-result.is-owned {
  opacity: 0.62;
}

.catalog-result.is-pending {
  cursor: progress;
}

.catalog-result img {
  width: 48px;
  aspect-ratio: 1;
  display: block;
  object-fit: cover;
  border-radius: 6px;
  background: var(--placeholder-bg);
}

.catalog-result strong,
.catalog-result span {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-result strong {
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.25;
}

.catalog-result span {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.catalog-result button {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  font-weight: 700;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--control-bg);
}

.segment {
  min-height: 31px;
  padding: 0 8px;
  border-color: transparent;
  color: var(--muted);
  background: transparent;
}

.segment.is-active {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.08);
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.stats-strip div {
  min-width: 0;
  min-height: 68px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.03);
}

.stats-strip strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 1.28rem;
  line-height: 1;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#totalPrice {
  overflow: visible;
  font-size: 1.1rem;
  line-height: 1.16;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.total-stat {
  grid-column: 1 / -1;
  min-height: 76px;
}

.stats-strip span,
.muted-count {
  color: var(--muted);
  font-size: 0.76rem;
}

.mini-list {
  display: grid;
  gap: 6px;
  max-height: 390px;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-list button {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px;
  text-align: left;
  background: transparent;
  border-color: transparent;
  transition: background 140ms ease, transform 140ms ease;
}

.mini-list button:hover {
  background: var(--hover-bg);
  transform: translateX(1px);
}

.mini-list img {
  width: 40px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  background: var(--placeholder-bg);
}

.mini-title,
.mini-artist {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-title {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.mini-artist {
  color: var(--muted);
  font-size: 0.76rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
}

.status-dot.wishlist {
  background: var(--gold);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border-bottom: 0;
}

.action-grid button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--surface-raised);
}

.action-grid button:disabled {
  color: var(--muted-2);
  cursor: progress;
}

.action-grid .reset-button {
  grid-column: 1 / -1;
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 24%, var(--line));
}

.action-grid .reset-button:hover {
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
}

.workspace {
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--bg);
}

.workspace-bar {
  position: sticky;
  top: 0;
  z-index: 4;
  min-height: 82px;
  padding: 18px 28px;
  background: var(--bar-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(1.18);
}

.title-stack h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 1.42rem;
  font-weight: 780;
  line-height: 1.1;
  letter-spacing: 0;
}

.board-title-meta {
  max-width: 220px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  overflow: hidden;
  border: 1px solid var(--pill-line);
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-ink);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-title-meta[hidden] {
  display: none;
}

.toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.view-switch {
  min-height: 38px;
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(72px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--control-bg);
}

.view-switch button {
  min-height: 28px;
  padding: 0 10px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
}

.view-switch button.is-active {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.08);
}

.toolbar label {
  min-width: 128px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
}

.toolbar input[type="range"] {
  appearance: none;
  min-height: 38px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  accent-color: var(--ink);
  cursor: pointer;
}

.toolbar input[type="range"]:hover,
.toolbar input[type="range"]:focus {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.toolbar input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: var(--range-track);
}

.toolbar input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border: 2px solid var(--thumb-border);
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 2px 8px rgba(17, 17, 19, 0.22);
}

.toolbar input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: var(--range-track);
}

.toolbar input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid var(--thumb-border);
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 2px 8px rgba(17, 17, 19, 0.22);
}

.board-wrap {
  position: relative;
  overflow: auto;
  padding: 28px;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.board-wrap.is-catalog-drop {
  background: color-mix(in srgb, var(--accent) 7%, var(--bg));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 42%, transparent);
}

.collection-board {
  --columns: 5;
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(140px, 1fr));
  gap: 18px;
  align-items: start;
}

.collection-board[data-view-mode="wall"] {
  grid-template-columns: repeat(var(--columns), minmax(96px, 1fr));
  gap: 10px;
}

.record-card {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: auto 156px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.record-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}

.record-card.is-dragging {
  opacity: 0.45;
}

.collection-board[data-view-mode="wall"] .record-card {
  display: block;
  aspect-ratio: 1;
  border-radius: 6px;
  box-shadow: none;
}

.collection-board[data-view-mode="wall"] .record-card:hover {
  transform: translateY(-1px) scale(1.01);
}

.record-cover {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  object-fit: cover;
  background: var(--placeholder-bg);
}

.collection-board[data-view-mode="wall"] .record-cover {
  height: 100%;
  aspect-ratio: auto;
}

.record-body {
  min-height: 0;
  display: grid;
  grid-template-rows: 18px 42px 20px 42px;
  gap: 6px;
  padding: 12px;
}

.collection-board[data-view-mode="wall"] .record-body {
  position: absolute;
  inset: auto 0 0;
  min-height: 54px;
  display: block;
  padding: 10px;
  background: rgba(0, 0, 0, 0.64);
  pointer-events: none;
  transform: translateY(calc(100% + 2px));
  transition: transform 160ms ease;
}

.collection-board[data-view-mode="wall"] .record-card:hover .record-body,
.collection-board[data-view-mode="wall"] .record-card:focus-within .record-body {
  pointer-events: auto;
  transform: translateY(0);
}

.collection-board[data-view-mode="wall"] .record-kicker,
.collection-board[data-view-mode="wall"] .record-meta {
  display: none;
}

.record-kicker {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.2;
}

.record-kicker span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-title {
  min-height: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 760;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.collection-board[data-view-mode="wall"] .record-title {
  min-height: 0;
  display: block;
  margin-bottom: 3px;
  color: #ffffff;
  font-size: 0.82rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-artist {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-board[data-view-mode="wall"] .record-artist {
  display: block;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.72rem;
}

.record-meta {
  min-height: 0;
  max-height: 46px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  overflow: hidden;
}

.pill {
  max-width: 100%;
  min-height: 21px;
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  overflow: hidden;
  border: 1px solid var(--pill-line);
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-ink);
  font-size: 0.7rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.record-card:hover .card-actions,
.record-card:focus-within .card-actions {
  opacity: 1;
  transform: translateY(0);
}

.card-actions button {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  background: var(--surface-raised);
  box-shadow: 0 8px 22px rgba(17, 17, 19, 0.12);
  backdrop-filter: blur(8px);
}

.empty-state {
  max-width: 430px;
  margin: 10vh auto 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  text-align: center;
  color: var(--muted);
}

.empty-kicker {
  margin-bottom: 8px;
  color: var(--muted-2);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.empty-state h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1.12rem;
}

.empty-state p:not(.empty-kicker) {
  margin-bottom: 18px;
  line-height: 1.55;
}

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.empty-actions button {
  padding-inline: 14px;
}

.record-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(17, 17, 19, 0.22);
}

.record-dialog::backdrop {
  background: rgba(18, 18, 20, 0.32);
  backdrop-filter: blur(4px);
}

.record-dialog form {
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

.lookup-panel {
  margin: 16px 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.lookup-panel h3 {
  margin: 0;
  font-size: 1rem;
}

.lookup-panel a {
  color: var(--accent);
  font-size: 0.78rem;
  text-decoration: none;
}

.lookup-row {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 10px;
  align-items: end;
}

.lookup-row .field {
  margin-bottom: 0;
}

.lookup-status {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.lookup-status[data-tone="success"] {
  color: var(--success);
}

.lookup-status[data-tone="warning"] {
  color: var(--gold);
}

.album-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  max-height: 340px;
  overflow: auto;
  margin-top: 12px;
}

.album-result {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  padding: 8px;
  text-align: left;
  background: var(--surface-raised);
}

.album-result img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  background: var(--placeholder-bg);
}

.album-result strong,
.album-result span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-result strong {
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.25;
  white-space: nowrap;
}

.album-result span {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
  white-space: nowrap;
}

.notes-field {
  margin-bottom: 18px;
}

.dialog-actions {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.dialog-actions > div {
  gap: 8px;
}

.primary-button {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(17, 17, 19, 0.18);
}

.primary-button:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.danger-button {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, var(--line));
}

@media (max-width: 1180px) {
  .collection-board {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace-bar {
    position: static;
  }

  .collection-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body {
    overflow-x: hidden;
  }

  .app-shell,
  .sidebar,
  .workspace {
    max-width: 100%;
  }

  .sidebar,
  .board-wrap,
  .workspace-bar {
    padding: 14px;
  }

  .brand-bar {
    padding-top: 2px;
  }

  .sidebar-search,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .segmented {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-grid .reset-button {
    grid-column: auto;
  }

  .workspace-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar label,
  .view-switch {
    width: 100%;
    min-width: 0;
  }

  .empty-state {
    margin-top: 32px;
    padding: 20px;
  }

  .empty-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .lookup-row {
    grid-template-columns: 1fr;
  }

  .collection-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .record-card {
    grid-template-rows: auto 156px;
  }

  .record-body {
    grid-template-rows: 18px 40px 19px 43px;
    padding: 9px;
  }
}
