/* P45 live diagram prototype. Brand: red #CC3226, deep #9E2219, warm white #f8f4f3, Archivo + Public Sans. */
@font-face { font-family: "Archivo"; src: url("../assets/fonts/Archivo-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("../assets/fonts/PublicSans-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --red: #cc3226; --deep: #9e2219; --warm: #f8f4f3; --ink: #1d1a19; --soft: #5b4e51; --mute: #8a7c7f;
  --line: #e9dede; --tint: #fbeceb; --ok: #2f7d4f; --card: #ffffff;
  --radius: 18px; --gutter: 16px;
  --shadow: 0 1px 2px rgba(29, 26, 25, 0.06), 0 12px 32px -12px rgba(29, 26, 25, 0.18);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--warm); color: var(--ink); font-family: "Public Sans", system-ui, sans-serif; font-size: 16px; line-height: 1.5; overflow-x: hidden; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------- page chrome (index.html only) ---------------- */
.pg-ground {
  background:
    radial-gradient(ellipse 70% 60% at 100% 0%, rgba(204, 50, 38, 0.09), rgba(204, 50, 38, 0) 70%),
    radial-gradient(circle at 1px 1px, rgba(29, 26, 25, 0.07) 1.1px, rgba(29, 26, 25, 0) 1.5px) 0 0 / 28px 28px,
    var(--warm);
}
.pg-wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.pg-top { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; gap: 12px; }
.pg-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: "Archivo", sans-serif; font-weight: 800; letter-spacing: 0.02em; }
.pg-logo img { width: 40px; height: 40px; border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.pg-tag { font-size: 13px; font-weight: 600; color: var(--soft); text-transform: uppercase; letter-spacing: 0.12em; }
.pg-hero { padding: 28px 0 28px; }
.pg-eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); }
.pg-eyebrow i { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(204, 50, 38, 0.5); animation: pg-pulse 1.8s infinite; }
@keyframes pg-pulse { 0% { box-shadow: 0 0 0 0 rgba(204, 50, 38, 0.45); } 80%, 100% { box-shadow: 0 0 0 10px rgba(204, 50, 38, 0); } }
.pg-h1 { font-family: "Archivo", sans-serif; font-weight: 800; font-size: clamp(36px, 6.4vw, 84px); line-height: 0.98; letter-spacing: -0.025em; margin: 14px 0 18px; max-width: 17ch; }
.pg-h1 em { font-style: normal; color: var(--red); }
.pg-lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--soft); max-width: 58ch; }
.pg-how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 44px 0 20px; }
.pg-how div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 20px; }
.pg-how b { display: block; font-family: "Archivo", sans-serif; font-weight: 800; font-size: 15px; margin-bottom: 4px; }
.pg-how b span { color: var(--red); margin-right: 8px; }
.pg-how p { color: var(--soft); font-size: 15px; }
.pg-foot { padding: 36px 0 44px; color: var(--mute); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 36px; }
.pg-foot b { color: var(--ink); font-family: "Archivo", sans-serif; }
@media (max-width: 720px) { .pg-how { grid-template-columns: 1fr; } .pg-tag { display: none; } }

/* ---------------- the live module (index + embed) ---------------- */
.lv { width: 100%; }
.lv-card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 20px; }
.lv-form { display: flex; gap: 10px; }
.lv-field { flex: 1 1 auto; min-width: 0; position: relative; }
.lv-input {
  width: 100%; height: 56px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--warm);
  padding: 0 16px; font-size: 17px; font-weight: 500; transition: border-color 0.15s, background 0.15s;
}
.lv-input::placeholder { color: var(--mute); }
.lv-input:focus { outline: none; border-color: var(--red); background: #fff; }
.lv-go {
  flex: 0 0 auto; height: 56px; padding: 0 24px; border: 0; border-radius: 14px; background: var(--red); color: #fff;
  font-family: "Archivo", sans-serif; font-weight: 700; font-size: 17px; cursor: pointer; display: inline-flex; align-items: center; gap: 10px;
  transition: background 0.15s, transform 0.1s;
}
.lv-go:hover { background: var(--deep); }
.lv-go:active { transform: scale(0.98); }
.lv-go svg { width: 18px; height: 18px; }
.lv-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.lv-chips-k { font-size: 13px; font-weight: 600; color: var(--mute); margin-right: 4px; }
.lv-chip {
  border: 1.5px solid var(--line); background: #fff; border-radius: 100px; padding: 7px 14px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.lv-chip:hover { border-color: var(--red); color: var(--deep); }
.lv-chip[aria-pressed="true"] { background: var(--tint); border-color: var(--red); color: var(--deep); }
.lv-note { margin-top: 10px; font-size: 13px; color: var(--mute); }

.lv-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; margin-top: 18px; }
.lv-log { background: var(--ink); color: #f4ecea; border-radius: var(--radius); padding: 16px 16px 18px; font-size: 14px; min-height: 100%; display: flex; flex-direction: column; }
.lv-log-h { display: flex; align-items: center; gap: 8px; font-family: "Archivo", sans-serif; font-weight: 800; font-size: 15px; letter-spacing: 0.02em; margin-bottom: 12px; }
.lv-log-h b { width: 9px; height: 9px; background: var(--red); display: inline-block; margin-left: 1px; }
.lv-log-h span { margin-left: auto; font-family: "Public Sans", sans-serif; font-weight: 600; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: #b9a9a6; }
.lv-log ol { list-style: none; display: grid; gap: 9px; }
.lv-log li { display: grid; grid-template-columns: 16px 1fr; gap: 8px; opacity: 0; transform: translateY(6px); transition: opacity 0.3s, transform 0.3s; }
.lv-log li.on { opacity: 1; transform: none; }
.lv-log li i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--red); margin-top: 3px; position: relative; }
.lv-log li.done i { background: var(--red); }
.lv-log li.done i::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.lv-log li small { display: block; color: #b9a9a6; font-size: 12.5px; }
.lv-log-idle { color: #b9a9a6; }
.lv-log-foot { margin-top: auto; padding-top: 14px; font-size: 12px; color: #9c8d8a; }

.lv-player { min-width: 0; }
.lv-screen { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--warm); border: 1px solid var(--line); }
.lv-screen iframe { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; pointer-events: none; background: var(--warm); }
.lv-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 16px;
  background:
    radial-gradient(circle at 1px 1px, rgba(29, 26, 25, 0.08) 1.1px, rgba(29, 26, 25, 0) 1.5px) 0 0 / 24px 24px, var(--warm); }
.lv-empty b { font-family: "Archivo", sans-serif; font-weight: 800; font-size: clamp(18px, 2.4vw, 28px); }
.lv-empty span { color: var(--soft); font-size: 14px; max-width: 36ch; }
.lv-empty .lv-mark { font-family: "Archivo", sans-serif; font-weight: 800; font-size: 22px; }
.lv-empty .lv-mark i { display: inline-block; width: 10px; height: 10px; background: var(--red); margin-left: 2px; }
.lv-busy { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(248, 244, 243, 0.85); font-family: "Archivo", sans-serif; font-weight: 700; color: var(--deep); gap: 10px; }
.lv-busy.on { display: flex; }
.lv-busy i { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--tint); border-top-color: var(--red); animation: lv-spin 0.8s linear infinite; }
@keyframes lv-spin { to { transform: rotate(360deg); } }

.lv-ctrl { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.lv-btn { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.lv-btn:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.lv-btn:disabled { opacity: 0.4; cursor: default; }
.lv-btn svg { width: 18px; height: 18px; }
.lv-bar { flex: 1 1 auto; height: 44px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.lv-bar div { position: relative; width: 100%; height: 6px; background: var(--line); border-radius: 6px; }
.lv-bar div span { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--red); border-radius: 6px; }
.lv-bar div em { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; border: 3px solid var(--red); left: 0; }
.lv-time { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--soft); min-width: 74px; text-align: right; }

.lv-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.lv-mail {
  height: 46px; padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--ink); background: var(--ink); color: #fff;
  font-family: "Archivo", sans-serif; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 9px;
}
.lv-mail:disabled { opacity: 0.35; cursor: default; }
.lv-mail svg { width: 18px; height: 18px; }
.lv-link { background: none; border: 0; color: var(--deep); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 8px 4px; }
.lv-link:disabled { opacity: 0.35; cursor: default; text-decoration: none; }
.lv-stub { display: none; margin-top: 12px; border: 1.5px dashed var(--red); background: var(--tint); border-radius: 14px; padding: 14px 16px; color: var(--deep); font-size: 14.5px; }
.lv-stub.on { display: block; }
.lv-stub b { font-family: "Archivo", sans-serif; }

.lv-text { display: none; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; font-size: 15px; }
.lv-text.on { display: block; }
.lv-text h3 { font-family: "Archivo", sans-serif; font-weight: 800; font-size: 17px; margin-bottom: 6px; }
.lv-text dl { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; }
.lv-text dt { color: var(--mute); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; padding-top: 2px; }
.lv-text ol { padding-left: 18px; }

/* compact (embed) and narrow screens: stack the log under the player */
.lv.compact .lv-card { border-radius: 18px; padding: 14px; box-shadow: none; }
.lv.compact .lv-body { grid-template-columns: minmax(0, 1fr); }
.lv.compact .lv-log { order: 2; min-height: 0; }
.lv.compact .lv-log ol { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.lv.compact .lv-log-foot { display: none; }
@media (max-width: 900px) {
  .lv-body { grid-template-columns: minmax(0, 1fr); }
  .lv-log { order: 2; min-height: 0; }
}
@media (max-width: 560px) {
  .lv-card { padding: 14px; border-radius: 18px; }
  .lv-form { flex-direction: column; }
  .lv-go { justify-content: center; }
  .lv-time { min-width: 0; }
  .lv-text dl { grid-template-columns: 1fr; gap: 2px; }
  .lv-text dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { .pg-eyebrow i, .lv-busy i { animation: none; } .lv-log li { transition: none; } }
