/*
  BFAMTMS owner's dashboard styles. Shape and tokens follow the Di'Cari Heritage dashboard, in BFAM's own look:
  gold on black, serif headings. Phone first, 44px touch targets, no sideways page scroll. No em-dashes.
*/
:root {
  --bg: #0E0B0C; --panel: #1B1517; --panel-2: #241C1F; --text: #F1EADB; --muted: #B8AD9B; --faint: #8C8274; --line: #3A2F2C;
  --gold: #D8BB72; --gold-2: #E7CF8E; --gold-soft: rgba(216,187,114,.12); --on-gold: #0E0B0C;
  --up: #6FCF97; --down: #F0716A; --focus: #E7CF8E; --chart-before: #5A4C46;
  --serif: "Cormorant Garamond", Georgia, serif; --sans: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --r: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.55 var(--sans); overflow-x: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: .01em; }
h1 { font-size: 28px; color: var(--gold); }
h2 { font-size: 26px; margin: 4px 0 6px; }
h3 { font-size: 20px; margin: 22px 0 8px; }
p { margin: 0 0 10px; }
.sub, .hint { color: var(--muted); }
.hint { font-size: 13px; color: var(--faint); margin: 4px 0 0; }
.note { background: var(--gold-soft); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.loading { padding: 40px 16px; text-align: center; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* frame */
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 16px 0; }
.who { color: var(--faint); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 8px 12px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 99px; color: var(--muted); text-decoration: none; font-weight: 500; border: 1px solid transparent; }
.tabs a[aria-current="page"] { background: var(--gold); color: var(--on-gold); }
.tabs a:not([aria-current]):hover { border-color: var(--line); color: var(--text); }
main { max-width: 1040px; margin: 0 auto; padding: 16px 16px 140px; }

/* controls */
.btn, .btn-quiet, .btn-danger { min-height: 44px; padding: 0 18px; border-radius: 99px; border: 1px solid var(--gold); background: var(--gold); color: var(--on-gold); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn-quiet { background: transparent; color: var(--gold); }
.btn-danger { background: transparent; color: var(--down); border-color: var(--down); }
.btn:disabled, .btn-quiet:disabled, .btn-danger:disabled, .icon-btn:disabled { opacity: .4; cursor: default; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 18px; }
.link-btn { background: none; border: 0; color: var(--gold); text-decoration: underline; cursor: pointer; padding: 10px 0; min-height: 44px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.inp, .ta, select.inp { width: 100%; min-height: 44px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.ta { resize: vertical; }
.inp.bad, .ta.bad { border-color: var(--down); }
label.lbl { display: block; font-weight: 600; margin: 0 0 4px; }
.opt { font-weight: 400; color: var(--faint); font-size: 13px; }
.err { color: var(--down); font-size: 14px; }
.ok { color: var(--up); font-size: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 0 0 12px; min-width: 0; }

/* overview */
.ranges { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 14px; }
.ranges button { min-height: 44px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.ranges button[aria-pressed="true"] { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; min-width: 0; }
.tile .k { color: var(--muted); font-size: 14px; display: block; }
.tile .n { font: 600 32px/1.15 var(--serif); font-variant-numeric: tabular-nums; display: block; color: var(--gold-2); }
.tile .d { font-size: 13px; color: var(--faint); }
.up { color: var(--up); } .down { color: var(--down); }
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--faint); font-size: 11px; }
.lists { display: grid; gap: 12px; grid-template-columns: 1fr; }
.rows { list-style: none; margin: 8px 0 0; padding: 0; }
.rows li { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 9px 8px; border-radius: 8px; background: linear-gradient(90deg, var(--gold-soft) var(--w, 0%), transparent var(--w, 0%)); }
.rows .nm { overflow-wrap: anywhere; min-width: 0; }
.rows .v { font-variant-numeric: tabular-nums; color: var(--gold-2); }
.rows .empty { color: var(--faint); background: none; }

/* edit */
.group { margin-top: 22px; }
details.group { margin-top: 12px; border: 1px solid var(--line, #2B261E); border-radius: 14px; background: var(--panel); }
details.group > summary { list-style: none; cursor: pointer; min-height: 56px; padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::after { content: ""; width: 10px; height: 10px; margin-left: auto; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(45deg); transition: transform .15s; }
details.group[open] > summary::after { transform: rotate(-135deg); }
details.group > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 14px; }
details.group .gname { font-weight: 700; font-size: 18px; }
details.group .gcount { color: var(--muted, #A69E90); font-size: 14px; }
details.group.has-changes .gcount { color: var(--gold); font-weight: 600; }
details.group[open] { padding-bottom: 12px; }
details.group > .field { margin-left: 16px; margin-right: 16px; }
.field { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 0 0 12px; }
.field.is-draft { border-color: var(--gold); }
.field-f { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; justify-content: space-between; margin-top: 4px; }
.count { color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.count.over { color: var(--down); }
.img-row { display: grid; gap: 12px; grid-template-columns: 1fr; }
.thumb { width: 100%; max-width: 280px; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.file { position: relative; overflow: hidden; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.ev { display: grid; gap: 8px; grid-template-columns: 1fr; padding: 12px; margin: 0 0 8px; background: var(--panel-2); border-radius: 10px; }
.chk { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.chk input { width: 22px; height: 22px; accent-color: var(--gold); flex: none; }
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--panel); border-top: 1px solid var(--gold); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.bar .msg { font-weight: 600; }
.preview { margin: 0 0 14px; }
.preview iframe { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }

/* albums, tables */
.alb { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; }
.cover { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--panel-2); border: 1px solid var(--line); }
.tag { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); margin-right: 6px; }
.tag.on { border-color: var(--up); color: var(--up); }
.song { background: var(--panel-2); border-radius: 10px; padding: 10px; margin: 0 0 8px; display: grid; gap: 8px; }
.song audio { width: 100%; height: 40px; }
.up-line { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.form { display: grid; gap: 12px; }
.form .two { display: grid; gap: 12px; grid-template-columns: 1fr; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; min-width: 520px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
tr:last-child td { border-bottom: 0; }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--gold); border-radius: var(--r); padding: 18px; width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.7); }
.toast { position: fixed; left: 12px; right: 12px; bottom: 84px; z-index: 40; max-width: 520px; margin: 0 auto; padding: 12px 16px; border-radius: 12px; background: var(--gold); color: var(--on-gold); font-weight: 600; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.on { opacity: 1; transform: none; }
.toast.bad { background: var(--down); color: #1b0605; }

@media (min-width: 700px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lists { grid-template-columns: 1fr 1fr; }
  .img-row { grid-template-columns: 280px 1fr; }
  .ev { grid-template-columns: 1fr 1fr 1fr; align-items: end; }
  .form .two { grid-template-columns: 1fr 1fr; }
  .song { grid-template-columns: 1fr 1fr; }
  .song .wide { grid-column: 1 / -1; }
  .preview iframe { height: 600px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

.list-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.list-chip { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid currentColor; background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.list-chip[aria-pressed="true"] { background: #D8BB72; border-color: #D8BB72; color: #17120F; }
.list-table { min-width: 640px; }
.list-table th, .list-table td { white-space: nowrap; }
.list-table td:nth-child(3) { white-space: normal; min-width: 130px; }

/* 2026-11-10: the Albums tab's releases and songs already on the site */
details.group.item > summary { gap: 6px 12px; }
details.group.item .mini { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--panel-2); border: 1px solid var(--line); flex: none; }
.thumb.sq { aspect-ratio: 1; max-width: 180px; }
.thumb.clip { aspect-ratio: 9/16; max-width: 150px; }

/* the songs that play with a scent (2026-11-11) */
.picks { list-style: none; margin: 8px 0; padding: 0; counter-reset: pick; }
.pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: var(--panel-2); counter-increment: pick; }
.pick::before { content: counter(pick); color: var(--gold); font-weight: 600; min-width: 1.2em; }
.pick .pname { flex: 1 1 10em; }
