/* Rise Human brand: cream ground, deep gold accents, Lora. Run screens are dark for early mornings. */
:root {
  --cream: #F5EFE2; --paper: #FFFBF2; --ink: #2A2419; --muted: #6E624E; --rule: #E2D6BE; --gold: #8A6519;
  --night: #0F0D0A; --night-2: #1E1A13; --night-ink: #EDE4D1; --night-dim: #9A907C; --night-faint: #6F6655; --night-rule: #3A3224; --night-gold: #D9AE4E;
  --hot: #A6452B; --ok: #3F6B3A;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Libre Franklin", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--sans); font-size: 15px; line-height: 1.5; background: var(--cream); color: var(--ink); -webkit-text-size-adjust: 100%; }
body.is-dark { background: var(--night); }
[hidden] { display: none !important; }
button { font: inherit; }
button:focus-visible, label:focus-visible, summary:focus-visible { outline: 2px solid var(--night-gold); outline-offset: 3px; }

.screen {
  min-height: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px;
  padding: calc(28px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
}
.screen.dark { color: var(--night-ink); height: 100%; min-height: 0; overflow: hidden; }

.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.eyebrow.dim { color: var(--night-dim); font-size: 12px; letter-spacing: .12em; }
.eyebrow.gold { color: var(--night-gold); }
.head h1 { font-family: var(--serif); font-weight: 500; font-size: 28px; line-height: 1.2; margin: 4px 0; text-wrap: balance; }
.meta, .help { font-size: 13px; color: var(--muted); }
.help.dim, .dim { color: var(--night-dim); }
.center { text-align: center; }
.narrow { max-width: 28ch; }
.label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.spacer { flex: 1; }
.strong { font-size: 15px; font-weight: 600; }

.notice { background: #F7E2D9; color: #6B2414; border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.error { color: var(--hot); font-size: 14px; }

.card { background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.filebtn { display: block; text-align: center; background: var(--ink); color: var(--cream); font-weight: 600; padding: 16px; border-radius: 12px; cursor: pointer; }
details summary { cursor: pointer; color: var(--gold); font-weight: 600; font-size: 14px; }
textarea { width: 100%; margin-top: 10px; font: 14px/1.5 var(--sans); padding: 10px; border: 1px solid var(--rule); border-radius: 10px; background: var(--cream); color: var(--ink); }

.filecard { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; background: var(--paper); }
.filename { font-size: 14px; font-weight: 600; word-break: break-word; }
.ghost { all: unset; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--gold); padding: 10px 4px; }
.center-self { align-self: center; }

.acts { display: flex; flex-direction: column; gap: 10px; }
.act { all: unset; cursor: pointer; display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 13px 14px; border-radius: 12px; background: var(--paper); border: 1px solid var(--rule); }
.act .n { font-family: var(--serif); font-size: 15px; color: var(--gold); }
.act .t { font-size: 14px; }
.act .s { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.act[aria-pressed="true"] { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.act[aria-pressed="true"] .n { color: var(--night-gold); }
.act[aria-pressed="true"] .s { color: #C9BDA5; }

.startwrap { display: flex; flex-direction: column; gap: 10px; }
.primary { all: unset; cursor: pointer; text-align: center; background: var(--ink); color: var(--cream); font-weight: 600; font-size: 17px; padding: 18px; border-radius: 14px; }
.primary:disabled { opacity: .5; cursor: default; }

/* run */
.runbar { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.clock { font-family: var(--serif); font-size: 20px; font-variant-numeric: tabular-nums; }
.progress { display: flex; flex-direction: column; gap: 6px; }
.track { height: 4px; border-radius: 2px; background: #2A251C; overflow: hidden; }
.track i { display: block; height: 100%; width: 0; background: var(--night-gold); transition: width .4s ease; }
.center-stack { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; }
.ring { width: 148px; height: 148px; border-radius: 50%; border: 1px solid var(--night-rule); display: flex; align-items: center; justify-content: center; }
.ring-in { width: 104px; height: 104px; border-radius: 50%; background: var(--night-2); border: 2px solid var(--night-gold); color: var(--night-gold); display: flex; align-items: center; justify-content: center; }
.ring.live { animation: breathe 2.4s ease-in-out infinite; }
.ring.paused .ring-in { border-color: var(--night-faint); color: var(--night-faint); }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(217, 174, 78, 0); } 50% { box-shadow: 0 0 0 14px rgba(217, 174, 78, .10); } }
.state { font-family: var(--serif); font-size: 26px; }
.heard { font-family: var(--serif); font-size: 15px; line-height: 1.5; color: var(--night-faint); text-align: center; min-height: 3em; padding-inline: 8px; overflow: hidden; }
.cue { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.cue .prev { font-family: var(--serif); font-size: 17px; line-height: 1.45; color: var(--night-faint); }
.cueline { font-family: var(--serif); font-size: clamp(26px, 8vw, 38px); line-height: 1.28; color: var(--night-gold); text-wrap: balance; }
.cuenotes { font-size: 13px; font-style: italic; color: var(--night-dim); }
.speaking { display: flex; align-items: center; justify-content: center; gap: 10px; }
.buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.outline { all: unset; cursor: pointer; text-align: center; border: 1px solid var(--night-rule); color: var(--night-ink); font-weight: 600; font-size: 16px; padding: 18px; border-radius: 14px; }
.gold-btn { all: unset; cursor: pointer; text-align: center; background: var(--night-gold); color: var(--night); font-weight: 600; font-size: 16px; padding: 18px; border-radius: 14px; }

.runtools { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: -10px; }
.ghost.gold { color: var(--night-gold); margin-left: auto; }
.livedot { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--night-dim); }
.livedot i { width: 8px; height: 8px; border-radius: 50%; background: var(--night-gold); animation: blink 1.6s ease-in-out infinite; }
.livedot.paused i { background: var(--night-faint); animation: none; }
@keyframes blink { 50% { opacity: .35; } }
.scriptview { flex: 1 1 0; min-height: 0; position: relative; }
.scriptscroll { position: absolute; inset: 0; overflow-y: auto; padding: 30% 4px 60%; -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 80%, transparent); mask-image: linear-gradient(transparent, #000 14%, #000 80%, transparent); }
.sl { padding: 6px 0 6px 12px; border-left: 2px solid transparent; transition: color .3s ease; }
.sgap { height: 18px; }
.sn { font-size: 12px; font-style: italic; color: var(--night-faint); margin-bottom: 2px; }
.st { font-family: var(--serif); font-size: 21px; line-height: 1.42; }
.sl.past .st { color: var(--night-faint); }
.sl.next .st { color: #A39A86; }
.sl.now .st .done { color: var(--night-faint); }
.sl.now .st .rest { color: var(--night-ink); }
.sl.now { border-left-color: var(--night-gold); }
.sl.cue .st, .sl.cue .st .rest, .sl.cue .st .done { color: var(--night-gold); }
.sl.cue .st { font-size: 25px; }

/* setup extras */
.cardbtns { display: flex; gap: 14px; }
.version { all: unset; cursor: pointer; align-self: center; font-size: 12px; color: var(--muted); padding: 6px 10px; }
.diag { background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.diag pre { margin: 0; font: 11px/1.45 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; color: var(--ink); }

/* reader */
.readertitle { font-family: var(--serif); font-weight: 500; font-size: 26px; margin: 0; }
.readerbody { display: flex; flex-direction: column; }
.rhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 22px 0 8px; position: sticky; top: 0; background: var(--cream); padding-block: 6px; z-index: 1; }
.rhead h2 { font-family: var(--serif); font-weight: 500; font-size: 18px; color: var(--gold); margin: 0; }
.rline, .aline { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 5px 0; font-family: var(--serif); font-size: 16px; line-height: 1.45; }
.rnum { font-family: var(--sans); font-size: 11px; color: var(--muted); text-align: right; padding-top: 4px; font-variant-numeric: tabular-nums; }
.rnote { font-family: var(--sans); font-size: 12px; font-style: italic; color: var(--gold); }
.rgap { height: 12px; }

/* score */
.bigscore { display: flex; align-items: flex-end; gap: 14px; }
.bigscore .num { font-family: var(--serif); font-size: 72px; line-height: .9; font-weight: 500; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { border: 1px solid var(--rule); border-radius: 10px; padding: 10px; background: var(--paper); }
.stat .v { font-family: var(--serif); font-size: 22px; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 12px; color: var(--muted); }
.scorebody { display: flex; flex-direction: column; gap: 0; }
.group { display: flex; flex-direction: column; gap: 8px; }
.item { font-family: var(--serif); font-size: 15px; line-height: 1.4; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.item .said { display: block; font-family: var(--sans); font-size: 13px; color: var(--muted); font-style: italic; margin-top: 4px; }
.item .where { display: block; font-family: var(--sans); font-size: 11px; color: var(--muted); letter-spacing: .04em; margin-bottom: 2px; }
.outline-light { all: unset; cursor: pointer; text-align: center; border: 1px solid #CDBF9F; font-weight: 600; font-size: 16px; padding: 16px; border-radius: 14px; color: var(--ink); }
#score .primary { font-size: 16px; padding: 16px; }

@media (prefers-reduced-motion: reduce) { .ring.live, .livedot i { animation: none; } .track i, .sl { transition: none; } }

/* annotated script on the score screen */
.legend { display: flex; flex-wrap: wrap; gap: 8px; }
.lg, .tag { font-size: 11px; font-weight: 600; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; font-family: var(--sans); }
.skip.lg, .tag.skip { background: #F3DCD3; color: #8E3420; }
.para.lg, .tag.para { background: #F4E6C8; color: #7A5410; }
.asked.lg, .tag.asked { background: #2A2419; color: #F0D48C; }
.moved.lg, .tag.moved { background: #DCE5EF; color: #2C4A6B; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 3px; }
.aline { border-left: 3px solid transparent; padding-left: 6px; margin-left: -9px; }
.aline.skip { border-left-color: #C2573A; }
.aline.skip .atext > div:not(.tags) { color: #8E3420; }
.aline.para { border-left-color: #C9952E; background: rgba(201, 149, 46, .06); }
.aline.asked { border-left-color: #2A2419; background: rgba(217, 174, 78, .12); }
.aline.moved { border-left-color: #4E7099; }
.aline .said { font-family: var(--sans); font-size: 13px; color: var(--muted); font-style: italic; margin-top: 3px; }
.ordernote { font-size: 14px; color: var(--ink); margin-bottom: 10px; }
.stopmark { margin-top: 10px; padding: 10px 12px; border: 1px dashed #CDBF9F; border-radius: 10px; font-size: 13px; color: var(--muted); text-align: center; }
