/* The writing page (writing days): the studio's writing-day look from Session Assistant (colours set by writing.js),
   light or dark, the title in the page's own font. No emoji: icons are flat SVG. */
@font-face { font-family: "Sedgwick Ave Display"; src: url("/writing/fonts/SedgwickAveDisplay-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  --bg: #f1f1f3; --card: #ffffff; --text: #1d1d1f; --muted: #6e6e76; --line: #e3e3e8; --soft: #f6f6f8;
  --accent: #1f3a8a; --on-accent: #ffffff; --detail: #f0603f; --wave: #d5dcea; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 24px rgba(0,0,0,.05);
  color-scheme: light;
}
:root.dark { --text: #f2f2f4; --muted: #a2a3ab; --line: #3d3e43; --detail: #ff7556; --shadow: none; color-scheme: dark; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; width: 100%; }
input:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 0; border-color: transparent; }
.dim { color: var(--muted); }
[hidden] { display: none !important; }
svg { display: block; }
.ic svg { width: 16px; height: 16px; }

.mast { max-width: 1040px; width: 100%; margin: 0 auto; padding: 22px 16px 0; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.wd { margin: 0; font-family: "Sedgwick Ave Display", cursive; font-weight: 400; font-size: clamp(40px, 8vw, 72px); line-height: 1;
  color: var(--accent); text-transform: lowercase; }
.at { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 18px; text-decoration: none; }
.at[href]:hover .studio-text { text-decoration: underline; }
.at img { height: 56px; width: auto; max-width: 180px; object-fit: contain; }
.studio-text { color: var(--text); font-weight: 600; }
.tools { margin-left: auto; display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.lang button { border: 0; background: none; color: var(--muted); padding: 2px 3px; font-size: 13px; }
.lang button[aria-pressed="true"] { color: var(--text); font-weight: 700; }
.round { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; padding: 0; }
.round svg { width: 16px; height: 16px; }

main { max-width: 1040px; width: 100%; margin: 0 auto; padding: 0 16px 50px; flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.center { max-width: 420px; margin: 40px auto; }
.center h2 { margin: 0 0 6px; }
.stack { display: grid; gap: 12px; margin-top: 16px; }
.stack label span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.error { color: #d93025; margin: 0; min-height: 1em; font-size: 14px; }
.primary { border: 0; background: var(--accent); color: var(--on-accent); border-radius: 9px; padding: 9px 16px; font-weight: 600; }
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 9px; padding: 6px 11px; font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px; }
.btn.on { border-color: var(--accent); color: var(--accent); }
.textlink { border: 0; background: none; color: var(--accent); padding: 0; text-decoration: underline; font-size: inherit; }

.song { margin: 26px 0 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.song h2 { margin: 0; font-size: clamp(26px, 4.5vw, 36px); letter-spacing: -.02em; }
.song .by { color: var(--muted); width: 100%; font-size: 14px; }
.facts { display: flex; gap: 6px; flex-wrap: wrap; }
.fact { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 2px 10px; font-weight: 600; font-size: 13px; }

.versions { display: flex; gap: 4px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.versions .lbl { color: var(--muted); font-size: 13px; margin-right: 6px; }
.vchip { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 4px 12px; font-weight: 600; font-size: 14px; }
.vchip.on { background: var(--text); color: var(--card); border-color: var(--text); }
.vchip .new { font-size: 10px; color: var(--detail); margin-left: 5px; font-weight: 800; letter-spacing: .04em; }
.back { border-left: 3px solid var(--accent); background: var(--card); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; font-size: 14px; }

.player .row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.play { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; padding: 0; }
.play svg { width: 20px; height: 20px; }
.play:disabled { opacity: .5; cursor: default; }
.time { font-variant-numeric: tabular-nums; font-weight: 600; }
.time small { color: var(--muted); font-weight: 400; font-size: 100%; }
.sec-now { font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
.spacer { flex: 1; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 9px; padding: 2px; background: var(--soft); }
.seg button { border: 0; background: transparent; border-radius: 7px; padding: 6px 12px; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.14); }
.seg button:disabled { opacity: .45; cursor: default; }

.wavebox { position: relative; margin: 16px 0 4px; touch-action: pan-y; }
canvas { width: 100%; height: 104px; display: block; cursor: pointer; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; background: color-mix(in srgb, var(--card) 70%, transparent); }
.sections { display: flex; gap: 2px; margin-top: 6px; min-height: 22px; }
.sections div { height: 22px; border-radius: 4px; font-size: 11px; font-weight: 600; padding: 3px 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.sections .gap { background: none; cursor: default; }
.selection { margin-top: 8px; font-size: 13px; color: var(--muted); display: flex; gap: 10px; }

.chords { display: flex; align-items: center; gap: 18px; margin-top: 12px; padding: 12px 18px; }
.chord-now { font-size: 34px; font-weight: 700; min-width: 70px; line-height: 1; letter-spacing: -.02em; }
.chord-next { color: var(--muted); font-size: 13px; }
.chord-next b { color: var(--text); font-size: 16px; }
.bars { display: flex; gap: 3px; flex: 1; overflow: hidden; }
.bars span { flex: 0 0 auto; min-width: 42px; text-align: center; border-radius: 6px; padding: 5px 4px; border: 1px solid var(--line); font-weight: 600; font-size: 12px; color: var(--muted); }
.bars span.now { border-color: var(--detail); color: var(--detail); }

.grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-top: 14px; align-items: start; }
h3 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
h3 .right { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
.clist { list-style: none; margin: 0; padding: 0; }
.clist li { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.clist li:first-child { border-top: 0; }
.av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; flex: none; }
.cbody { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cat { font-size: 12px; font-weight: 700; color: var(--accent); cursor: pointer; font-variant-numeric: tabular-nums; border: 0; background: none; padding: 0; }
.cmeta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.fixed { color: #23a559; font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.fixed svg { width: 13px; height: 13px; }
.reply { margin-top: 6px; padding: 6px 10px; border-left: 2px solid var(--accent); background: var(--soft); border-radius: 0 8px 8px 0; font-size: 13px; }
.addc { width: 100%; justify-content: center; margin-top: 10px; padding: 9px; }
.composer { margin-top: 10px; display: grid; gap: 8px; }
.composer .row { display: flex; gap: 8px; align-items: center; }
.composer .row input { max-width: 220px; }
.composer-head { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.chip { background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; font-weight: 700; font-variant-numeric: tabular-nums; }

.dl { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.dl:first-child { border-top: 0; }
.dl .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dl .nm small { display: block; color: var(--muted); }
.dl a { color: var(--accent); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); }
.dl a svg { width: 16px; height: 16px; }

.status { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); background: var(--text); color: var(--card); padding: 8px 14px;
  border-radius: 9px; font-size: 14px; opacity: 0; transition: .2s; pointer-events: none; }
.status.show { opacity: 1; transform: translate(-50%, 0); }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 18px 16px 26px; }
.foot a { color: inherit; }

@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .bars { display: none; }
  .tools { margin-left: 0; }
  .at img { height: 44px; }
  .composer .row { flex-wrap: wrap; }
  .composer .row input { max-width: none; }
}
/* the ⓧ in password fields (fields.js) */
.clearable { position: relative; display: block; }
.clearable input { padding-right: 34px; }
.clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; border: 0;
  background: var(--line); color: var(--text); font-size: 15px; line-height: 22px; padding: 0; }

/* lyrics */
.stack { display: grid; gap: 14px; align-content: start; }
.btn.small { padding: 3px 7px; }
.chk { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; color: var(--muted); }
.chk input { width: auto; }
h3 .src { font-size: 12px; font-weight: 500; color: var(--muted); }
.ly-menu { display: grid; gap: 2px; margin: -4px 0 10px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: var(--shadow); }
.ly-menu button, .ly-menu a { text-align: left; border: 0; background: none; padding: 7px 9px; border-radius: 7px; font-size: 14px; color: var(--text); text-decoration: none; }
.ly-menu button:hover, .ly-menu a:hover { background: var(--soft); }
.ly-body { font-size: 15px; line-height: 1.55; }
.ly-sec { margin: 14px 0 2px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; gap: 6px; align-items: center; border-radius: 6px; }
.ly-sec:first-child { margin-top: 0; }
.ly-block.now .ly-line { border-left-color: var(--accent); }
.ly-line { position: relative; padding: 1px 8px; margin-left: -8px; border-left: 2px solid transparent; border-radius: 0 6px 6px 0; min-height: 1.55em; }
.ly-line.edit-ok { cursor: text; }
.ly-line.edit-ok:hover { background: var(--soft); }
.ly-line.blank { min-height: .8em; }
.ly-line .mark { margin-left: 8px; font-size: 11px; color: var(--muted); text-decoration: underline dotted; cursor: pointer; border: 0; background: none; padding: 0; }
.ly-line.orig { color: var(--muted); }
.ly-line input { width: 100%; padding: 3px 6px; font-size: 15px; }
.ly-pop { margin: 2px 0 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: var(--card); }
.ly-pop .o { color: var(--muted); }
.ly-pop button { margin-top: 6px; }
.ly-empty .row { display: flex; gap: 8px; flex-wrap: wrap; }
.small { font-size: 12px; margin: 0; }
