@font-face {
  font-family: 'Suez One';
  src: url('../Fonts/Cousine,Varela_Round/Suez_One/SuezOne-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

:root { font-family: system-ui, sans-serif; }
body { margin: 0; background: #f6f7f9; color: #111; }
code { background: #eef1f4; padding: 2px 6px; border-radius: 6px; }

.topbar {
  position: sticky; top: 0;
  background: white; border-bottom: 1px solid #e2e6ea;
  padding: 10px 12px; z-index: 10;
}


.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.left { display: flex; gap: 8px; align-items: center;  }
.right { display: flex; gap: 10px; align-items: center; }


button { padding: 6px 10px; border: 1px solid #c9d2db; background: white; border-radius: 8px; cursor: pointer; }
button.primary { border-color: #2b6cb0; background: #2b6cb0; color: white; }

.status { margin-left: 8px; font-size: 13px; color: #444; }
.db-status {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #c9d2db;
  color: #2f855a;
  background: #f0fff4;
}
.db-status.bad {
  color: #c53030;
  background: #fff5f5;
  border-color: #feb2b2;
}
.db-status.pending {
  color: #444;
  background: #f7fafc;
}

.layout { padding: 12px; display: grid; gap: 12px; }
.panel { background: white; border: 1px solid #e2e6ea; border-radius: 12px; padding: 12px; }
.panel h2 { margin: 0 0 12px 0; display: flex; align-items: center; justify-content: space-between; }
.panel h2 button { margin-left: 8px; }

.grid.collapsed { display: none; }

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}
.grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.grid input, .grid select {
  padding: 8px; border: 1px solid #c9d2db; border-radius: 10px;
}

.split { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; align-items: start; }
.split-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

textarea#body {
  width: 100%; 
  height: 1260px;
  max-width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  border: 1px solid #c9d2db; border-radius: 12px;
  padding: 10px;
  resize: vertical;
  /* Use the Unicode 'plaintext' mode so mixed Hebrew/English lines keep correct word ordering */
  unicode-bidi: plaintext;
} 

.hint { font-size: 13px; color: #444; }
.hint.small { font-size: 12px; color: #666; margin-top: -4px; }

.preview {
  border: 1px solid #c9d2db;
  border-radius: 12px;
  padding: 12px;
  background: #fcfcfd;
  height: 1260px;
  box-sizing: border-box;
  overflow-y: auto;
  column-count: 2;
  column-gap: 20px;
  column-rule: 1px solid #e2e6ea;
}

.preview.col-1 { column-count: 1; column-rule: none; }
.preview.col-2 { column-count: 2; column-rule: 1px solid #e2e6ea; }
.preview.col-3 { column-count: 3; column-rule: 1px solid #e2e6ea; }
.preview.col-4 { column-count: 4; column-rule: 1px solid #e2e6ea; }

/* Per-song direction */
.preview.rtl { direction: rtl; }
.preview.ltr { direction: ltr; }

/* Chord line layout (GRID by beats) */
.song-line { margin-bottom: 9px; position: relative; }

/* ===== PREVIEW ELEMENT TYPES =====
 * 
 * The preview consists of three distinct element types:
 * 
 * 1. LYRICS - The song text/words displayed in black using Suez One font.
 *    Each character is a clickable span that can be anchored to chords.
 * 
 * 2. POINTER SLASHES - Small "/" characters visually positioned between the chord and lyric.
 *    Each slash is anchored to a specific lyric letter both logically and visually.
 *    Styled with pink color (RGB 210,53,128), bold weight (900), smaller size.
 * 
 * 3. CHORDS - Musical chord symbols (e.g., Am, F, C) displayed above the pointer slashes.
 *    Each chord is anchored to a lyric letter and centered above its corresponding pointer slash.
 *    Styled with pink color (RGB 210,53,128), bold weight (700), using Suez One font.
 * 
 * Visual hierarchy (top to bottom):
 *   CHORD (e.g., "Am")
 *      ↓
 *   POINTER SLASH ("/")
 *      ↓
 *   LYRIC (e.g., "א")
 * 
 * ===== END PREVIEW ELEMENT TYPES =====
 */

/* ===== Chord notation like the example (chord above / or \) ===== */

:root {
  --chord-purple: #D23580; /* RGB(210, 53, 128) */
  --font-scale: 1; /* default scale for preview fonts */
}
/* Simplified: inline chord anchors (no meter grid) */

/* container for one-or-more chords attached to a lyric character */
.chords {
  position: absolute;
  bottom: 65%; /* visually ~1px above lyrics (tuned via inspector) */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: center;
  white-space: nowrap;
  pointer-events: auto;
  z-index: 2;
  cursor: pointer;
}

/* slash divider between chord and lyric */
/* RTL uses forward slash /, LTR uses backslash \ */
.preview.rtl .chords::after {
  content: '/';
  font-size: 0.315em;
  color: var(--chord-purple);
  line-height: 1;
  margin-top: -3px;
  font-family: 'Suez One', serif;
  font-weight: 900;
  -webkit-text-stroke: 1px var(--chord-purple);
  text-stroke: 1px var(--chord-purple);
  transform: scaleX(1.3);
}

.preview.ltr .chords::after {
  content: '\\';
  font-size: 0.315em;
  color: var(--chord-purple);
  line-height: 1;
  margin-top: -3px;
  font-family: 'Suez One', serif;
  font-weight: 900;
  -webkit-text-stroke: 1px var(--chord-purple);
  text-stroke: 1px var(--chord-purple);
  transform: scaleX(1.3);
}

.ch {
  font-weight: 400;
  color: var(--chord-purple);
  direction: ltr; /* chord symbols always LTR */
  white-space: nowrap;
  font-size: 0.76em;
  line-height: 1;
  font-family: 'Suez One', serif;
  cursor: pointer;
}

.ch:hover,
.chords:hover .ch {
  background: rgba(210, 53, 128, 0.15);
  border-radius: 2px;
  padding: 0 2px;
}

/* reserve space above lyric lines so chords don't overlap text */
.lyrics {
  padding-top: 0px;
} 
/* Inline chord anchors above lyric characters */
.lyr-ch {
  display: inline-block;
  position: relative;
}
.lyr-ch:hover {
  background: rgba(43,108,176,0.12);
  border-radius: 4px;
}

/* Chord insertion placeholders at line start/end */
.chord-placeholder {
  display: inline-block;
  position: relative;
  cursor: pointer;
  color: rgba(210, 53, 128, 0.3);
  font-size: calc(12px * var(--font-scale));
  font-weight: 600;
  padding: 0 4px;
  margin: 0 2px;
  user-select: none;
  opacity: 0.4;
  transition: opacity 0.2s, color 0.2s;
}

.chord-placeholder:hover {
  opacity: 1;
  color: var(--chord-purple);
  background: rgba(210, 53, 128, 0.08);
  border-radius: 3px;
}



.meter-mark {
  grid-row: 2;
  text-align: center;
  font-weight: 800;
  color: var(--chord-purple);
  line-height: 1;
  user-select: none;
} 

/* Lyrics with per-char spans for insertion mapping */
.lyrics {
  font-size: calc(18px * var(--font-scale));
  line-height: 1.2; /* compact line spacing to reduce vertical gaps */
  cursor: text;
  user-select: text;
  white-space: pre-wrap;
  font-weight: 600;
  color: #000;
  font-family: 'Suez One', serif;
}
.lyr-ch {
  display: inline-block;
  position: relative;
}
.lyr-ch:hover {
  background: rgba(43,108,176,0.12);
  border-radius: 4px;
} 

/* Floating insert menu */
.menu {
  position: fixed;
  width: 240px;
  background: white;
  border: 1px solid #c9d2db;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
  z-index: 1000;
}
.menu.hidden { display: none; }
.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.menu-title {
  font-weight: 600;
  font-size: 14px;
  color: #333;
}
.nav-btn {
  padding: 4px 10px;
  font-size: 16px;
  font-weight: bold;
  border: 1px solid #c9d2db;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  min-width: 32px;
}
.nav-btn:hover {
  background: #f0f0f0;
}
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.menu-row label { font-size: 13px; color: #333; }
.menu-row input, .menu-row select {
  flex: 1;
  padding: 8px;
  border: 1px solid #c9d2db;
  border-radius: 10px;
}
.menu-actions { display: flex; justify-content: flex-end; gap: 8px; }

.dev-info {
  border-top: 1px solid #e2e6ea;
  background: #fafbfc;
  padding: 10px 12px 14px;
  font-size: 12px;
  color: #444;
}
.dev-info-title {
  font-weight: 600;
  margin-bottom: 6px;
}
.dev-info-body {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
}
