:root {
  color-scheme: light;
  --ink: #1d2329;
  --muted: #62717d;
  --line: #d7dedf;
  --paper: #f7f4ec;
  --panel: #fffdf7;
  --charcoal: #273036;
  --brick: #b84d3d;
  --gold: #d99e34;
  --teal: #2f7d7c;
  --green: #587f45;
  --blue: #446c9d;
  --shadow: 0 20px 60px rgba(39, 48, 54, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(39, 48, 54, 0.04) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 0 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brick);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--charcoal);
  font-size: clamp(2.2rem, 5vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.primary-action,
.ghost-action,
.text-action {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 16px;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--charcoal);
  color: #fffdf7;
  box-shadow: 0 10px 24px rgba(39, 48, 54, 0.18);
}

.primary-action span {
  font-size: 1.35rem;
  line-height: 1;
}

.ghost-action {
  background: #ebe5d7;
  color: var(--charcoal);
}

.text-action {
  min-height: 36px;
  background: transparent;
  color: var(--brick);
  padding: 0;
}

.primary-action:hover,
.ghost-action:hover {
  transform: translateY(-1px);
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-tile {
  min-height: 152px;
  padding: 18px;
  border: 1px solid rgba(39, 48, 54, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(184, 77, 61, 0.11), transparent 42%),
    var(--panel);
  box-shadow: 0 10px 28px rgba(39, 48, 54, 0.08);
}

.stat-tile strong {
  display: block;
  margin: 12px 0 8px;
  color: var(--charcoal);
  font-size: 2.5rem;
  line-height: 1;
}

.stat-tile span {
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-tile .stat-label {
  color: var(--charcoal);
  font-weight: 800;
}

.accent-warm {
  background:
    linear-gradient(135deg, rgba(217, 158, 52, 0.2), transparent 46%),
    var(--panel);
}

.accent-cool {
  background:
    linear-gradient(135deg, rgba(68, 108, 157, 0.16), transparent 46%),
    var(--panel);
}

.accent-green {
  background:
    linear-gradient(135deg, rgba(88, 127, 69, 0.16), transparent 46%),
    var(--panel);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.editor-panel,
.library {
  border: 1px solid rgba(39, 48, 54, 0.1);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.92);
  box-shadow: var(--shadow);
}

.editor-panel {
  position: sticky;
  top: 18px;
  padding: 20px;
}

.panel-heading,
.shelf-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--charcoal);
  font-size: 0.83rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 136px;
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(47, 125, 124, 0.14);
}

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

.form-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 4px;
}

.library {
  min-height: 640px;
  padding: 20px;
}

.library-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  margin-bottom: 22px;
}

.search-wrap {
  position: relative;
}

.search-wrap input {
  padding-left: 12px;
}

.control-row {
  display: flex;
  gap: 10px;
}

.control-row select {
  width: auto;
  min-width: 138px;
}

.review-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.record-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  min-height: 232px;
  border: 1px solid rgba(39, 48, 54, 0.12);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.cover-art {
  position: relative;
  overflow: hidden;
  width: 92px;
  min-height: 188px;
  border-radius: 6px;
  background: var(--cover-bg, #446c9d);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26);
}

.cover-art::before,
.cover-art::after {
  position: absolute;
  content: "";
}

.cover-art::before {
  inset: 12px;
  border: 2px solid rgba(255, 255, 255, 0.65);
}

.cover-art::after {
  right: -28px;
  bottom: 18px;
  width: 78px;
  height: 78px;
  border: 12px solid rgba(255, 253, 247, 0.56);
  border-radius: 50%;
}

.cover-mark {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 28px;
  height: 80px;
  background: rgba(255, 253, 247, 0.72);
}

.record-content {
  display: grid;
  min-width: 0;
}

.record-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.record-title {
  margin: 0 0 4px;
  color: var(--charcoal);
  font-size: 1.05rem;
  line-height: 1.2;
}

.record-artist,
.record-meta,
.record-notes {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.record-artist {
  margin-bottom: 10px;
}

.rating-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #f2dca5;
  color: #3d3020;
  padding: 6px 9px;
  font-size: 0.84rem;
  font-weight: 900;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tag {
  border-radius: 999px;
  background: #edf0e6;
  color: #3a4d33;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: capitalize;
}

.tracks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.tracks li {
  border: 1px solid #d8e2e2;
  border-radius: 999px;
  color: var(--teal);
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 800;
}

.record-notes {
  margin-bottom: 14px;
}

.card-actions {
  display: flex;
  gap: 8px;
  align-self: end;
}

.icon-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 38px;
  height: 36px;
  background: #fffdf7;
  color: var(--charcoal);
  font-weight: 900;
}

.icon-action.delete {
  color: var(--brick);
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 56px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--charcoal);
}

@media (max-width: 1100px) {
  .dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .editor-panel {
    position: static;
  }
}

@media (max-width: 780px) {
  .app-shell {
    width: min(100% - 20px, 1480px);
    padding-top: 14px;
  }

  .topbar,
  .library-toolbar,
  .shelf-header {
    display: grid;
  }

  .topbar .primary-action,
  .control-row,
  .control-row select {
    width: 100%;
  }

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

  .dashboard,
  .form-grid,
  .review-list {
    grid-template-columns: 1fr;
  }

  .record-card {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .cover-art {
    width: 76px;
  }

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