:root {
  --ink: #111;
  --ink2: #1c1c1c;
  --cream: #f3ead8;
  --paper: #faf6ec;
  --orange: #e8621a;
  --orange-d: #c24d0f;
  --muted: #6f675b;
  --line: #e2d8c3;
  --green: #2f7d4f;
  --red: #b3261e;
  --amber: #b87503;
  --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; -webkit-tap-highlight-color: transparent; }
body.authed { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
a { color: var(--orange-d); }
h1 { font-size: 1.15rem; margin: 0; }
h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 4px 8px; }
main { max-width: 720px; margin: 0 auto; padding: 12px 14px 24px; }

.brand { font-family: Impact, "Arial Black", sans-serif; letter-spacing: .02em; color: var(--orange); text-transform: uppercase; font-size: .95rem; }
.brand.big { font-size: 2rem; }

.top { position: sticky; top: 0; z-index: 5; background: var(--ink); color: var(--cream); display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
.top .back { color: var(--cream); text-decoration: none; font-size: 1.8rem; line-height: 1; padding-right: 4px; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; background: var(--ink); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; text-align: center; padding: 14px 2px; color: #bdb5a6; text-decoration: none; font-size: .78rem; font-weight: 600; }
.tabs a.on { color: var(--orange); box-shadow: inset 0 3px 0 var(--orange); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.card.list { padding: 0; overflow: hidden; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.row:last-child { border-bottom: 0; }
.card:not(.list) > .row { padding: 0 0 8px; border: 0; }
a.row:active { background: var(--cream); }
.pad { padding: 14px; margin: 0; }
.strong { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.notes { white-space: pre-wrap; background: var(--paper); padding: 10px; border-radius: 8px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 4px; }
.stat { background: var(--ink); color: var(--cream); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.stat span { font-size: .78rem; color: #bdb5a6; }
.stat b { font-size: 1.35rem; }
.stat small { color: #bdb5a6; }
.big-money { font-size: 1.8rem; font-weight: 700; }
.neg { color: var(--red) !important; }
.stat .neg { color: #ff8a80 !important; }
.pos { color: var(--green); }
.warn { background: #fff3e0; border-left: 4px solid var(--orange); padding: 10px 12px; border-radius: 6px; font-size: .9rem; }

.pill { font-size: .72rem; font-weight: 700; padding: 4px 9px; border-radius: 99px; background: var(--cream); white-space: nowrap; }
.pill.confirmed, .pill.yes { background: #dff1e5; color: var(--green); }
.pill.played { background: var(--ink); color: var(--cream); }
.pill.cancelled, .pill.no { background: #fbe1df; color: var(--red); }
.pill.maybe, .pill.enquiry { background: #fdf0d5; color: var(--amber); }

label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 12px; }
label.inline { display: flex; align-items: center; gap: 10px; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; font: inherit; font-size: 16px; padding: 10px 11px; border: 1px solid #cfc4ad; border-radius: 8px; background: #fff; color: var(--ink); }
label.inline select { width: auto; margin: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange); border-color: transparent; }
input[type=search] { margin: 0 0 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.line { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.line input { margin: 0; }
.line input[type=time] { width: 120px; flex: none; }
.line .amt { width: 110px; flex: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: .95rem; padding: 11px 16px; border-radius: 10px; border: 1px solid #cfc4ad; background: #fff; color: var(--ink); text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.danger { color: var(--red); border-color: #e8b4b0; }
.btn.small { padding: 7px 12px; font-size: .85rem; }
.btn.block { display: flex; width: 100%; margin: 10px 0; }
.btn:disabled { opacity: .6; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btns.sticky { position: sticky; bottom: calc(60px + env(safe-area-inset-bottom)); background: var(--paper); padding: 10px 0; }
.x { border: 0; background: var(--cream); border-radius: 8px; width: 36px; height: 36px; flex: none; font-size: .9rem; cursor: pointer; }

.seg { display: inline-flex; border: 1px solid #cfc4ad; border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 8px 13px; font: inherit; font-weight: 700; cursor: pointer; }
.seg button + button { border-left: 1px solid #cfc4ad; }
.seg button.on { background: var(--ink); color: #fff; }
.seg button.on.yes { background: var(--green); }
.seg button.on.no { background: var(--red); }
.seg button.on.maybe { background: var(--amber); }
.seg.wide { display: flex; margin-bottom: 14px; }
.seg.wide button { flex: 1; }

table { width: 100%; border-collapse: collapse; }
td { padding: 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
table.money td:last-child { text-align: right; white-space: nowrap; }
table.money tr.tot td { font-weight: 700; border-top: 2px solid var(--ink); }
table.run td.t { width: 70px; font-weight: 700; white-space: nowrap; }

.set + .set { margin-top: 14px; }
.set-head { display: flex; justify-content: space-between; gap: 8px; }
.set ol, .edit-songs { margin: 8px 0 0; padding-left: 22px; }
.set li, .edit-songs li { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.set li { display: list-item; }
.set li > span:first-child { display: inline; }
.set li > span:last-child { float: right; }
.edit-songs li { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.edit-songs .x { width: 30px; height: 30px; }
.preview { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }

.bar { height: 10px; background: var(--cream); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.bar i { display: block; height: 100%; background: var(--orange); }

.login { max-width: 380px; margin: 0 auto; padding: 60px 18px; text-align: center; }
.login .card { text-align: left; margin-top: 20px; }
.login .btn { width: 100%; }

.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; z-index: 20; font-size: .9rem; max-width: 90vw; }
.toast.bad { background: var(--red); }

/* print / PDF */
.sheet { max-width: 720px; margin: 0 auto; padding: 20px; background: #fff; }
.sheet-head { display: flex; justify-content: space-between; border-bottom: 3px solid var(--orange); padding-bottom: 8px; margin-bottom: 12px; font-weight: 600; }
.sheet h1 { font-size: 1.6rem; margin: 6px 0; }
.sheet h2 { color: var(--ink); margin-top: 20px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
@media print {
  .noprint, .tabs, .top { display: none !important; }
  body { background: #fff; padding: 0 !important; }
  .sheet { padding: 0; }
  .set { break-inside: avoid; }
}

/* ===== v2: home screens, calendar, rehearsals ===== */
main.bare { padding: 0 0 24px; max-width: 720px; }
.wrap { padding: 0 16px; }
.h2 { font-size: 17px; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0; font-weight: 700; }
.h2.sp, .row-head.sp { margin-top: 22px; margin-bottom: 10px; }
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; text-decoration: none; }
.row-head a { text-decoration: none; font-size: .9rem; }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .06em; color: #B4430B; }
.eyebrow.green { color: #1F6B3E; }
.big-line { font-size: 1.1rem; }
a.plain { color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 4px; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn svg { flex: none; }

.hero { background: var(--ink); color: var(--cream); padding: calc(18px + env(safe-area-inset-top)) 20px 72px; }
.hero.mgr { padding-bottom: 18px; }
.hero-top { display: flex; justify-content: space-between; align-items: center; }
.hero h1 { font-size: 1.6rem; margin: 16px 0 2px; }
.hero p { margin: 0; color: #BDB3A2; font-size: .9rem; }
.avatar { width: 36px; height: 36px; border-radius: 18px; background: #2A2A2A; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.badge { font-size: .75rem; font-weight: 700; background: var(--cream); color: var(--ink); padding: 4px 10px; border-radius: 10px; }
.hero-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.ht { background: #232323; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; color: var(--cream); text-decoration: none; min-width: 0; }
.ht span { font-size: .68rem; font-weight: 700; letter-spacing: .05em; color: #BDB3A2; }
.ht b { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht small { font-size: .75rem; color: #BDB3A2; }
.ht.orange { background: var(--orange); color: #fff; }
.ht.orange span, .ht.orange small { color: #fff; }

.hero-card { background: #fff; border-radius: 18px; box-shadow: 0 8px 24px rgba(0,0,0,.12); margin-top: -56px; overflow: hidden; position: relative; }
.hero-card.empty { padding: 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.hero-main { display: flex; gap: 16px; padding: 18px; color: inherit; text-decoration: none; align-items: center; }
.date-block { width: 64px; flex: none; border-radius: 12px; background: var(--orange); color: #fff; display: flex; flex-direction: column; align-items: center; padding: 8px 0; }
.date-block span { font-size: .75rem; font-weight: 700; letter-spacing: .06em; }
.date-block b { font-family: Impact, "Arial Black", sans-serif; font-size: 1.9rem; line-height: 1.1; font-weight: 400; }
.hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hero-title { font-size: 1.25rem; font-weight: 700; }
.hero-actions { display: flex; gap: 10px; padding: 0 18px 18px; }
.hero-actions .btn { flex: 1; min-height: 46px; }
.hero-foot { border-top: 1px solid var(--line); padding: 12px 18px; display: flex; justify-content: space-between; align-items: center; font-size: .9rem; gap: 8px; }

.chip { align-self: flex-start; font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 7px; background: var(--cream); white-space: nowrap; }
.chip.ok { background: #DDF0E3; color: #1F6B3E; }
.chip.wait { background: #FDF0D5; color: #7A5200; }
.chip.bad { background: #FBE1DF; color: #9B2019; }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; min-width: 0; }
.tile b { font-family: Impact, "Arial Black", sans-serif; font-weight: 400; font-size: 1.7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile span { font-size: .8rem; color: var(--muted); line-height: 1.3; }

.ask { margin-top: 16px; background: #FFF4EA; border: 1px solid #F3C9A8; border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.reply3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.reply3 button { min-height: 44px; border-radius: 10px; border: 1.5px solid #CFC4AD; background: #fff; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--ink); }
.reply3 button.r-yes, .reply3 button.on.yes { background: #1F6B3E; border-color: #1F6B3E; color: #fff; }
.reply3 button.on.maybe { background: var(--amber); border-color: var(--amber); color: #fff; }
.reply3 button.on.no { background: var(--red); border-color: var(--red); color: #fff; }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.cal-h { font-size: .7rem; font-weight: 600; color: var(--muted); padding-bottom: 6px; }
.cal-c { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; border-radius: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.cal-c .n { width: 30px; height: 30px; line-height: 30px; border-radius: 15px; font-size: .88rem; }
.cal-c.out { color: #A39A8A; }
.cal-c.today .n { background: var(--ink); color: #fff; font-weight: 700; }
.cal-c.away { background: repeating-linear-gradient(135deg, #E4DDCF 0 3px, #F6F2EA 3px 6px); }
.cal-c.sel { outline: 2px solid var(--ink); background-color: #FFF4EA; }
.dots { display: flex; gap: 3px; height: 6px; }
.dots i { width: 6px; height: 6px; border-radius: 3px; }
i.gig { background: var(--orange); } i.reh { background: #2457C5; }
.cal.big { gap: 3px; }
.cal.big .cal-c { min-height: 66px; align-items: stretch; padding: 3px; background-color: var(--paper); gap: 2px; }
.cal.big .cal-c.out { background-color: transparent; }
.cal.big .cal-c.away { background: repeating-linear-gradient(135deg, #E4DDCF 0 3px, #F6F2EA 3px 6px); }
.cal-top { display: flex; justify-content: space-between; align-items: center; }
.cal.big .n { width: 22px; height: 22px; line-height: 22px; font-size: .8rem; font-weight: 600; }
.free { width: 7px; height: 7px; border-radius: 4px; background: #1F8A4C; margin-right: 2px; }
.lbl { display: block; font-size: .62rem; font-weight: 700; line-height: 15px; padding: 0 3px; border-radius: 4px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.lbl.gig { background: var(--orange); color: #3a1300; }
.lbl.reh { background: #2457C5; }
.lbl.away { background: #fff; color: #3F3A32; border: 1px solid #B9AF9C; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: .75rem; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.legend i.away { width: 12px; background: repeating-linear-gradient(135deg, #C9C0AE 0 2px, #EFEAE0 2px 4px); }
.legend i.free { width: 8px; height: 8px; border-radius: 4px; background: #1F8A4C; margin: 0; }
.cal-card { padding: 12px 8px; }
.cal-card .row-head { padding: 0 6px; }

.ev { display: flex; align-items: center; gap: 12px; padding: 12px; border-bottom: 1px solid var(--line); }
.ev:last-child { border-bottom: 0; }
.ev-date { width: 46px; flex: none; border-radius: 10px; display: flex; flex-direction: column; align-items: center; padding: 6px 0; }
.ev-date span { font-size: .68rem; font-weight: 700; }
.ev-date b { font-size: 1.2rem; line-height: 1.1; }
.ev-date.gig { background: var(--orange); color: #fff; }
.ev-date.reh { background: #2457C5; color: #fff; }
.ev-date.away { background: #E6E0D4; color: #3F3A32; }
.ev-body { flex: 1; min-width: 0; color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 3px; }
.tag { align-self: flex-start; font-size: .68rem; font-weight: 700; letter-spacing: .05em; padding: 2px 7px; border-radius: 6px; text-transform: uppercase; }
.tag.gig { color: #9A3A09; background: #FCE7D9; }
.tag.reh { color: #1E4AA8; background: #E3EBFB; }
.tag.away { color: #3F3A32; background: #ECE6DA; }
.icon-btn { width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }

.week { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 10px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.wk { min-height: 62px; border-radius: 12px; background: var(--paper); color: var(--ink); text-decoration: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.wk span { font-size: .68rem; font-weight: 600; }
.wk b { font-size: 1.05rem; }
.wk i { width: 6px; height: 6px; border-radius: 3px; }
.wk.on { background: var(--ink); color: #fff; }

.helper { margin-top: 16px; background: #EAF5EE; border: 1px solid #BFDFCB; border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0; }
.free-date { min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid #9CCBAE; background: #fff; color: #1F4D31; font-weight: 600; font-size: .88rem; display: inline-flex; align-items: center; text-decoration: none; }
.waiting { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: inherit; text-decoration: none; margin-top: 12px; }
.group { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .07em; color: var(--muted); margin: 6px 4px 8px; }

.fab-wrap { position: fixed; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 6; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.fab { width: 58px; height: 58px; border-radius: 29px; border: 0; background: var(--orange); color: #fff; box-shadow: 0 6px 18px rgba(232,98,26,.4); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.fab-menu { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.15); overflow: hidden; display: flex; flex-direction: column; }
.fab-menu[hidden] { display: none; }
.fab-menu a { padding: 14px 18px; color: var(--ink); text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--line); }
.fab-menu a:last-child { border-bottom: 0; }

.who { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 10px; }
.who .chip { margin-left: auto; align-self: center; }
.av { width: 30px; height: 30px; border-radius: 15px; font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; background: var(--cream); color: var(--muted); }
.av.yes { background: #DDF0E3; color: #1F6B3E; }
.av.maybe { background: #FDF0D5; color: #7A5200; }
.av.no, .av.away { background: #FBE1DF; color: #9B2019; text-decoration: line-through; }
.away-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pill.away { background: #ECE6DA; color: #3F3A32; }
label.check { display: flex; align-items: center; gap: 10px; }
label.check input { width: 22px; height: 22px; margin: 0; }
.card .btns { margin-top: 12px; }
