*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
body{
  font-family:'Cormorant Garamond','Georgia',serif;
  font-size:18px;
  background:#f5f0e6;
  color:#1a1510;
  line-height:1.7;
  min-height:100vh;
}

/* ---- Header ---- */
header{
  background:#1e2d4f;
  color:#f5f0e6;
  text-align:left;
  padding:2rem 1rem 1.75rem;
  border-bottom:2px solid #b8915a;
  position:relative;
  overflow:visible;
}
.header-content{
  max-width:960px;
  margin:0 auto;
  padding-right:230px;
}
header h1{
  font-size:2.6rem;
  font-weight:300;
  letter-spacing:0.14em;
  margin-bottom:0.4rem;
  color:#f5f0e6;
  line-height:1.2;
}
header p{
  font-style:italic;
  font-weight:300;
  color:#b8a888;
  font-size:1.05rem;
  letter-spacing:0.03em;
}

/* ---- Portrait slot ---- */
.header-portrait-slot{
  position:absolute;
  right:max(1rem, calc((100% - 960px) / 2 + 2.5rem));
  top:1rem;
  width:200px;
  z-index:10;
}
.header-portrait-slot img{
  width:200px;
  height:325px;
  object-fit:cover;
  object-position:top;
  border-radius:3px;
  border:2px solid #b8915a;
  box-shadow:0 8px 32px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.3);
  display:block;
}
.portrait-placeholder{
  width:200px;
  height:325px;
  border-radius:3px;
  border:1px dashed rgba(184,145,90,0.45);
  background:rgba(255,255,255,0.05);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:0.35rem;
  cursor:pointer;
  color:rgba(245,240,230,0.45);
  font-size:0.7rem;
  font-family:'Cinzel','Georgia',serif;
  letter-spacing:0.08em;
  text-align:center;
  padding:0.5rem;
  transition:border-color 0.2s, background 0.2s;
}
.portrait-placeholder:hover,
.portrait-placeholder.drag-over{
  border-color:rgba(184,145,90,0.8);
  background:rgba(255,255,255,0.09);
}
.portrait-remove{
  position:absolute;
  top:6px;right:6px;
  width:22px;height:22px;
  border-radius:50%;
  background:rgba(10,18,38,0.75);
  color:#f5f0e6;
  border:none;
  cursor:pointer;
  font-size:14px;
  line-height:22px;
  text-align:center;
  display:none;
  padding:0;
}
.header-portrait-slot:hover .portrait-remove{display:block}
body:not(.edit-mode) .header-portrait-slot:not(.has-image){display:none}

/* ---- Container ---- */
.container{
  max-width:960px;
  margin:0 auto;
  padding:1.25rem 1rem 3rem;
}

/* ---- Record section ---- */
.record-section{
  margin-bottom:1.5rem;
}
.record-section:first-child > .record-heading,
.record-section:first-child > .record-notes-wrap{
  margin-right:220px;
}
.record-heading{
  font-size:1.5rem;
  font-weight:400;
  text-transform:uppercase;
  letter-spacing:0.05em;
  color:#9a9080;
  font-family:'Cinzel','Georgia',serif;
  border-bottom:1px solid #ddd5c5;
  padding-bottom:0.4rem;
  margin-bottom:0.85rem;
}
.top-section-label{
  font-size:0.95rem;
  font-weight:400;
  text-transform:uppercase;
  letter-spacing:0.2em;
  color:#9a9080;
  font-family:'Cinzel','Georgia',serif;
  border-bottom:1px solid #ddd5c5;
  padding-bottom:0.4rem;
  margin:1.75rem 0 0.85rem;
}
.top-section-label:first-child{margin-top:0}

/* ---- Side card ---- */
.side-card{
  display:grid;
  grid-template-columns:160px 1fr;
  gap:1rem;
  background:#fdfaf4;
  border:1px solid #ddd5c5;
  border-radius:4px;
  padding:1rem 1.1rem;
  margin-bottom:0.65rem;
  box-shadow:0 1px 4px rgba(20,32,60,0.05);
  transition:box-shadow 0.2s;
}
.side-card:hover{
  box-shadow:0 3px 14px rgba(20,32,60,0.09);
}
.side-label{
  font-size:0.68rem;
  text-transform:uppercase;
  letter-spacing:0.2em;
  color:#9a9080;
  font-family:'Cinzel','Georgia',serif;
  margin-bottom:0.5rem;
}

/* ---- Image areas ---- */
.side-art{
  width:160px;
  min-height:160px;
  border-radius:3px;
  overflow:hidden;
  background:#ece5d8;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  position:relative;
  cursor:pointer;
  transition:border-color 0.2s;
  border:1px solid #d4cbbe;
  align-self:start;
}
.side-art.drag-over{
  border-color:#b8915a;
  background:#e2d8cb;
}
.side-art svg.vinyl{width:90px;height:90px;opacity:0.3}
.side-art .drop-hint{
  position:absolute;
  bottom:4px;left:0;right:0;
  text-align:center;
  font-size:0.58rem;
  font-family:'Cinzel','Georgia',serif;
  color:#9a9080;
  letter-spacing:0.05em;
  pointer-events:none;
}
.side-art img{width:100%;height:100%;object-fit:cover}
.side-art .remove-img{
  position:absolute;
  top:4px;right:4px;
  width:22px;height:22px;
  border-radius:50%;
  background:rgba(10,18,38,0.65);
  color:#f5f0e6;
  border:none;
  cursor:pointer;
  font-size:14px;
  line-height:22px;
  text-align:center;
  display:none;
  padding:0;
}
.side-art:hover .remove-img{display:block}

/* Extra images row */
.extra-images-row{
  grid-column:1 / -1;
  display:flex;
  gap:0.75rem;
  flex-wrap:wrap;
  padding-top:0.5rem;
  border-top:1px solid #e8e0d2;
  margin-top:0.1rem;
}
.extra-images-label{
  font-size:0.68rem;
  text-transform:uppercase;
  letter-spacing:0.14em;
  color:#9a9080;
  font-family:'Cinzel','Georgia',serif;
  width:100%;
  margin-bottom:0.15rem;
}
.extra-art{
  width:120px;height:120px;
  border-radius:3px;overflow:hidden;
  background:#ece5d8;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;position:relative;
  cursor:pointer;
  transition:border-color 0.2s;
  border:1px solid #d4cbbe;
}
.extra-art.drag-over{border-color:#b8915a;background:#e2d8cb}
.extra-art svg.vinyl{width:60px;height:60px;opacity:0.3}
.extra-art .drop-hint{
  position:absolute;bottom:4px;left:0;right:0;
  text-align:center;font-size:0.58rem;
  font-family:'Cinzel','Georgia',serif;
  color:#9a9080;letter-spacing:0.05em;pointer-events:none;
}
.extra-art img{width:100%;height:100%;object-fit:cover}
.extra-art .remove-img{
  position:absolute;top:4px;right:4px;
  width:22px;height:22px;border-radius:50%;
  background:rgba(10,18,38,0.65);color:#f5f0e6;
  border:none;cursor:pointer;font-size:14px;line-height:22px;
  text-align:center;display:none;padding:0;
}
.extra-art:hover .remove-img{display:block}

/* ---- Tracks column ---- */
.side-tracks{
  display:flex;flex-direction:column;gap:0.5rem;min-width:0;
}
.track-entry{
  border-bottom:1px solid #e8e0d2;
  padding-bottom:0.6rem;
}
.track-entry:last-child{border-bottom:none;padding-bottom:0}
.track-number{
  font-size:0.65rem;text-transform:uppercase;letter-spacing:0.16em;
  color:#9a9080;font-family:'Cinzel','Georgia',serif;
}
.track-title{
  font-size:1.15rem;font-weight:400;font-style:italic;
  color:#1a1510;line-height:1.35;word-wrap:break-word;
}
.track-description{
  font-size:0.95rem;color:#9a9080;
  font-family:'Cormorant Garamond','Georgia',serif;
  font-style:italic;letter-spacing:0.01em;margin-top:0.1rem;
}

/* ---- Audio player ---- */
.player{
  display:flex;align-items:center;gap:0.6rem;
  background:#e8e2d6;
  border-radius:3px;padding:0.4rem 0.65rem;margin-top:0.35rem;
}
.play-btn{
  width:28px;height:28px;
  border:1px solid rgba(30,45,79,0.2);border-radius:50%;
  background:transparent;color:#1e2d4f;
  cursor:pointer;display:flex;align-items:center;justify-content:center;
  flex-shrink:0;transition:all 0.15s;
}
.play-btn:hover{background:rgba(30,45,79,0.08);border-color:rgba(30,45,79,0.4)}
.play-btn svg{width:11px;height:11px;fill:currentColor}
.progress-wrap{flex:1;display:flex;align-items:center;gap:0.5rem;min-width:0}
.progress-bar{
  flex:1;height:2px;
  background:rgba(0,0,0,0.1);
  border-radius:1px;cursor:pointer;position:relative;overflow:hidden;
}
.progress-fill{
  height:100%;width:0%;
  background:linear-gradient(90deg,#b8915a,#d4ad7a);
  border-radius:1px;transition:width 0.1s linear;
}
.time-display{
  font-size:0.65rem;color:#a09080;
  font-family:'Cinzel','Georgia',serif;
  white-space:nowrap;min-width:70px;text-align:right;letter-spacing:0.05em;
}

/* ---- Record-level notes ---- */
.record-notes-wrap{margin-bottom:0.75rem}
.record-notes-label{
  font-size:0.65rem;text-transform:uppercase;letter-spacing:0.2em;
  color:#9a9080;font-family:'Cinzel','Georgia',serif;margin-bottom:0.1rem;
}
.record-notes{
  font-size:1rem;font-family:'Cormorant Garamond','Georgia',serif;
  color:#1a1510;background:#fdfaf4;
  border:1px solid #d4cbbe;border-radius:3px;
  padding:0.2rem 0.2rem;width:100%;min-height:0;
  resize:none;overflow:hidden;line-height:1.7;
}
.record-notes::placeholder{color:#b5a898;font-style:italic}
.record-notes:focus{outline:none;border-color:#b8915a;background:#fff}

/* ---- Track notes ---- */
.track-notes{
  font-size:0.95rem;font-family:'Cormorant Garamond','Georgia',serif;
  color:#58504a;background:#f5f0e6;
  border:1px dashed #d4cbbe;border-radius:3px;
  padding:0.1rem 0.1rem;width:100%;min-height:0;
  resize:none;overflow:hidden;line-height:1.6;margin-top:0.1rem;
}
.track-notes::placeholder{color:#b5a898;font-style:italic}
.track-notes:focus{outline:none;border-color:#b8915a;background:#fdfaf4}

/* ---- Downloads ---- */
.downloads{
  display:flex;flex-wrap:wrap;gap:0.3rem;margin-top:-0.15rem;margin-bottom:0.2rem;
}
.dl-link{
  font-size:0.65rem;font-family:'Cinzel','Georgia',serif;
  color:#9a9080;text-decoration:none;
  border:1px solid #d4cbbe;border-radius:3px;
  padding:0.2rem 0.3rem;letter-spacing:0.06em;
  transition:all 0.15s;
}
.dl-link:hover{
  background:#1e2d4f;color:#d4ad7a;border-color:#1e2d4f;
}

/* ---- Save bar ---- */
.save-bar{
  position:fixed;bottom:0;left:0;right:0;
  background:rgba(14,22,42,0.97);
  padding:0.6rem 1rem;
  display:flex;justify-content:center;align-items:center;gap:1.25rem;
  z-index:100;backdrop-filter:blur(8px);
  border-top:1px solid rgba(184,145,90,0.2);
}
.save-bar .save-btn{
  font-family:'Cinzel','Georgia',serif;
  font-size:0.7rem;font-weight:600;
  letter-spacing:0.12em;text-transform:uppercase;
  padding:0.42rem 1.5rem;
  border:1px solid rgba(184,145,90,0.55);border-radius:2px;
  cursor:pointer;transition:all 0.15s;
  background:transparent;color:#c8a870;
}
.save-bar .save-btn:hover{background:#b8915a;color:#f5f0e6;border-color:#b8915a}
.save-bar .save-status{
  font-size:0.72rem;color:rgba(190,178,158,0.6);
  font-family:'Cinzel','Georgia',serif;letter-spacing:0.04em;
}
.save-bar .unsaved-dot{
  display:inline-block;width:6px;height:6px;border-radius:50%;
  background:#c8a870;margin-right:0.4rem;vertical-align:middle;
  opacity:0;transition:opacity 0.3s;
}
.save-bar .unsaved-dot.active{opacity:1}

/* ---- Footer ---- */
footer{
  text-align:center;padding:2rem 1rem 4rem;
  font-size:0.75rem;color:#a09888;
  border-top:1px solid #ddd5c5;letter-spacing:0.1em;
  font-family:'Cinzel','Georgia',serif;text-transform:uppercase;
}

/* ---- Responsive ---- */
@media(max-width:600px){
  .side-card{grid-template-columns:1fr}
  .side-art{width:100%;min-height:120px;height:180px}
  .side-art svg.vinyl{width:60px;height:60px}
  header h1{font-size:1.7rem}
  .header-content{padding-right:130px}
  .header-portrait-slot{right:0.75rem;top:0.75rem;width:110px}
  .header-portrait-slot img{width:110px;height:178px}
  .portrait-placeholder{width:110px;height:178px}
  .record-section:first-child > .record-heading,
  .record-section:first-child > .record-notes-wrap{margin-right:118px}
}
@media(max-width:380px){
  .header-content{padding-right:105px}
  .header-portrait-slot{right:0.5rem;top:0.5rem;width:88px}
  .header-portrait-slot img{width:88px;height:143px}
  .portrait-placeholder{width:88px;height:143px}
  .record-section:first-child > .record-heading,
  .record-section:first-child > .record-notes-wrap{margin-right:94px}
}

/* ---- Mode toggle ---- */
.mode-toggle{
  position:fixed;top:0.9rem;right:1rem;z-index:200;
  font-family:'Cinzel','Georgia',serif;
  font-size:0.65rem;font-weight:600;letter-spacing:0.12em;
  padding:0.32rem 0.9rem;border-radius:2px;
  border:1px solid rgba(184,145,90,0.35);
  background:rgba(14,22,42,0.82);
  color:rgba(200,168,112,0.85);
  cursor:pointer;text-transform:uppercase;backdrop-filter:blur(4px);
  transition:all 0.15s;
}
.mode-toggle:hover{
  background:rgba(30,45,79,0.95);
  border-color:rgba(184,145,90,0.65);color:#c8a870;
}

/* ---- View mode overrides ---- */
body:not(.edit-mode) .save-bar{display:none}
body:not(.edit-mode) .drop-hint{display:none}
body:not(.edit-mode) .remove-img{display:none!important}
body:not(.edit-mode) .side-art,
body:not(.edit-mode) .extra-art{cursor:default}
body:not(.edit-mode) .side-art.has-image,
body:not(.edit-mode) .extra-art.has-image{cursor:zoom-in}

/* Read-only note styling */
.record-notes[readonly]{
  border-color:transparent;background:transparent;
  cursor:default;padding-left:0;padding-right:0;
}
.record-notes[readonly]:focus{
  outline:none;border-color:transparent;background:transparent;
}
.track-notes[readonly]{
  border-color:transparent;background:transparent;
  cursor:default;padding-left:0;padding-right:0;margin-top:0.15rem;
}
.track-notes[readonly]:focus{
  outline:none;border-color:transparent;background:transparent;
}

/* ---- Lightbox ---- */
#lightbox{
  display:none;position:fixed;inset:0;
  background:rgba(0,0,0,0.93);z-index:300;
  align-items:center;justify-content:center;cursor:zoom-out;
}
#lightbox.active{display:flex}
#lightbox img{
  max-width:90vw;max-height:90vh;object-fit:contain;
  border-radius:2px;box-shadow:0 16px 60px rgba(0,0,0,0.6);cursor:default;
}
#lightbox-close{
  position:fixed;top:1rem;right:1rem;
  width:36px;height:36px;border-radius:50%;
  border:1px solid rgba(255,255,255,0.18);
  background:rgba(255,255,255,0.07);
  color:#fff;font-size:20px;line-height:36px;
  text-align:center;cursor:pointer;display:none;padding:0;
  transition:background 0.15s;
}
#lightbox-close:hover{background:rgba(255,255,255,0.16)}
#lightbox.active #lightbox-close{display:block}
