:root {
  --bg: #0e0e10;
  --bg-2: #151516;
  --panel: rgba(23, 23, 26, 0.94);
  --panel-2: #1b1b20;
  --text: #f4f0e8;
  --muted: #c0b8ab;
  --accent: #d6b36e;
  --accent-2: #f1e2bd;
  --border: rgba(255, 255, 255, 0.10);
  --radius: 22px;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top, #212126 0%, #0d0d0f 58%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body { min-height: 100vh; }
button, input, select { font: inherit; }
img { display: block; max-width: 100%; }

#app {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 12px 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .72rem;
}

.intro {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 48rem;
}

.badge {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .04);
  color: var(--accent-2);
  font-size: .92rem;
}

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

.hero {
  padding: 16px;
  margin-bottom: 14px;
}

.hero h2, .list-head h2, .detail-content h2, h1 { margin: 0; }
.hero p { color: var(--muted); line-height: 1.5; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.status {
  margin: 14px 0 0;
  color: var(--accent-2);
  font-size: .94rem;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.list-panel {
  padding: 14px;
}

.list-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
}

.toggle-inline {
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
}

input[type="search"],
select {
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}

.works-list {
  display: grid;
  gap: 10px;
  max-height: 48vh;
  overflow: auto;
  padding-right: 2px;
}

.work-item {
  width: 100%;
  text-align: left;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 16px;
  background: #111114;
  color: var(--text);
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
}

.work-item.active {
  border-color: rgba(214, 179, 110, .72);
  background: rgba(214, 179, 110, .16);
}

.work-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  background: #090909;
}

.work-item > div:nth-child(2),
.work-meta,
.work-text {
  min-width: 0;
}

.work-title {
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.work-sub {
  color: rgba(244, 240, 232, .78);
  font-size: .86rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.work-item .ghost,
.work-item button,
.work-item .voice {
  white-space: nowrap;
}

.detail-panel {
  overflow: hidden;
}

.art-wrap {
  background: #09090b;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.art-wrap img {
  width: 100%;
  max-height: 54vh;
  object-fit: contain;
}

.detail-content {
  padding: 18px;
}

.meta {
  color: var(--accent);
  margin: 0 0 12px;
}

.description {
  line-height: 1.7;
  color: var(--text);
  white-space: pre-line;
}

.secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  background: var(--accent);
  color: #151515;
  font-weight: 700;
  cursor: pointer;
}

button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

button.hidden {
  display: none;
}

#artId {
  font-size: .68rem;
  letter-spacing: .18em;
  color: #bfa77a;
  opacity: .9;
  margin-bottom: 8px;
}

.qr-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: .84rem;
  word-break: break-all;
}

@media (min-width: 860px) {
  .layout {
    grid-template-columns: 360px 1fr;
    align-items: start;
  }

  .list-panel {
    position: sticky;
    top: 12px;
  }
}

@media (max-width: 859px) {
  #app {
    padding: 10px 10px 24px;
  }

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

  .top-actions {
    justify-content: flex-start;
  }

  .hero {
    padding: 14px;
  }

  .hero-actions {
    gap: 8px;
  }

  .hero-actions button {
    padding: 10px 12px;
  }

  /* IMPORTANT : œuvre choisie AVANT le menu sur mobile */
  .layout {
    display: flex;
    flex-direction: column;
  }

  .detail-panel {
    order: 1;
  }

  .list-panel {
    order: 2;
  }

  .works-list {
    max-height: none;
    overflow: visible;
  }

  .work-item {
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-areas:
      "thumb text"
      "thumb voice";
    align-items: start;
    gap: 10px 12px;
    padding: 12px;
  }

  .work-item img {
    grid-area: thumb;
    width: 72px;
    height: 72px;
  }

  .work-item > div:nth-child(2),
  .work-meta,
  .work-text {
    grid-area: text;
  }

  .work-item > :last-child {
    grid-area: voice;
    justify-self: start;
    margin-top: 2px;
  }

  .work-title {
    font-size: 1rem;
  }

  .work-sub {
    font-size: .88rem;
  }

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

  .toggle-inline {
    align-items: center;
    flex-wrap: wrap;
  }

  .art-wrap img {
    max-height: none;
    width: 100%;
    height: auto;
  }

  .detail-content {
    padding: 14px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.9rem;
    line-height: 1.08;
  }

  .hero h2,
  .list-head h2,
  .detail-content h2 {
    font-size: 1.65rem;
    line-height: 1.08;
  }

  input[type="search"],
  select {
    padding: 11px 12px;
  }

  .filters {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
  }

  .filters > label:first-child {
    min-width: 0;
  }

  .toggle-inline {
    align-self: end;
    justify-content: flex-start;
    margin-top: 24px;
  }

  .work-item {
    grid-template-columns: 64px minmax(0, 1fr);
    padding: 11px;
  }

  .work-item img {
    width: 64px;
    height: 64px;
  }

  .work-title {
    font-size: .96rem;
  }

  .work-sub {
    font-size: .82rem;
  }

  .secondary-actions {
    flex-direction: column;
  }

  .secondary-actions button {
    width: 100%;
  }
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
}

.language-switch .language-button {
  min-width: 44px;
  padding: 7px 10px;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  border: 0;
  font-size: .86rem;
}

.language-switch .language-button.active {
  background: var(--accent);
  color: #151515;
}
