/* uke log — warm paper, wood and a coral accent. */

:root {
  --paper: #fbf7f0;
  --card: #ffffff;
  --ink: #241d17;
  --ink-soft: #6d6055;
  --ink-faint: #a1968b;
  --line: #e6ddd0;
  --accent: #d4553b;
  --accent-soft: #f8e3dd;
  --warm: #c9873a;
  --good: #4f7a52;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 42, 26, 0.05), 0 6px 20px rgba(60, 42, 26, 0.05);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16130f;
    --card: #201b16;
    --ink: #f0e8dd;
    --ink-soft: #b3a496;
    --ink-faint: #7d7065;
    --line: #332b23;
    --accent: #f0765a;
    --accent-soft: #3a2119;
    --warm: #d99a4e;
    --good: #7fae83;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 620; letter-spacing: -0.01em; }
h2 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--ink-soft); }
p { margin: 0; }
em { font-style: normal; color: var(--ink-soft); }

a { color: var(--accent); }

/* ---------- chrome ---------- */

.top {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}
.brand span { color: var(--accent); }

.top nav { display: flex; gap: 0.25rem; margin-left: auto; }
.top nav a {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
}
.top nav a:hover { background: var(--paper); color: var(--ink); }
.top nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.out button {
  background: none;
  border: 0;
  color: var(--ink-faint);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.35rem 0;
  font-family: inherit;
}
.out button:hover { color: var(--accent); }

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.foot {
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.78rem;
  padding: 0 1rem 2.5rem;
}

.flash {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
}
.flash.err { font-weight: 600; }

.hint { color: var(--ink-faint); font-size: 0.83rem; }
.empty { color: var(--ink-faint); font-size: 0.92rem; padding: 1rem 0; text-align: center; }
.muted { color: var(--ink-faint); }

/* ---------- forms ---------- */

input, select, button, textarea { font-family: inherit; font-size: 1rem; }

input[type="text"], input[type="password"], input[type="number"],
input[type="date"], input:not([type]), select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.95rem;
}
input:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: transparent;
}

button {
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 0.6rem 1rem;
  font-weight: 500;
}
button:hover { border-color: var(--ink-faint); }

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
button.primary:hover { filter: brightness(1.06); }

button.ghost { background: transparent; color: var(--ink-soft); }
button.danger { background: transparent; border-color: var(--line); color: var(--accent); font-size: 0.88rem; }

label { display: block; font-size: 0.82rem; color: var(--ink-soft); font-weight: 500; }
label input, label select { margin-top: 0.25rem; }

/* ---------- panels ---------- */

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.panel.warn { border-color: var(--accent); }

/* ---------- the timer ---------- */

.timer-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}

.today-line { font-size: 0.9rem; color: var(--ink-soft); }
.today-line strong { color: var(--ink); font-weight: 650; }

#timer-form { display: flex; flex-direction: column; gap: 0.85rem; }

.clock {
  font-family: var(--mono);
  font-size: clamp(3.2rem, 15vw, 4.6rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
  line-height: 1;
  padding: 0.4rem 0;
  transition: color 0.25s;
}
.clock.running { color: var(--accent); }

.timer-actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }
.timer-actions button { min-width: 8rem; padding: 0.7rem 1.2rem; }

.manual { text-align: left; border-top: 1px solid var(--line); padding-top: 0.9rem; }
.manual summary {
  cursor: pointer;
  font-size: 0.86rem;
  color: var(--ink-soft);
  list-style: none;
}
.manual summary::-webkit-details-marker { display: none; }
.manual summary::before { content: "+ "; color: var(--accent); font-weight: 700; }
.manual[open] summary::before { content: "− "; }

.manual-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin: 0.9rem 0 0.6rem;
}
.manual-form select, .manual-form input[name="note"], .manual-form button { grid-column: 1 / -1; }

/* ---------- entries ---------- */

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
td { padding: 0.6rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num { text-align: right; font-family: var(--mono); font-size: 0.87rem; white-space: nowrap; }
td.when { color: var(--ink-faint); font-size: 0.8rem; white-space: nowrap; width: 8.5rem; }
td.row-act { width: 2rem; text-align: right; }
td.row-act button {
  border: 0; background: none; color: var(--ink-faint);
  padding: 0 0.3rem; font-size: 1.1rem; line-height: 1;
}
td.row-act button:hover { color: var(--accent); }

.note { display: block; color: var(--ink-faint); font-size: 0.82rem; }

.kind {
  display: inline-block;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink-faint);
  vertical-align: 1px;
  margin-right: 0.3rem;
}
.kind-song { background: var(--accent-soft); color: var(--accent); }
.kind-drill { color: var(--warm); }

/* ---------- songs ---------- */

.add-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.add-form input[name="title"], .add-form input[name="chords"],
.add-form input[name="notes"], .add-form input[name="name"],
.add-form button { grid-column: 1 / -1; }

.songs { display: flex; flex-direction: column; gap: 0.85rem; }

.song {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.song header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.song h3 { font-size: 1.05rem; }
.artist { color: var(--ink-soft); font-size: 0.88rem; }
.song-notes { font-size: 0.9rem; color: var(--ink-soft); }
.standing { font-size: 0.82rem; color: var(--ink-faint); font-family: var(--mono); }

.pill {
  font-size: 0.7rem;
  font-weight: 650;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  white-space: nowrap;
  border: 1px solid var(--line);
}
.pill-learning { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill-polishing { color: var(--warm); }
.pill-repertoire { color: var(--good); }

.edit summary { cursor: pointer; font-size: 0.82rem; color: var(--ink-faint); }
.edit form { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.7rem; }
.edit-actions { display: flex; gap: 0.5rem; }

.drills { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.drills li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.drills li:last-child { border-bottom: 0; }
.drills button { border: 0; background: none; color: var(--ink-faint); font-size: 1.05rem; padding: 0 0.3rem; }
.drills button:hover { color: var(--accent); }

/* ---------- chord chips ---------- */

.chords { display: flex; flex-wrap: wrap; gap: 0.55rem; }

.chord {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.4rem 0.45rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  min-width: 3rem;
}
.chord-name { font-size: 0.76rem; font-weight: 650; font-family: var(--mono); }
.chord-bare { padding: 0.45rem 0.7rem; justify-content: center; }
.chord-bare .chord-name { font-size: 0.85rem; color: var(--ink-soft); }

.chord-svg { width: 40px; height: 50px; display: block; }
.chord-svg .nut { fill: var(--ink); }
.chord-svg .fret { stroke: var(--line); stroke-width: 1; }
.chord-svg .string { stroke: var(--ink-faint); stroke-width: 0.9; }
.chord-svg .dot { fill: var(--accent); }
.chord-svg .open { fill: none; stroke: var(--ink-faint); stroke-width: 1.1; }

/* ---------- the month ---------- */

.month-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.month-head h1 { font-size: 1.5rem; }
.nav-month {
  text-decoration: none;
  color: var(--ink-faint);
  font-size: 1.25rem;
  width: 2rem;
  text-align: center;
  border-radius: 8px;
}
.nav-month:hover { color: var(--accent); background: var(--card); }
.nav-month.spacer { visibility: hidden; }

.verdict {
  font-size: 1.12rem;
  line-height: 1.45;
  color: var(--ink);
  border-left: 3px solid var(--accent);
  padding-left: 0.9rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.6rem;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 0.75rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat b {
  display: block;
  font-size: 1.35rem;
  font-weight: 600;
  font-family: var(--mono);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat b i { font-style: normal; color: var(--ink-faint); font-size: 0.95rem; }
.stat span { font-size: 0.7rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em; }

.calendar {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 110px;
  padding-top: 0.5rem;
}
.bar {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  min-width: 0;
  position: relative;
}
.bar-fill {
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
}
.bar.zero .bar-fill { background: var(--line); height: 3px !important; border-radius: 2px; }
.bar-day {
  font-size: 0.55rem;
  color: var(--ink-faint);
  text-align: center;
  font-family: var(--mono);
  padding-top: 3px;
}
.bar:nth-child(even) .bar-day { visibility: hidden; }

.parts td:first-child { width: 45%; }
.share { width: 30%; display: flex; align-items: center; gap: 0.5rem; }
.share-bar {
  flex: 1;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  min-width: 40px;
}
.share-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.share span { font-size: 0.72rem; color: var(--ink-faint); font-family: var(--mono); width: 2.4rem; text-align: right; }

.neglected { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.neglected li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.neglected li:last-child { border-bottom: 0; }
.n-title { font-weight: 550; }
.n-gap { margin-left: auto; color: var(--accent); font-size: 0.8rem; font-family: var(--mono); white-space: nowrap; }
.neglected button { font-size: 0.8rem; padding: 0.3rem 0.6rem; }

/* ---------- the gate ---------- */

.gate-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.5rem; }
.gate {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  width: 100%;
  max-width: 25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.gate h1 { font-size: 1.5rem; letter-spacing: -0.03em; }
.gate h1 span { color: var(--accent); }
.gate .lede { color: var(--ink-soft); font-size: 0.94rem; }
.gate form { display: flex; flex-direction: column; gap: 0.6rem; }
.gate button {
  margin-top: 0.3rem;
  padding: 0.7rem;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

@media (max-width: 480px) {
  .manual-form, .add-form { grid-template-columns: 1fr; }
  .top nav { order: 3; width: 100%; margin-left: 0; justify-content: space-between; }
  .out { margin-left: auto; }
  td.when { width: auto; }
}
