/* I Am With You — base layout. Colours and anything a look changes come from tokens set in
   css/themes/<look>.css under :root[data-look="…"]. --shade comes from the scene catalogue. */
/* I Am With You — prototype styles. Deliberately plain: the look comes from the mockups. */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.45 var(--font);
  overflow: hidden;
}
[hidden] { display: none !important; }

#scene {
  position: fixed; inset: -4%;
  background: var(--bg) center / cover no-repeat;
  animation: drift 80s ease-in-out infinite alternate;
}
#scene::after { content: ""; position: absolute; inset: 0; background: linear-gradient(var(--wash-dir, 90deg), rgb(var(--wash) / var(--shade)), rgb(var(--wash) / calc(var(--shade) * .45)) 60%, rgb(var(--wash) / calc(var(--shade) * .2))); }
:root[data-text-side="right"] { --wash-dir: 270deg; }
body.still #scene { animation: none; }
@keyframes drift { from { transform: scale(1.0) translate(0, 0); } to { transform: scale(1.06) translate(-1.5%, -1%); } }
@media (prefers-reduced-motion: reduce) { #scene { animation: none; } }

#timeline { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 5; }
#timeline i { display: block; height: 100%; width: 0; background: var(--gold); transition: width 1s linear, box-shadow 2s; }
#timeline.done i { box-shadow: 0 0 12px var(--gold); }

.card {
  position: relative; z-index: 2;
  max-width: 560px; margin: 6vh auto; padding: 28px 30px;
  background: var(--card); border-radius: 14px;
  max-height: 88vh; overflow: auto;
}
.card.wide { max-width: 920px; }
h1 { font-size: 30px; line-height: 1.2; margin: 4px 0 16px; font-weight: 600; }
h2 { font-size: 20px; margin: 18px 0 8px; }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: 13px; color: var(--gold); margin: 0; }
.sub, .fine, .hint { color: var(--dim); }
.hint { font-size: 14px; font-weight: 400; }
.fine { font-size: 15px; }
.q { font-size: 22px; }
.warn { color: var(--gold); font-weight: 600; }
label { display: block; margin: 12px 0; font-weight: 600; }
input, textarea, select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  font: inherit; font-weight: 400; color: #1d2433; background: #fffdf7;
  border: 0; border-radius: 8px;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }
button, .btnlink {
  font: inherit; cursor: pointer; border: 0; border-radius: 10px;
  padding: 10px 16px; background: var(--btn); color: var(--btn-ink); font-weight: 600;
  text-decoration: none; display: inline-block;
}
button.big, .btnlink.big { font-size: 21px; padding: 14px 26px; margin: 10px 0; min-width: 200px; }
button.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--dim); }
button.link { background: none; color: var(--dim); text-decoration: underline; padding: 6px 0; font-weight: 400; }
button.danger { background: var(--danger); color: #fff; margin-top: 14px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.linkrow { display: flex; gap: 8px; }
.linkrow input { margin: 0; }
.help { background: rgba(255,255,255,.08); border-radius: 10px; padding: 6px 18px 12px; margin-top: 14px; }
.meter { height: 22px; background: rgba(255,255,255,.15); border-radius: 11px; overflow: hidden; margin: 10px 0; }
.meter i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .08s; }

.banner { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 20; background: #f3e3b3; color: #1d2433; padding: 12px 18px; border-radius: 10px; max-width: 92vw; }
.toast { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); z-index: 20; background: var(--gold); color: #1d2433; font-weight: 700; padding: 12px 20px; border-radius: 30px; }

/* room */
#v-room { position: fixed; inset: 0; z-index: 2; display: grid; grid-template-rows: auto auto 1fr auto; padding: 22px 36px 14px; }
body.hostopen #v-room { right: 340px; }
.top { display: flex; justify-content: space-between; align-items: baseline; }
.rtitle { font-size: 18px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.count { color: var(--dim); margin-left: 10px; }
.clock { font-size: 20px; color: var(--dim); font-variant-numeric: tabular-nums; }
.verse { max-width: 760px; margin: 3vh 0 1vh; transition: opacity 2.4s; }
.verse p { font-size: clamp(22px, 2.6vw, 34px); line-height: 1.3; margin: 0 0 6px; font-weight: 300; }
.verse cite { color: var(--gold); font-style: normal; letter-spacing: .08em; font-size: 15px; }
.verse.fade { opacity: 0; }
.waiting { font-size: 22px; color: var(--gold); margin: 2vh 0; }
.lists { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; max-width: 900px; align-content: start; overflow: hidden; }
.group h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .16em; color: var(--gold); font-weight: 600; }
.group ul { list-style: none; margin: 0; padding: 0; }
.group li { font-size: clamp(17px, 1.5vw, 21px); padding: 5px 10px; margin: 2px 0; border-radius: 8px; color: var(--dim); transition: background .6s, color .6s; }
.group li.now { background: rgba(232, 196, 106, .22); color: var(--ink); font-weight: 600; }
.group li.done { opacity: .55; }
.dock { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 10px; }
button.mic { font-size: 21px; padding: 14px 24px; min-width: 230px; }
button.mic.live { background: var(--gold); box-shadow: 0 0 0 4px rgba(232,196,106,.35); }
.pill { background: rgba(255,255,255,.14); padding: 6px 12px; border-radius: 20px; }
.vol { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; color: var(--dim); }
.vol input { width: 120px; margin: 0; padding: 0; background: none; }
.typeform { position: fixed; z-index: 6; bottom: 86px; left: 36px; display: flex; gap: 8px; width: min(600px, 90vw); }
.typeform input { margin: 0; }

@media (max-width: 700px) {
  body { font-size: 17px; }
  #v-room { padding: 14px 16px 10px; }
  body.hostopen #v-room { right: 0; }
  .lists { grid-template-columns: 1fr; overflow: auto; }
  .verse p { font-size: 21px; }
  button.mic { flex: 1 1 100%; }
  .typeform { left: 16px; }
  #hostpanel { width: 100% !important; }
}

/* host */
#hostpanel { position: fixed; top: 0; right: 0; bottom: 0; width: 340px; z-index: 8; background: var(--panel); padding: 16px 18px; overflow: auto; border-left: 1px solid rgba(255,255,255,.12); }
.hp-head { display: flex; justify-content: space-between; align-items: center; }
#hostpanel h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); margin: 18px 0 6px; }
.hp-nav { display: flex; gap: 8px; }
.hp-nav button { flex: 1; }
#h-people, #h-inbox { list-style: none; padding: 0; margin: 0; font-size: 16px; }
#h-people li { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
#h-people li .nm { flex: 1; }
#h-people li.speaking .nm { color: var(--gold); font-weight: 700; }
#h-people li .tag { font-size: 12px; background: rgba(255,255,255,.14); padding: 2px 8px; border-radius: 10px; }
#h-people li .tag.alert { background: var(--danger); }
#h-people li button { padding: 2px 8px; font-size: 13px; }
#h-inbox li { padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.dim { color: var(--dim); }
.showpanel { position: fixed; right: 14px; top: 50px; z-index: 8; }
.remind { position: fixed; right: 360px; top: 60px; z-index: 9; background: var(--card); border: 1px solid var(--gold); padding: 12px 16px; border-radius: 10px; transition: opacity 1.5s; }
.credit { position: fixed; bottom: 4px; right: 12px; z-index: 3; margin: 0; font-size: 12px; color: rgba(251,247,238,.5); }

/* create: length dial + scenes + my meetings */
.setup { display: grid; grid-template-columns: 260px 1fr; gap: 24px; margin: 8px 0 4px; }
@media (max-width: 700px) { .setup { grid-template-columns: 1fr; } }
.lbl { display: block; font-weight: 600; margin-bottom: 6px; }
.dial { width: 220px; height: 220px; touch-action: none; cursor: grab; display: block; outline: none; }
.dial:focus-visible .track { stroke: var(--gold); }
.dial .track { fill: rgba(255,255,255,.06); stroke: rgba(255,255,255,.18); stroke-width: 14; }
.dial .arc { fill: none; stroke: var(--gold); stroke-width: 14; stroke-linecap: round; }
.dial .knob { fill: #fffdf7; stroke: var(--gold); stroke-width: 4; }
.dial .num { fill: var(--ink); font-size: 46px; font-weight: 300; }
.dial .unit { fill: var(--dim); font-size: 15px; letter-spacing: .1em; }
.dial .tick { stroke: rgba(255,255,255,.35); stroke-width: 2; }
.dial .tlabel { fill: var(--dim); font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; max-width: 240px; margin-top: 8px; }
.chips button { padding: 6px 11px; font-size: 15px; background: rgba(255,255,255,.12); color: var(--ink); }
.chips button.on { background: var(--gold); color: #1d2433; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.themes button { position: relative; height: 92px; padding: 0; border-radius: 10px; background-size: cover; background-position: center; box-shadow: inset 0 0 0 3px transparent; overflow: hidden; }
.themes button span { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px; font-size: 13px; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.7)); text-align: left; }
.themes button.on { box-shadow: inset 0 0 0 4px var(--gold), 0 0 0 2px var(--gold); }
.themes.small { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.themes.small button { height: 54px; }
.themes.small button span { font-size: 11px; padding: 2px 5px; }
.mine { list-style: none; padding: 0; margin: 0; }
.mine li { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.1); flex-wrap: wrap; }
.mine li b { flex: 1; }
.mine li button { padding: 6px 12px; font-size: 15px; }

/* host panel v2: scrolling body, one fixed main action at the bottom */
#hostpanel { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
#hostpanel[hidden] { display: none !important; }
.hp-head { padding: 14px 18px 8px; gap: 10px; }
.htime { flex: 1; text-align: center; color: var(--gold); font-variant-numeric: tabular-nums; font-size: 15px; }
.hp-body { flex: 1; overflow: auto; padding: 0 18px 12px; }
.hp-body section { margin-bottom: 4px; }
.hp-hint { margin: 0 0 8px; font-size: 14px; color: var(--dim); }
.row.tight { gap: 8px; }
.row.tight button { flex: 1; padding: 9px 10px; font-size: 15px; }
.invite { background: rgba(232,196,106,.12); border: 1px solid rgba(232,196,106,.35); border-radius: 10px; padding: 2px 12px 12px; margin-top: 4px; }
.invite.compact { background: none; border: 0; padding: 0; }
.invite.compact h3, .invite.compact .hp-hint { display: none; }
.invite.compact .row.tight button { padding: 6px 10px; font-size: 14px; }
.hitems { list-style: none; padding: 0; margin: 0; font-size: 15px; }
.hitems li { padding: 6px 8px; border-radius: 8px; cursor: pointer; color: var(--dim); display: flex; gap: 8px; align-items: baseline; }
.hitems li:hover { background: rgba(255,255,255,.07); }
.hitems li .k { flex: 0 0 44px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); opacity: .8; }
.hitems li.now { background: rgba(232,196,106,.25); color: var(--ink); font-weight: 600; }
.hitems li.done { opacity: .5; }
button.move { width: 100%; margin-top: 8px; text-align: left; font-weight: 400; font-size: 15px; background: rgba(255,255,255,.12); color: var(--ink); }
button.move b { color: var(--gold); }
button.small { padding: 5px 10px; font-size: 14px; margin-top: 6px; }
.badge { background: var(--gold); color: #1d2433; border-radius: 10px; padding: 1px 8px; font-size: 11px; letter-spacing: 0; margin-left: 6px; }
#h-inbox li.new { color: var(--gold); }
details.scenes { margin-top: 12px; }
details.scenes summary { cursor: pointer; color: var(--gold); font-size: 13px; text-transform: uppercase; letter-spacing: .14em; padding: 6px 0; }
.hp-foot { padding: 12px 18px 16px; border-top: 1px solid rgba(255,255,255,.12); background: rgba(10,14,24,.5); }
button.begin { width: 100%; font-size: 21px; padding: 15px; background: var(--gold); box-shadow: 0 0 0 4px rgba(232,196,106,.25); animation: glow 2.6s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 8px rgba(232,196,106,.12); } }
@media (prefers-reduced-motion: reduce) { button.begin { animation: none; } }
button.endbtn { width: 100%; background: transparent; color: #f0a39b; box-shadow: inset 0 0 0 2px #b4443a; }
button.endbtn:hover { background: #b4443a; color: #fff; }
.sounds { display: flex; flex-wrap: wrap; gap: 6px; }
.sounds button { padding: 7px 12px; font-size: 15px; background: rgba(255,255,255,.12); color: var(--ink); }
.sounds button.on { background: var(--gold); color: #1d2433; }
.sounds.small button { font-size: 13px; padding: 5px 9px; }

/* host editing + lobby */
.hrow { display: flex; justify-content: space-between; align-items: baseline; }
button.mini { font-size: 13px; padding: 0; letter-spacing: 0; text-transform: none; }
.hitems li input { flex: 1; margin: 0; padding: 5px 8px; font-size: 15px; }
.hitems li .x { background: none; color: #f0a39b; padding: 2px 6px; font-size: 16px; }
.hitems.editing li { cursor: default; }
.editbar { display: flex; gap: 6px; margin-top: 6px; }
.editbar button { margin: 0; }
.hverses { list-style: none; padding: 0; margin: 0; font-size: 14px; color: var(--dim); }
.hverses li { padding: 3px 0; }
.hverses li b { color: var(--ink); font-weight: 600; }
#h-vbox textarea { font-size: 14px; margin-top: 0; }
.previewnote { margin-top: 14px; font-style: italic; }

/* home: meeting cards */
.mine li { gap: 12px; padding: 12px 0; }
.mine .thumb { width: 72px; height: 48px; border-radius: 8px; background-size: cover; background-position: center; flex: 0 0 auto; }
.mine .info { flex: 1; min-width: 160px; }
.mine .info b { display: block; font-size: 19px; }
.mine .info span { color: var(--dim); font-size: 14px; }
.mine .go { font-size: 17px; padding: 10px 18px; }
#v-home .big { margin-top: 18px; }

/* names on screen (host's choice) */
.names { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-width: 760px; }
.names span { font-size: 15px; padding: 3px 11px; border-radius: 14px; background: rgba(10,14,24,.45); color: var(--dim); transition: color .4s, box-shadow .4s, background .4s; }
.names span.speaking { color: #1d2433; background: var(--gold); box-shadow: 0 0 14px rgba(232,196,106,.7); }
.switch { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; font-weight: 400; font-size: 15px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 38px; height: 22px; border-radius: 11px; background: rgba(255,255,255,.25); position: relative; flex: 0 0 auto; transition: background .3s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .3s; }
.switch input:checked + .track { background: var(--gold); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- added in the app foundation ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; margin: 0; z-index: 30; color: var(--dim); }
.lbl.gap { margin-top: 14px; }
.looks { display: flex; flex-wrap: wrap; gap: 8px; }
.looks button { display: flex; align-items: center; gap: 8px; padding: 7px 12px; font-size: 15px; background: rgba(255,255,255,.12); color: var(--ink); }
.looks button.on { background: var(--gold); color: var(--btn-ink); }
.looks.small button { font-size: 13px; padding: 5px 9px; }
.swatch { width: 18px; height: 18px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.swatch-first-light { background: linear-gradient(135deg, #1a2130 50%, #e8c46a 50%); }
.swatch-meeting-house { background: linear-gradient(135deg, #f3eee3 50%, #5b6b4e 50%); }
label.check { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-weight: 400; }
label.check input { width: auto; display: inline; margin: 0; }
#h-people li button.remove { color: #f0a39b; font-size: 12px; padding: 2px 4px; }
