/* =====================================================================
   PSM Simulator - stylesheet
   Palet mengikuti logo: silver, hitam, dan biru muda. Warna mencolok
   (kuning, merah) hanya dipakai untuk kondisi abnormal, sejalan dengan
   filosofi HMI berperforma tinggi (ANSI/ISA-101).
   ===================================================================== */
:root {
  --bk: #0f161d; --bk2: #1a232c; --char: #26323d; --char2: #3a4652; --steel: #5d6b78;
  --sv0: #ffffff; --sv1: #f3f6f8; --sv2: #e2e7ec; --sv3: #c4ccd4; --sv4: #9aa6b1;
  --lb: #29abe2; --lb2: #1e9bd7; --lb3: #8fdcf7; --lb4: #e8f7fd; --db: #1565a6;
  --ink: #1f2a35; --muted: #5d6b78;
  --amber: #f0a500; --red: #e53935; --green: #2e9d5b;
  --shadow: 0 12px 32px rgba(5, 10, 15, 0.45);
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bk); color: var(--ink); font-size: 15px; line-height: 1.5; overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: 'Baloo 2', 'Nunito', sans-serif; margin: 0; line-height: 1.15; }
p { margin: 0 0 10px; }
ul, ol { margin: 0; padding-left: 20px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ok { color: var(--green); }
.bad { color: #c62828; font-weight: 800; }
#app, .screen { position: absolute; inset: 0; }

/* ---------- latar foto kilang (monokrom silver, redup) ---------- */
.bg-photo { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: linear-gradient(180deg, #1c252d 0%, #121a21 60%, #0c1217 100%); }
.bg-photo::before { content: ''; position: absolute; inset: -4%; background: url('../assets/menu-bg.jpg') center 62% / cover no-repeat; opacity: 0.42; animation: kenburns 48s ease-in-out infinite alternate; }
.bg-photo::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 42%, rgba(15, 22, 29, 0) 0%, rgba(15, 22, 29, 0.35) 60%, rgba(10, 15, 20, 0.8) 100%), linear-gradient(180deg, rgba(15, 22, 29, 0.05) 0%, rgba(15, 22, 29, 0.55) 100%); }
@keyframes kenburns { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.07) translate(-1.2%, -1%); } }
.flame { transform-origin: 50% 100%; transform-box: fill-box; animation: flick 0.35s ease-in-out infinite alternate; }
@keyframes flick { from { transform: scaleY(1) scaleX(1); } to { transform: scaleY(1.18) scaleX(0.92); } }
body.no-anim .flame, body.no-anim .hs-pulse, body.no-anim .logo-wrap, body.no-anim .logo-wrap::after, body.no-anim .bg-photo::before,
body.no-anim .menu-rays, body.no-anim .menu-card::after, body.no-anim .icon3d *, body.no-anim .menu-btns .btn3d::after { animation: none !important; }

/* tombol musik latar */
.music-toggle { position: absolute; top: 14px; right: 14px; z-index: 3; width: 54px; height: 54px; padding: 0; border: none; border-radius: 50%; background: none; display: grid; place-items: center; animation: fadeIn 0.6s 0.6s both; }
.music-toggle .icon3d { width: 54px; height: 54px; filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.5)); transition: transform 0.15s ease; }
@media (hover: hover) { .music-toggle:hover .icon3d { transform: scale(1.07) rotate(-4deg); } }
.music-toggle:active .icon3d { transform: scale(0.94); }
.music-toggle:focus-visible { outline: 3px solid var(--lb3); outline-offset: 3px; }

/* ---------- tombol 3D ---------- */
.btn3d {
  --c1: #6fd0f5; --c2: #1e9bd7; --c3: #126e9c; --fg: #ffffff;
  position: relative; display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  padding: 12px 22px; border: none; border-radius: 14px; color: var(--fg); font-weight: 800; font-size: 15px; letter-spacing: 0.2px;
  background: linear-gradient(180deg, var(--c1), var(--c2));
  box-shadow: 0 6px 0 var(--c3), 0 10px 18px rgba(0, 0, 0, 0.28), inset 0 2px 0 rgba(255, 255, 255, 0.45);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25); transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}
@media (hover: hover) { .btn3d:hover { filter: brightness(1.06); } }
.btn3d:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--c3), 0 4px 8px rgba(0, 0, 0, 0.25), inset 0 2px 0 rgba(255, 255, 255, 0.45); }
.btn3d:disabled { filter: grayscale(0.8) brightness(0.85); opacity: 0.75; cursor: not-allowed; transform: none; }
.btn3d:focus-visible { outline: 3px solid var(--lb3); outline-offset: 3px; }
.btn3d svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.btn3d.primary { --c1: #6fd0f5; --c2: #1e9bd7; --c3: #126e9c; }
.btn3d.dark { --c1: #4d5a66; --c2: #1d262e; --c3: #05080b; }
.btn3d.silver { --c1: #ffffff; --c2: #c4ccd4; --c3: #7f8b96; --fg: #1f2a35; text-shadow: none; }
.btn3d.red { --c1: #ff7b7b; --c2: #e53935; --c3: #a51d1a; }
.btn3d.big { padding: 15px 24px; font-size: 19px; width: 100%; justify-content: flex-start; flex-wrap: wrap; }
.btn3d.big small { flex-basis: 100%; font-size: 12px; font-weight: 600; opacity: 0.85; margin-left: 42px; margin-top: -2px; text-align: left; }
.btn3d.small { padding: 8px 14px; font-size: 13px; border-radius: 10px; box-shadow: 0 4px 0 var(--c3), 0 6px 12px rgba(0, 0, 0, 0.22), inset 0 2px 0 rgba(255, 255, 255, 0.45); }
.btn3d.small:active { transform: translateY(3px); }
.btn3d.small svg { width: 16px; height: 16px; }
.btn3d.wide { width: 100%; }
.btn3d.icon-only { padding: 8px 10px; }
.btn3d.icon-only svg { width: 18px; height: 18px; }
.top-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- MENU ---------- */
.screen.menu { display: grid; grid-template-rows: 1fr auto; place-items: center; overflow: auto; }
.menu-card {
  position: relative; z-index: 1; width: min(470px, 92vw); padding: 26px 30px 26px; text-align: center;
  background: linear-gradient(180deg, #ffffff, #dfe5ea);
  border-radius: 28px; border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 4px rgba(41, 171, 226, 0.45), 0 0 40px rgba(41, 171, 226, 0.25), var(--shadow);
}
.logo-full { width: 100%; height: auto; display: block; filter: drop-shadow(0 4px 6px rgba(15, 22, 29, 0.18)); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.tagline { color: var(--muted); font-weight: 700; margin: 10px 0 18px; }
.menu-btns { display: grid; gap: 14px; }
.menu-foot { position: relative; z-index: 1; width: 100%; padding: 10px 12px 12px; text-align: center; color: var(--sv3); font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }

/* ---------- layar sub ---------- */
.screen.sub { overflow: auto; padding: 24px 16px; display: flex; justify-content: center; align-items: flex-start; }
.panel {
  position: relative; z-index: 1; width: min(720px, 100%); margin: auto 0;
  background: linear-gradient(180deg, #ffffff, #eef1f4); border-radius: 24px; padding: 22px 26px 26px;
  box-shadow: 0 0 0 3px rgba(41, 171, 226, 0.5), var(--shadow); border-top: 6px solid var(--lb);
}
.panel.wide { width: min(1080px, 100%); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.panel-head h2 { font-size: 28px; color: var(--ink); }
.panel h4 { margin: 16px 0 6px; font-size: 17px; color: var(--ink); }

/* skenario */
.scn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-top: 12px; }
.scn-card {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #e9edf1); border: 1px solid var(--sv3); border-top: 6px solid var(--accent);
  box-shadow: 0 6px 0 var(--sv4), 0 14px 24px rgba(0, 0, 0, 0.22); transition: transform 0.15s;
}
@media (hover: hover) { .scn-card:hover { transform: translateY(-4px); } }
.scn-badge { position: absolute; top: 12px; right: 12px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.scn-icon { width: min(168px, calc(100% - 96px)); aspect-ratio: 160 / 100; }
.scn-icon svg { display: block; width: 100%; height: 100%; }
.scn-card h3 { font-size: 20px; color: var(--ink); }
.scn-card p { color: var(--muted); font-size: 13.5px; flex: 1; }
.scn-meta { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--steel); margin-bottom: 6px; }
.scn-meta .best { color: var(--lb2); }

/* konfigurasi */
.cfg-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--sv2); font-weight: 700; }
.cfg-row label small { display: block; font-weight: 600; color: var(--muted); font-size: 12px; }
.cfg-row input[type=text], .cfg-row select { font: inherit; padding: 8px 12px; border-radius: 10px; border: 2px solid var(--sv3); background: #fff; min-width: 220px; }
.cfg-row input:focus, .cfg-row select:focus { outline: none; border-color: var(--lb); }
.switch { position: relative; width: 54px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--sv4); transition: 0.2s; box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25); }
.switch span::before { content: ''; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; border-radius: 50%; background: linear-gradient(#fff, #dfe4e9); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); transition: 0.2s; }
.switch input:checked + span { background: var(--lb2); }
.switch input:checked + span::before { transform: translateX(24px); }
.switch input:focus-visible + span { outline: 3px solid var(--lb3); outline-offset: 2px; }
.cfg-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.range-wrap { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.range-wrap input { flex: 1; accent-color: var(--lb2); }
.range-wrap b { width: 44px; text-align: right; font-variant-numeric: tabular-nums; }

/* credit */
.credit-hero { text-align: center; padding: 6px 0 4px; }
.credit-hero img { width: min(360px, 90%); height: auto; }
.credit-hero p { color: var(--muted); font-weight: 700; margin-top: 6px; }
.company { display: grid; justify-items: center; gap: 10px; margin: 12px 0 8px; padding: 18px 16px 16px; border-radius: 18px; background: linear-gradient(180deg, #f9fbfc, #e5eaee); border: 1px solid var(--sv3); text-align: center; }
.company .lbl { font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.company-logo { display: block; width: min(340px, 72vw); height: auto; }
.company h3 { font-size: 18px; color: var(--ink); }
.taglines { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.svc-grid { list-style: none; padding: 0; margin: 6px 0 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.svc-grid li { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start; padding: 10px; border-radius: 12px; background: var(--sv1); border: 1px solid var(--sv2); }
.svc-ico { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(180deg, #6fd0f5, var(--lb2)); display: grid; place-items: center; color: #fff; box-shadow: 0 3px 0 #126e9c; }
.svc-ico svg { width: 20px; height: 20px; fill: #fff; }
.svc-grid b { display: block; font-size: 13.5px; color: var(--ink); }
.svc-grid .svc-desc { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.company-links { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 6px 0 8px; }
a.btn3d { text-decoration: none; }
.credit-foot { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--sv2); text-align: center; font-weight: 800; color: var(--ink); font-size: 13px; }
.refs { font-size: 13px; color: var(--char); }
.refs li { margin-bottom: 4px; }

/* ---------- LAYAR PERMAINAN ---------- */
.screen.play { display: flex; flex-direction: column; background: radial-gradient(1200px 600px at 50% -10%, #263746, #0f161d 62%); }
.topbar { display: flex; align-items: center; gap: 16px; padding: 7px 16px; background: linear-gradient(180deg, #26313b, #11181f); border-bottom: 2px solid var(--lb); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); z-index: 2; }
/* logo berlatar transparan langsung di atas bilah gelap, tanpa pelat putih dan tanpa teks tambahan */
.brand { display: flex; align-items: center; flex: none; min-width: 0; }
.brand-logo { display: block; height: 56px; width: auto; max-width: 100%; }
.stepper { flex: 1; display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; justify-content: center; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); color: var(--sv3); font-weight: 700; font-size: 13px; border: 2px solid transparent; }
.step .ico { width: 26px; height: 26px; border-radius: 50%; background: var(--steel); display: grid; place-items: center; }
.step .ico svg { width: 15px; height: 15px; fill: #fff; }
.step.active { background: linear-gradient(180deg, #ffffff, #d3dae0); color: var(--ink); border-color: var(--lb); box-shadow: 0 4px 0 #7f8b96; }
.step.active .ico { background: var(--lb2); }
.step.done .ico { background: var(--lb2); }
.step .sc { font-size: 11px; background: var(--lb2); color: #fff; border-radius: 999px; padding: 1px 7px; }
.step .sc:empty { display: none; }
.play-main { flex: 1; display: grid; grid-template-columns: 1fr 410px; gap: 14px; padding: 14px; min-height: 0; }
.pid-area { position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.pid-wrap { position: relative; flex: 1; min-height: 0; background: #fff; border-radius: 18px; box-shadow: 0 0 0 2px var(--lb), var(--shadow); padding: 6px; display: flex; }
.pid-wrap.placing { cursor: crosshair; }
.pid-wrap.boom { animation: boom 0.65s ease-out; }
@keyframes boom { 0%, 100% { transform: translate(0, 0); } 10% { transform: translate(-10px, 6px); } 20% { transform: translate(9px, -7px); } 30% { transform: translate(-7px, -5px); } 40% { transform: translate(6px, 5px); } 55% { transform: translate(-4px, 2px); } 70% { transform: translate(3px, -2px); } 85% { transform: translate(-1px, 1px); } }
.pid-svg { width: 100%; height: 100%; display: block; }
.trend-wrap { height: 216px; background: linear-gradient(180deg, #e3e8ec, #d6dce2); border-radius: 16px; box-shadow: 0 0 0 2px var(--sv4), var(--shadow); padding: 3px; }
.trend-wrap canvas { width: 100%; height: 100%; display: block; }
.side { background: linear-gradient(180deg, #f3f6f8, #e2e7ec); border-radius: 18px; box-shadow: 0 0 0 2px var(--sv4), var(--shadow); padding: 12px; overflow: auto; min-height: 0; }
.side-head h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; color: var(--ink); margin-bottom: 2px; }
.side-scn { margin: 0 0 10px 40px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.side-head svg { width: 30px; height: 30px; fill: var(--lb2); }
.card { background: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; box-shadow: 0 2px 8px rgba(15, 22, 29, 0.08); border: 1px solid #d5dce2; }
.card h4 { font-size: 15.5px; color: var(--ink); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.card h4 small { font-weight: 700; color: var(--muted); font-size: 12.5px; }
.card h4 svg { width: 18px; height: 18px; fill: var(--lb2); }
.card p { font-size: 13.5px; }
.card.action { text-align: center; }
.pill { display: inline-block; font-size: 11px; background: var(--lb2); color: #fff; border-radius: 999px; padding: 1px 9px; font-weight: 800; }
.pill.warn { background: var(--char); }

/* daftar peralatan */
.eq-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.eq-list li { display: grid; grid-template-columns: 14px 64px 1fr; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; cursor: pointer; font-size: 13px; background: var(--sv1); border: 1px solid var(--sv2); }
@media (hover: hover) { .eq-list li:hover { background: var(--lb4); border-color: var(--lb3); } }
.eq-list .dot, .hs-list .dot, .eq-insp .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--sv3); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3); }
.eq-list li.read .dot { background: var(--lb2); }
/* daftar periksa Tahap 1: kotak centang per butir */
.eq-list .chk { width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--sv4); background: #fff; position: relative; }
.eq-list li.read .chk { background: var(--lb2); border-color: #126e9c; }
.eq-list li.read .chk::after { content: ''; position: absolute; left: 4px; top: 0px; width: 4px; height: 9px; border: solid #fff; border-width: 0 2.4px 2.4px 0; transform: rotate(45deg); }
.eq-list li { grid-template-columns: 16px 64px 1fr; }
.check-note { margin: 0 0 8px; padding: 8px 10px; border-radius: 10px; background: var(--lb4); border: 1px solid var(--lb3); font-size: 12.5px; color: var(--ink); }
/* pilihan tingkat kesulitan saat memilih misi */
.diff-opts { display: grid; gap: 8px; margin-top: 8px; }
.diff-opt { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--sv2); background: var(--sv1); cursor: pointer; }
.diff-opt input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--lb2); }
.diff-opt b { display: block; color: var(--ink); }
.diff-opt small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.diff-opt:has(input:checked) { border-color: var(--lb2); background: var(--lb4); }
.diff-pill { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 800; color: var(--db); background: var(--lb4); border: 1px solid var(--lb3); vertical-align: 1px; }
.eq-list b { color: var(--ink); }
.live-wrap { display: grid; gap: 4px; margin-top: 6px; }
.live { display: flex; justify-content: space-between; padding: 5px 10px; border-radius: 8px; background: var(--lb4); font-size: 12.5px; }
.live b { font-variant-numeric: tabular-nums; }
.live.hi, .live.lo { background: #fff3d6; }
.live.hihi, .live.lolo { background: #ffe1e1; color: #b71c1c; }
.sliders { display: grid; gap: 8px; margin-top: 6px; }
.slider span { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; }
.slider input { width: 100%; accent-color: var(--lb2); }
.legend { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; font-size: 12.5px; }
.legend li { display: flex; align-items: flex-start; gap: 8px; }
.legend li b { display: block; font-weight: 800; color: var(--ink); line-height: 1.25; }
.legend li small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.legend .sw-svg { flex: none; margin-top: 2px; }
.legend .sw { position: relative; width: 30px; height: 10px; border-radius: 5px; background: #cfd6dc; border: 2px solid #46525e; flex: none; }
.legend .sw::after { content: ''; position: absolute; left: 2px; right: 2px; top: 1px; height: 4px; border-radius: 2px; background: var(--c); }
.legend .sw.ro { background: #1d262e; border-color: var(--lb); }
.legend .sw.ro::after { display: none; }

/* produksi dan tahap 2 */
.prod-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 8px; }
.prod-stats > div { background: var(--sv1); border: 1px solid var(--sv2); border-radius: 10px; padding: 6px 8px; min-width: 0; }
.prod-stats span { display: block; font-size: 11px; line-height: 1.2; font-weight: 700; color: var(--muted); }
.prod-stats b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-idle { color: var(--muted); }
.st-ok { color: var(--lb2); }
.st-warn { color: #b37400; }
.st-crit { color: #c62828; animation: blink 0.7s steps(2) infinite; }
.run-big { padding: 14px 18px; font-size: 16px; }
.alarm-box { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--sv1); border: 1px solid var(--sv2); font-weight: 800; margin: 8px 0 12px; font-size: 13px; }
.alarm-box .lamp { width: 14px; height: 14px; border-radius: 50%; background: var(--lb2); box-shadow: 0 0 6px var(--lb2); flex: none; }
.alarm-box.on { background: #ffe9e9; border-color: #ffb3b3; color: #b71c1c; }
.alarm-box.on .lamp { background: var(--red); box-shadow: 0 0 10px var(--red); animation: blink 0.5s steps(2) infinite; }
@keyframes blink { to { opacity: 0.25; } }
.ev-track { display: flex; gap: 8px; }
.ev-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--sv3); color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2); }
.ev-dot.active { background: var(--char); box-shadow: 0 0 0 3px var(--lb3), inset 0 -3px 0 rgba(0, 0, 0, 0.3); }
.ev-dot.done { background: var(--lb2); }
.warn-log { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.warn-log li { display: grid; grid-template-columns: 30px 1fr; gap: 8px; padding: 7px 9px; border-radius: 10px; background: var(--sv1); border-left: 5px solid var(--amber); font-size: 12.5px; animation: slideIn 0.35s ease-out; }
.warn-log li.empty { display: block; border-left-color: var(--lb2); color: var(--muted); animation: none; }
.warn-log li.sev-crit { border-left-color: var(--red); background: #fff1f1; }
.warn-log li.sev-final { border-left-color: #7f0000; background: linear-gradient(90deg, #ffd6d6, #fff1f1); }
.warn-log p { margin: 2px 0 0; font-size: 12.5px; }
.warn-log .wh { display: flex; justify-content: space-between; gap: 8px; }
.warn-log time { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
@keyframes slideIn { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.wi { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--amber); flex: none; }
.wi svg { width: 18px; height: 18px; fill: #1f2a35; color: #1f2a35; }
.sev-crit .wi, .sev-final .wi { background: var(--red); }
.sev-crit .wi svg, .sev-final .wi svg { fill: #fff; color: #fff; }
.hazop { width: 100%; border-collapse: collapse; font-size: 12px; }
.hazop th, .hazop td { padding: 4px 6px; border-bottom: 1px solid var(--sv2); text-align: left; }
.hazop th { background: var(--lb4); color: var(--ink); }
td.ok { color: var(--green); font-weight: 800; }
td.bad { color: #c62828; font-weight: 800; }

/* spanduk peringatan di atas P&ID */
.fx-banner-wrap { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: min(640px, 92%); display: grid; gap: 8px; z-index: 5; pointer-events: none; }
.fx-banner { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 14px; background: rgba(17, 24, 31, 0.94); color: #fff; border-left: 6px solid var(--amber); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45); transform: translateY(-14px); opacity: 0; transition: transform 0.3s, opacity 0.3s; }
.fx-banner.show { transform: none; opacity: 1; }
.fx-banner .wi { width: 40px; height: 40px; }
.fx-banner .wi svg { width: 24px; height: 24px; }
.fx-banner b { display: block; font-size: 14px; letter-spacing: 0.4px; }
.fx-banner span { display: block; font-size: 12.5px; color: var(--sv2); }
.fx-banner time { font-weight: 800; color: var(--lb3); font-variant-numeric: tabular-nums; }
.fx-banner.sev-crit { border-left-color: var(--red); }
.fx-banner.sev-final { border-left-color: #ffffff; background: linear-gradient(90deg, rgba(183, 28, 28, 0.97), rgba(120, 10, 10, 0.97)); }
.fx-banner.sev-final span { color: #ffe1e1; }

/* tahap 3 dan 4 */
.budget-row { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 15px; }
.budget-row span { display: flex; align-items: center; gap: 6px; }
.budget-row svg { width: 22px; height: 22px; fill: var(--sv3); }
.budget-bar, .rel-bar { height: 12px; border-radius: 999px; background: var(--sv2); margin: 6px 0; overflow: hidden; box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.2); }
#budget-fill { height: 100%; width: 0; background: linear-gradient(90deg, #4d5a66, #1d262e); transition: width 0.3s; }
#budget-fill.low { background: linear-gradient(90deg, #ffc94d, var(--amber)); }
.rel-row { display: flex; align-items: baseline; gap: 10px; }
.rel-row b { font-family: 'Baloo 2', sans-serif; font-size: 28px; color: var(--ink); line-height: 1; }
.rel-row span { font-size: 12.5px; font-weight: 700; color: var(--muted); }
#rel-fill { height: 100%; width: 0; transition: width 0.4s; background: var(--sv4); }
#rel-fill.good { background: linear-gradient(90deg, #8fdcf7, var(--lb2)); }
#rel-fill.mid { background: linear-gradient(90deg, #ffd27a, var(--amber)); }
#rel-fill.low { background: linear-gradient(90deg, #ff9a9a, var(--red)); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--sv2); padding: 4px; border-radius: 12px; margin-bottom: 10px; }
.tab { border: none; border-radius: 9px; padding: 8px; font-weight: 800; font-size: 12.5px; background: transparent; color: var(--muted); display: flex; gap: 6px; align-items: center; justify-content: center; }
.tab svg { width: 16px; height: 16px; fill: currentColor; }
.tab.active { background: linear-gradient(180deg, #ffffff, #e9eef2); color: var(--ink); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); }
.tab.active svg { fill: var(--lb2); }
.toolbox { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tool { display: grid; grid-template-columns: 40px 1fr; gap: 2px 8px; align-items: center; text-align: left; padding: 6px 8px; border-radius: 12px; border: 2px solid var(--sv2); background: #fff; position: relative; transition: transform 0.1s, border-color 0.1s; }
@media (hover: hover) { .tool:hover { border-color: var(--lb3); transform: translateY(-2px); } }
.tool.sel { border-color: var(--lb2); background: var(--lb4); box-shadow: 0 0 0 3px rgba(41, 171, 226, 0.3); }
.tool .tcode { grid-row: span 2; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: var(--ink); background: radial-gradient(circle at 35% 30%, #fff, #e4e9ed 55%, #9ba7b2); border: 3px solid var(--c); box-shadow: 0 3px 5px rgba(0, 0, 0, 0.25); }
.tool.itpm .tcode { border-radius: 10px; color: #fff; background: linear-gradient(180deg, #6fd0f5, var(--lb2)); border: 2px solid #126e9c; }
.tool .tname { font-size: 11px; font-weight: 700; line-height: 1.2; color: var(--ink); }
.tool .tcost { font-size: 10.5px; font-weight: 800; color: var(--db); }
.tool .tcost::before { content: 'biaya '; font-weight: 600; color: var(--muted); }
.tool-desc { margin-top: 8px; font-size: 12.5px; background: var(--lb4); border: 1px solid #cdeefb; border-radius: 10px; padding: 8px 10px; min-height: 40px; }
.tool-desc .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tool-desc .meta span { background: #fff; border: 1px solid var(--sv3); border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700; }
.tool-desc p { margin: 6px 0 0; }
.tool-desc .ctl { font-weight: 700; color: var(--db); }
/* daftar escalation factor: satu kolom, dikelompokkan menurut keluarga barier */
.toolbox.ef { grid-template-columns: 1fr; gap: 6px; max-height: 420px; overflow: auto; overscroll-behavior: contain; padding-right: 2px; }
.tb-grp { grid-column: 1 / -1; font-size: 10.5px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); margin: 6px 0 0; font-weight: 800; }
.tb-grp:first-child { margin-top: 0; }
.toolbox.ef .tool { grid-template-columns: 46px 1fr; }
.toolbox.ef .tool .tcode { width: 46px; height: 30px; }
.pop .prog-list .tb-grp { margin: 6px 0 0; }
.hs-list, .eq-insp { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.hs-list li, .eq-insp li { display: grid; grid-template-columns: 14px 1fr; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; font-size: 12.5px; border: 1px solid var(--sv2); background: var(--sv1); cursor: pointer; }
@media (hover: hover) { .hs-list li:hover, .eq-insp li:hover { border-color: var(--lb3); } }
.hs-list li b, .eq-insp li b { color: var(--ink); }
.hs-list li small, .eq-insp li small { display: block; color: var(--muted); }
.hs-list li small em, .placed em { font-style: normal; font-weight: 800; margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 10.5px; }
.placed em.ok { background: var(--lb4); color: var(--db); }
.placed em.warnc { background: #fff3d6; color: #9a6400; }
.placed em.efc { background: var(--lb4); color: var(--db); }
.placed em.badc { background: #ffe1e1; color: #b71c1c; }
.hs-list li { grid-template-columns: 22px 1fr; }
/* nomor titik pada daftar, sama dengan nomor penanda di P&ID */
.hs-list .num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 900; color: var(--ink);
  background: #fff; border: 2px dashed var(--lb2); }
.hs-list li.placed .num { background: var(--sv4); border: 2px solid var(--steel); color: #fff; }
.hs-list li.placed.tested .num { background: var(--lb2); border: 2px solid #126e9c; color: #fff; }
.eq-insp li.placed .dot { background: var(--lb2); border: 2px solid #126e9c; }
.hs-list li[data-state=ok] { background: #e7f6ec; }
.hs-list li[data-state=partial] { background: #fff6e0; }
.hs-list li[data-state=wrong], .hs-list li[data-state=missing] { background: #ffecec; }
.eval-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 8px; }
.eval-sum div { background: var(--sv1); border: 1px solid var(--sv2); border-radius: 10px; padding: 8px 10px; }
.eval-sum span { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.eval-sum b { font-size: 18px; }
.eval-list { list-style: none; padding: 0; display: grid; gap: 6px; max-height: 42vh; overflow: auto; }
/* efektivitas penggunaan anggaran */
.budget-eff { border: 1px solid var(--sv2); border-left: 4px solid var(--steel); border-radius: 10px; padding: 8px 10px; margin: 0 0 8px; background: var(--sv1); }
.budget-eff p { margin: 0 0 4px; }
.budget-eff p:last-child { margin-bottom: 0; }
.budget-eff.ok { border-left-color: var(--green); }
.budget-eff.mid { border-left-color: var(--amber); }
.budget-eff.bad { border-left-color: var(--red); }
.eval-sum .budget-eff-tile.ok b { color: #1e7d45; }
.eval-sum .budget-eff-tile.mid b { color: #9a6400; }
.eval-sum .budget-eff-tile.bad b { color: #b71c1c; }
.budget-eff-line { margin: 6px 0; color: var(--muted); }
.budget-eff-line.ok b { color: #1e7d45; }
.budget-eff-line.mid b { color: #9a6400; }
.budget-eff-line.bad b { color: #b71c1c; }
.eval-list li { padding: 8px 10px; border-radius: 10px; border-left: 6px solid var(--sv4); background: var(--sv1); font-size: 13px; display: grid; gap: 2px; }
.eval-list li.ok { border-color: var(--green); background: #e7f6ec; }
.eval-list li.partial { border-color: var(--amber); background: #fff6e0; }
.eval-list li.wrong { border-color: var(--red); background: #ffecec; }
.eval-list li.missing { border-color: #c77700; background: #fff1e0; }
.eval-list li.extra { border-color: var(--sv4); background: var(--sv1); }
.eval-list em { color: var(--muted); font-size: 12px; }
.kv { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 8px 0; }
.kv th { text-align: left; color: var(--muted); font-weight: 700; padding: 5px 8px 5px 0; width: 38%; vertical-align: top; }
.kv td { padding: 5px 0; border-bottom: 1px solid var(--sv2); }

/* ---------- P&ID SVG ---------- */
.pid-svg text { font-family: 'Nunito', sans-serif; }
.pid-svg .eq { cursor: pointer; }
.pid-svg .eq-label { pointer-events: none; paint-order: stroke; stroke: rgba(255, 255, 255, 0.85); stroke-width: 3px; stroke-linejoin: round; }
@media (hover: hover) { .pid-svg .eq:hover .eq-ring { opacity: 0.6 !important; } }
.pid-svg .eq.alarm .eq-ring { opacity: 1 !important; stroke: var(--red); animation: blink 0.6s steps(2) infinite; }
.pid-svg .eq.is-target .eq-ring { opacity: 1 !important; stroke: var(--lb); stroke-dasharray: none; stroke-width: 4; animation: target 1.1s ease-in-out infinite; }
.pid-svg .device.is-target .dev-target { opacity: 1; animation: target 1.1s ease-in-out infinite; }
@keyframes target { 50% { stroke-opacity: 0.25; } }
.pid-svg .eq.shake { animation: shake 0.12s linear infinite; }
@keyframes shake { 0% { transform: translate(0, 0); } 25% { transform: translate(1.6px, -1px); } 50% { transform: translate(-1.4px, 1px); } 75% { transform: translate(1px, 1.2px); } 100% { transform: translate(0, 0); } }
.pid-svg .eq.damaged { filter: grayscale(0.8) brightness(0.5); }
.pid-svg .flow { opacity: 0; }
.pid-svg.flowing .flow { opacity: 0.9; animation: flow 0.9s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -40; } }
body.no-anim .pid-svg.flowing .flow { animation: none; }
.pid-svg .liquid rect { transition: y 0.25s linear, height 0.25s linear; }
.pid-svg .readout[data-state=hi] .ro-bg, .pid-svg .readout[data-state=lo] .ro-bg { fill: #a86d00; stroke: #ffb300; }
.pid-svg .readout[data-state=hihi] .ro-bg, .pid-svg .readout[data-state=lolo] .ro-bg { fill: #b71c1c; stroke: #ff5252; animation: blink 0.6s steps(2) infinite; }
.pid-svg .hotspot { cursor: pointer; }
.pid-svg .hs-pulse { animation: pulse 1.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 0% { transform: scale(0.8); opacity: 1; } 100% { transform: scale(1.7); opacity: 0; } }
/* garis sambung dan titik sambung tidak menangkap klik agar peralatan di bawahnya tetap dapat diklik */
.pid-svg .hs-link, .pid-svg .hs-tap { pointer-events: none; }
.pid-svg .hotspot.hl .hs-core, .pid-svg .device.hl .dev-body { stroke-width: 4; }
.pid-svg .hotspot.hl .hs-link, .pid-svg .device.hl .hs-link { stroke-width: 2.4; }
.pid-svg .device.hl .dev-target { opacity: 1; }
@media (hover: hover) { .pid-svg .hotspot:hover .hs-core { fill: #cdeefb; } .pid-svg .hotspot:hover .hs-link, .pid-svg .device:hover .hs-link { stroke-width: 2.4; } }
.pid-svg .device { cursor: pointer; }
.pid-svg .device[data-state=ok] .dev-body { stroke: var(--green); }
.pid-svg .device[data-state=partial] .dev-body { stroke: var(--amber); }
.pid-svg .device[data-state=wrong] .dev-body { stroke: var(--red); }
.pid-svg .hotspot[data-state=missing] .hs-core { stroke: var(--red); fill: #ffd9d9; }
.pid-svg .hotspot[data-state=ok] .hs-core { stroke: var(--green); fill: #dff3e7; }
.pid-svg .eq-badge { pointer-events: none; }

/* efek insiden */
.pid-svg .layer-fx { pointer-events: none; }
.pid-svg .fx-haze { transform-box: fill-box; transform-origin: center; animation: hazeGrow 2.2s ease-out forwards; }
@keyframes hazeGrow { from { transform: scale(0.5); opacity: 0.2; } to { transform: scale(1); opacity: 0.75; } }
.pid-svg .fx-puff, .pid-svg .fx-smoke { transform-box: fill-box; transform-origin: center; opacity: 0; animation: puff 2.8s ease-out infinite; }
.pid-svg .fx-smoke { animation-duration: 3.6s; }
@keyframes puff { 0% { transform: translate(0, 0) scale(0.35); opacity: 0.95; } 70% { opacity: 0.75; } 100% { transform: translate(var(--dx), var(--dy)) scale(1.6); opacity: 0; } }
.pid-svg .fx-hiss { animation: hiss 0.3s linear infinite alternate; }
@keyframes hiss { from { opacity: 0.15; } to { opacity: 1; } }
.pid-svg .fx-heat { transform-box: fill-box; transform-origin: center; animation: heatPulse 1.4s ease-in-out infinite; }
@keyframes heatPulse { 0%, 100% { transform: scale(0.85); opacity: 0.7; } 50% { transform: scale(1.08); opacity: 1; } }
.pid-svg .fx-wave { opacity: 0; animation: heatRise 1.6s ease-in-out infinite; }
@keyframes heatRise { 0% { transform: translateY(6px); opacity: 0; } 40% { opacity: 0.95; } 100% { transform: translateY(-20px); opacity: 0; } }
.pid-svg .fx-vib { animation: vib 0.22s ease-in-out infinite alternate; }
@keyframes vib { from { opacity: 0.25; transform: translateX(-1.5px); } to { opacity: 1; transform: translateX(1.5px); } }
.pid-svg .fx-spill { transform-box: fill-box; transform-origin: center; animation: spill 4s ease-out forwards; }
@keyframes spill { from { transform: scale(0.1); } to { transform: scale(1); } }
.pid-svg .fx-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flick 0.3s ease-in-out infinite alternate; }
.pid-svg .fx-blast { transform-box: fill-box; transform-origin: center; animation: blast 1.2s ease-out forwards; }
@keyframes blast { 0% { transform: scale(0.1); opacity: 1; } 55% { opacity: 0.95; } 100% { transform: scale(1.6); opacity: 0; } }
.pid-svg .fx-star { transform-box: fill-box; transform-origin: center; animation: star 1s ease-out forwards; }
@keyframes star { 0% { transform: scale(0.1) rotate(0deg); opacity: 1; } 100% { transform: scale(1.5) rotate(25deg); opacity: 0; } }
.pid-svg .fx-shock { transform-box: fill-box; transform-origin: center; animation: shock 1.1s ease-out forwards; }
@keyframes shock { 0% { transform: scale(0.2); opacity: 1; } 100% { transform: scale(5); opacity: 0; } }
.pid-svg .fx-frag { transform-box: fill-box; transform-origin: center; animation: frag 1.3s ease-out forwards; }
@keyframes frag { 0% { transform: translate(0, 0) rotate(0deg); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) rotate(540deg); opacity: 0; } }
.pid-svg .fx-flash { opacity: 0; animation: flash 0.8s ease-out forwards; }
@keyframes flash { 0% { opacity: 0.9; } 100% { opacity: 0; } }
.pid-svg .fx-scorch { transform-box: fill-box; transform-origin: center; animation: hazeGrow 1.5s ease-out forwards; }
.pid-svg .fx-bob { animation: bob2 0.9s ease-in-out infinite; }
@keyframes bob2 { 50% { transform: translateY(-5px); } }
body.no-fx .pid-svg .fx-flash { display: none; }
body.no-fx .pid-wrap.boom { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .pid-wrap.boom, .pid-svg .eq.shake, .pid-svg .fx-bob, .logo-wrap, .logo-wrap::after, .bg-photo::before, .menu-rays,
  .menu-card, .menu-card::after, .menu-btns .btn3d, .menu-btns .btn3d::after, .icon3d *, .music-toggle { animation: none !important; }
  .pid-svg .fx-flash { display: none; }
}

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(6, 10, 14, 0.66); backdrop-filter: blur(3px); opacity: 0; transition: opacity 0.2s; padding: 16px; }
.modal-wrap.show { opacity: 1; }
.modal { width: min(640px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: linear-gradient(180deg, #ffffff, #f1f4f7); border-radius: 22px; box-shadow: 0 0 0 2px var(--lb), var(--shadow); transform: translateY(14px) scale(0.98); transition: transform 0.2s; overflow: hidden; }
.modal-wrap.show .modal { transform: none; }
.modal.report { width: min(780px, 100%); }
.modal-head { padding: 14px 20px; background: linear-gradient(180deg, #2f3b46, #11181f); color: #fff; border-bottom: 3px solid var(--lb); }
.modal-head h3 { font-size: 20px; }
.modal-body { padding: 16px 20px; overflow: auto; font-size: 14.5px; }
.modal-body h4 { margin: 10px 0 6px; }
.modal-foot { padding: 12px 20px 16px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--sv2); flex-wrap: wrap; }
.intro-ico { width: 72px; height: 72px; margin: 0 auto 10px; border-radius: 50%; background: linear-gradient(180deg, #6fd0f5, var(--lb2)); display: grid; place-items: center; box-shadow: 0 6px 0 #126e9c; }
.intro-ico svg { width: 38px; height: 38px; fill: #fff; }
.modal.intro .modal-body { text-align: center; }
.tips { text-align: left; background: var(--lb4); border: 1px solid #cdeefb; border-radius: 12px; padding: 10px 10px 10px 28px; font-size: 13.5px; margin-top: 8px; }
.q { font-size: 17px; font-weight: 800; color: var(--ink); }
.opts { display: grid; gap: 8px; }
.opt { display: flex; gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--sv2); background: var(--sv1); font: inherit; font-weight: 600; }
@media (hover: hover) { .opt:hover:not(:disabled) { border-color: var(--lb); background: var(--lb4); } }
.opt .letter { width: 30px; height: 30px; border-radius: 50%; background: var(--char); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.opt.correct { border-color: var(--green); background: #e7f6ec; }
.opt.correct .letter { background: var(--green); }
.opt.wrong { border-color: var(--red); background: #ffecec; }
.opt.wrong .letter { background: var(--red); }
.fb { margin-top: 10px; font-size: 13.5px; }
.fb:empty { display: none; }
.warn { background: #fff3d6; border-left: 5px solid var(--amber); padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.note { background: var(--lb4); border-left: 5px solid var(--lb2); padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.note.ok { color: inherit; background: #e7f6ec; border-left-color: var(--green); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 10px; }
.form-grid label { display: grid; gap: 4px; font-weight: 800; font-size: 12.5px; color: var(--muted); min-width: 0; }
.form-grid select { font: inherit; padding: 8px; border-radius: 10px; border: 2px solid var(--sv3); background: #fff; width: 100%; min-width: 0; max-width: 100%; }
.gw-info { margin: -2px 0 8px; font-size: 12.5px; line-height: 1.4; color: var(--char); background: var(--lb4); border: 1px solid #cdeefb; border-radius: 10px; padding: 7px 10px; }
.gw-info b { color: var(--db); }
.var-note { margin: 8px 0 0; }
.rp-sec { margin-top: 10px; }
.rp-sec > b { display: block; margin-bottom: 4px; color: var(--ink); }
.radios { display: grid; gap: 4px; }
.radios label { display: flex; gap: 8px; align-items: flex-start; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--sv2); background: var(--sv1); font-size: 13px; cursor: pointer; }
@media (hover: hover) { .radios label:hover { background: var(--lb4); } }
.radios input { margin-top: 3px; accent-color: var(--lb2); }
.result-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 10px; }
.result-table th, .result-table td { border-bottom: 1px solid var(--sv2); padding: 6px; text-align: left; vertical-align: top; }
.result-table th { background: var(--lb4); }
.explain { background: var(--sv1); border: 1px solid var(--sv2); border-radius: 10px; padding: 10px; font-size: 13.5px; }
.chain-h { font-size: 15px; }
.chain { list-style: none; padding: 0; display: grid; gap: 6px; }
.chain li { display: grid; grid-template-columns: 30px 1fr; gap: 8px; padding: 7px 9px; border-radius: 10px; background: var(--sv1); font-size: 12.5px; }
.chain li p { margin: 2px 0 0; }
.chain li small { font-weight: 800; color: var(--muted); }
.chain li.seen small { color: #c62828; }
.chain li.unseen { opacity: 0.6; }
.chain li.unseen small { color: var(--green); }
.chain li.unseen .wi { background: var(--sv4); }
.score-big { font-family: 'Baloo 2', sans-serif; font-size: 72px; font-weight: 800; line-height: 1; color: var(--lb2); display: flex; flex-direction: column; align-items: center; margin: 6px 0 12px; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.1); }
.score-big small { font-size: 15px; font-family: 'Nunito', sans-serif; color: var(--muted); text-shadow: none; }
.score-big.A { color: var(--lb2); } .score-big.B { color: var(--db); } .score-big.C { color: #c77700; } .score-big.D { color: #c62828; }

/* hasil */
.result-top { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; flex: 1; }
.score-item { display: grid; justify-items: center; gap: 2px; padding: 10px; border-radius: 14px; background: linear-gradient(180deg, #ffffff, #e9edf1); border: 1px solid var(--sv3); font-size: 12px; font-weight: 700; text-align: center; }
.score-item .ico { width: 32px; height: 32px; border-radius: 50%; background: var(--char); display: grid; place-items: center; }
.score-item.rel .ico { background: var(--lb2); }
.score-item .ico svg { width: 18px; height: 18px; fill: #fff; }
.score-item b { font-size: 22px; color: var(--ink); }
.bowtie-wrap { background: #fff; border-radius: 16px; border: 1px solid var(--sv3); padding: 8px; overflow: auto; }
.bowtie { width: 100%; min-width: 700px; height: auto; }
.bt-txt { font: 700 11px/1.2 'Nunito', sans-serif; color: var(--ink); display: flex; align-items: center; justify-content: center; text-align: center; height: 100%; }
.bt-txt.top { color: #fff; font-size: 11.5px; }
.bt-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 8px 2px; }
.bt-legend span { display: flex; align-items: center; gap: 6px; }
.bt-legend .lg { width: 18px; height: 14px; border-radius: 4px; display: inline-block; }
.bt-legend .lg.solid { background: var(--db); }
.bt-legend .lg.dashed { border: 2px dashed var(--db); background: #fff; }
.degr { font-size: 13px; margin: 6px 0 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { background: var(--lb4); border: 1px solid #b9e6f8; color: var(--db); border-radius: 999px; padding: 2px 10px; font-weight: 700; font-size: 12px; }
.chip.bad { background: #ffecec; border-color: #f5b5b5; color: #b71c1c; }
.notes { font-size: 13.5px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--char); color: #fff; padding: 10px 18px; border-radius: 12px; font-weight: 700; font-size: 13.5px; box-shadow: var(--shadow); opacity: 0; transition: 0.2s; z-index: 60; width: max-content; max-width: min(560px, calc(100vw - 32px)); text-align: center; border: 2px solid var(--lb); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsif ---------- */
@media (max-width: 1100px) {
  .play-main { grid-template-columns: 1fr 350px; }
  .step .lbl { font-size: 12px; }
}
/* Di bawah 1280 px hanya tahap aktif yang menampilkan nama, tahap lain cukup ikon dan skor,
   sehingga bilah atas tetap satu baris di tablet mendatar. */
@media (max-width: 1279px) {
  .step:not(.active) .lbl { display: none; }
  .step:not(.active) { padding: 6px 9px; }
}
/* Tata letak bertumpuk: ponsel, tablet tegak, dan layar pendek. P&ID memakai proporsi
   1000 x 560 agar tidak menyisakan ruang kosong, lalu tren dan panel menyusul di bawahnya. */
@media (max-width: 999px), (max-height: 599px), (orientation: portrait) and (max-width: 1199px) {
  body { overflow: auto; }
  .screen.play { position: relative; min-height: 100vh; min-height: 100dvh; }
  .play-main { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
  .pid-area { gap: 10px; }
  /* tinggi cadangan untuk peramban tanpa aspect-ratio (Safari 14 ke bawah) */
  .pid-wrap { flex: none; height: calc((100vw - 20px) * 0.56); min-height: 0; max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); }
  @supports (aspect-ratio: 1 / 1) { .pid-wrap { height: auto; aspect-ratio: 1000 / 560; } }
  .trend-wrap { height: 320px; }
  .side { overflow: visible; }
  .legend { grid-template-columns: 1fr 1fr; }
  .fx-banner-wrap { position: fixed; top: 8px; width: min(640px, calc(100% - 16px)); z-index: 45; }
  .screen.play.has-bar .play-main { padding-bottom: 84px; }
  body.has-bar .toast { bottom: 88px; }
}
/* Tata letak lebar, Tahap 3 dan 4 (tanpa tren): bingkai P&ID mengikuti proporsi gambar dan
   diletakkan di tengah kolom, sehingga tidak menyisakan ruang putih besar di atas dan bawah. */
@media (min-width: 1000px) and (min-height: 600px) and (orientation: landscape), (min-width: 1200px) and (min-height: 600px) {
  .pid-area.no-trend { justify-content: center; }
  .pid-area.no-trend .pid-wrap { flex: 0 1 auto; aspect-ratio: 1000 / 560; max-height: 100%; }
}
/* bow-tie cukup besar untuk dibaca di layar sempit; sisanya digeser ke samping */
@media (max-width: 999px) { .bowtie { min-width: 820px; } }
@media (max-width: 520px) {
  .menu-card { padding: 20px 18px; }
  .btn3d.big { font-size: 17px; }
  .panel { padding: 18px 16px 20px; }
  .music-toggle { top: 10px; right: 10px; width: 42px; height: 42px; }
  .range-wrap { min-width: 0; width: 100%; }
  .cfg-row { flex-wrap: wrap; }
  .cfg-row input[type=text], .cfg-row select { min-width: 0; width: 100%; }
}

/* ---------- ikon 3D halaman depan ---------- */
.icon3d { display: block; flex: none; overflow: visible; }
.btn3d .icon3d { width: 42px; height: 42px; margin: -10px 0 -10px -10px; fill: initial; filter: drop-shadow(0 3px 3px rgba(5, 10, 15, 0.35)); transition: transform 0.2s ease; }
@media (hover: hover) { .btn3d:hover .icon3d { transform: translateY(-2px) scale(1.07) rotate(-3deg); } }
.i-play .ping { transform-origin: 24px 23px; animation: ping 2.6s ease-out infinite; }
@keyframes ping { 0% { transform: scale(0.92); opacity: 0.9; } 70%, 100% { transform: scale(1.32); opacity: 0; } }
.i-resume .chev { animation: chev 1.6s ease-in-out infinite; }
@keyframes chev { 0%, 100% { transform: translateX(-1px); } 50% { transform: translateX(2px); } }
.i-gear .gear-rot { transform-origin: 24px 23px; animation: spin 16s linear infinite; }
@media (hover: hover) { .btn3d:hover .i-gear .gear-rot { animation-duration: 2.4s; } }
@keyframes spin { to { transform: rotate(360deg); } }
.i-medal .medal-swing { transform-origin: 24px 3px; animation: swing 3.4s ease-in-out infinite; }
@keyframes swing { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }

/* ---------- animasi halaman depan ---------- */
.menu-particles { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.menu-rays { position: absolute; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(112deg, transparent 0%, transparent 40%, rgba(143, 220, 247, 0.1) 48%, rgba(255, 255, 255, 0.06) 50%, rgba(143, 220, 247, 0.1) 52%, transparent 60%, transparent 100%); background-size: 300% 100%; background-repeat: no-repeat; animation: rays 18s linear infinite; mix-blend-mode: screen; }
@keyframes rays { from { background-position: 130% 0; } to { background-position: -30% 0; } }
.menu-card { animation: cardIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes cardIn { from { opacity: 0; translate: 0 28px; scale: 0.96; } to { opacity: 1; translate: 0 0; scale: 1; } }
.menu-card::after { content: ''; position: absolute; inset: -3px; border-radius: 30px; pointer-events: none; z-index: -1; box-shadow: 0 0 26px 4px rgba(41, 171, 226, 0.45); animation: glowPulse 4.5s ease-in-out infinite; }
@keyframes glowPulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.logo-wrap { position: relative; width: 100%; max-width: 380px; margin: 0 auto; animation: bob 4s ease-in-out infinite; }
.logo-wrap::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 42%, rgba(255, 255, 255, 0.95) 50%, transparent 58%); background-size: 260% 100%; background-repeat: no-repeat; -webkit-mask: url('../assets/psm-logo.png') center / contain no-repeat; mask: url('../assets/psm-logo.png') center / contain no-repeat; animation: logoShine 6.5s ease-in-out 1.2s infinite; }
@keyframes logoShine { 0%, 62% { background-position: 140% 0; } 100% { background-position: -40% 0; } }
.tagline { animation: fadeIn 0.8s 0.3s both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.menu-btns .btn3d { overflow: hidden; animation: btnIn 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(0.35s + var(--i, 0) * 0.09s); }
@keyframes btnIn { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
.menu-btns .btn3d::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.42) 50%, transparent 62%); background-size: 260% 100%; background-repeat: no-repeat; background-position: 160% 0; }
.menu-btns .btn3d.primary::after { animation: shimmerIdle 5.5s ease-in-out 1.6s infinite; }
@media (hover: hover) { .menu-btns .btn3d:not(:disabled):hover::after { animation: shimmer 0.9s ease; } }
@keyframes shimmer { from { background-position: 160% 0; } to { background-position: -60% 0; } }
@keyframes shimmerIdle { 0%, 72% { background-position: 160% 0; } 100% { background-position: -60% 0; } }

/* ---------- pop-up informasi pada P&ID ---------- */
.side-tip { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--muted); background: #fff; border: 1px dashed var(--sv3); border-radius: 12px; padding: 8px 10px; margin: 0 0 12px; }
.side-tip svg { width: 18px; height: 18px; fill: var(--lb2); color: var(--lb2); flex: none; }
.pop { position: absolute; z-index: 7; width: min(320px, calc(100% - 16px)); max-height: var(--pop-max, 520px); display: flex; flex-direction: column; background: linear-gradient(180deg, #ffffff, #eff3f6); border-radius: 14px; padding: 12px 14px; box-shadow: 0 0 0 2px var(--lb), 0 16px 34px rgba(5, 10, 15, 0.45); opacity: 0; transform: translateY(6px) scale(0.98); transition: opacity 0.18s, transform 0.18s; }
.pop { scroll-margin: 12px; }
.pop-body { overflow-y: auto; min-height: 0; overscroll-behavior: contain; margin-right: -8px; padding-right: 8px; }
.pop.show { opacity: 1; transform: none; }
.pop p { font-size: 13.5px; margin-bottom: 8px; }
.pop .kv { font-size: 12.5px; margin: 4px 0 8px; }
.pop .note { font-size: 12.5px; }
.pop-head { padding-right: 34px; margin-bottom: 6px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.pop-head b { font-family: 'Baloo 2', sans-serif; font-size: 18px; color: var(--ink); line-height: 1.1; }
.pop-head span { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.pop-x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: none; display: grid; place-items: center; color: var(--ink); background: linear-gradient(180deg, #ffffff, #d3dae0); box-shadow: 0 2px 0 #9aa6b1, 0 3px 6px rgba(0, 0, 0, 0.2); }
@media (hover: hover) { .pop-x:hover { color: var(--red); } }
.pop-x svg { width: 14px; height: 14px; }
.pop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pop-arrow { position: absolute; width: 14px; height: 14px; background: #f7f9fb; border: 2px solid var(--lb); transform: rotate(45deg); }
.pop[data-side=right] .pop-arrow { left: -9px; top: calc(var(--ay, 30px) - 7px); border-top-color: transparent; border-right-color: transparent; }
.pop[data-side=left] .pop-arrow { right: -9px; top: calc(var(--ay, 30px) - 7px); border-bottom-color: transparent; border-left-color: transparent; }
.pop[data-side=below] .pop-arrow { top: -9px; left: calc(var(--ax, 30px) - 7px); border-bottom-color: transparent; border-right-color: transparent; }
.pop[data-side=above] .pop-arrow { bottom: -9px; left: calc(var(--ax, 30px) - 7px); border-top-color: transparent; border-left-color: transparent; }

/* ---------- laporan: perkecil dan petunjuk ---------- */
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal-min { width: 36px; height: 36px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.1); color: #fff; display: grid; place-items: center; flex: none; }
@media (hover: hover) { .modal-min:hover { background: rgba(255, 255, 255, 0.22); } }
.modal-min svg { width: 18px; height: 18px; }
.modal-wrap.minimized { background: transparent; backdrop-filter: none; pointer-events: none; }
.modal-wrap.minimized .modal { display: none; }
.modal-dock { position: fixed; left: 50%; bottom: 20px; z-index: 55; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 16px; background: rgba(17, 24, 31, 0.96); color: #fff; box-shadow: 0 0 0 2px var(--lb), 0 12px 30px rgba(0, 0, 0, 0.5); width: max-content; max-width: calc(100vw - 24px); transform: translate(-50%, 20px); opacity: 0; transition: transform 0.25s, opacity 0.25s; }
.modal-dock.show { transform: translate(-50%, 0); opacity: 1; }
.modal-dock b { display: block; font-size: 14px; }
.modal-dock span { display: block; font-size: 12px; color: var(--sv3); }
.dock-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); flex: none; animation: blink 1s steps(2) infinite; }
body.has-dock .toast { bottom: 96px; }
.hint-box { margin-top: 12px; border: 1px dashed #8fd3ef; background: var(--lb4); border-radius: 12px; padding: 10px 12px; }
.hint-head { display: flex; align-items: center; gap: 10px; }
.hint-head > div { flex: 1; }
.hint-head b { display: block; font-size: 13.5px; }
.hint-head small { color: var(--muted); font-size: 12px; }
.hint-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, #6fd0f5, var(--lb2)); box-shadow: 0 3px 0 #126e9c; flex: none; }
.hint-ico svg { width: 18px; height: 18px; fill: #fff; color: #fff; }
.hint-list { margin: 8px 0 0; padding-left: 22px; font-size: 13px; display: grid; gap: 4px; }
.hint-list:empty { display: none; }
.hint-list li { animation: slideIn 0.3s ease-out; }
.min-tip { margin: 10px 0 0; }
@media (max-width: 520px) {
  .modal-dock { flex-wrap: wrap; justify-content: center; text-align: center; }
  .hint-head { flex-wrap: wrap; }
}

/* ---------- pop-up pemilih perangkat dan program ---------- */
.pop.picker { width: min(440px, calc(100% - 16px)); }
.pop .pick-budget { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 0 0 2px; }
.pick-budget svg { width: 18px; height: 18px; fill: var(--sv3); flex: none; }
.pick-budget b { color: var(--ink); }
.pick-grp h5 { font-size: 10.5px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); margin: 10px 0 5px; font-weight: 800; }
.pick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.pick { display: grid; grid-template-columns: 34px 1fr; gap: 0 7px; align-items: center; text-align: left; padding: 5px 7px; border-radius: 11px; border: 2px solid var(--sv2); background: #fff; font: inherit; transition: transform 0.1s, border-color 0.1s; }
.pick:focus-visible { border-color: var(--lb3); outline: none; }
@media (hover: hover) { .pick:hover { border-color: var(--lb3); transform: translateY(-1px); } }
.pick .tcode { grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; font-weight: 800; color: var(--ink); background: radial-gradient(circle at 35% 30%, #fff, #e4e9ed 55%, #9ba7b2); border: 3px solid var(--c); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.22); }
.pick .tname { font-size: 11px; font-weight: 700; line-height: 1.15; color: var(--ink); }
.pick .tcost, .prog .tcost { font-size: 10.5px; font-weight: 800; color: var(--db); white-space: nowrap; }
.pick.current { border-color: var(--lb2); background: var(--lb4); }
.pick.poor, .prog.poor { opacity: 0.5; }
.pick-desc { flex: none; margin-top: 8px; font-size: 12px; line-height: 1.35; background: var(--lb4); border: 1px solid #cdeefb; border-radius: 10px; padding: 7px 9px; min-height: 50px; }
.prog-list { display: grid; gap: 6px; margin-bottom: 8px; }
.prog { display: grid; grid-template-columns: 42px 1fr auto; gap: 8px; align-items: center; text-align: left; padding: 6px 8px; border-radius: 11px; border: 2px solid var(--sv2); background: #fff; font: inherit; transition: transform 0.1s, border-color 0.1s; }
.prog:focus-visible { border-color: var(--lb3); outline: none; }
@media (hover: hover) { .prog:hover { border-color: var(--lb3); transform: translateY(-1px); } }
.prog .pcode { width: 42px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; background: linear-gradient(180deg, #6fd0f5, var(--lb2)); border: 2px solid #126e9c; }
.prog .pname { font-size: 11.5px; font-weight: 700; line-height: 1.2; color: var(--ink); }
.prog .pname em { margin-left: 6px; font-style: normal; font-size: 10px; font-weight: 800; color: #fff; background: var(--lb2); border-radius: 999px; padding: 0 6px; }
.prog.fit { border-color: var(--lb2); background: var(--lb4); }
.pop .pick-grp .note { margin: 0 0 6px; }
.budget-note { margin: 2px 0 4px; }
.cfg-row input[type=number] { font: inherit; padding: 8px 12px; border-radius: 10px; border: 2px solid var(--sv3); background: #fff; width: 140px; }
@media (max-width: 560px) { .pick-grid { grid-template-columns: 1fr; } }

/* ---------- simbol lintas sektor dan efek tambahan ---------- */
.pid-svg .layer-zones { pointer-events: none; }
.pid-svg .rot > * { transform-box: fill-box; transform-origin: center; }
.pid-svg.flowing .rot > * { animation: pidspin 1.1s linear infinite; }
@keyframes pidspin { to { transform: rotate(360deg); } }
.pid-svg .hflame { transform-box: fill-box; transform-origin: 0% 50%; animation: hflick 0.3s ease-in-out infinite alternate; }
.pid-svg .hflame.left { transform-origin: 100% 50%; }
@keyframes hflick { from { transform: scaleX(1); } to { transform: scaleX(1.16) scaleY(0.9); } }
.pid-svg:not(.flowing) .furn-flames, .pid-svg:not(.flowing) .hflame { opacity: 0.5; }
.pid-svg .fx-arc { animation: arcflick 0.16s steps(2, end) infinite; }
@keyframes arcflick { 0% { opacity: 1; } 50% { opacity: 0.35; } 100% { opacity: 1; } }
.pid-svg .fx-arcglow { transform-box: fill-box; transform-origin: center; animation: heatPulse 0.5s ease-in-out infinite; }
.pid-svg .fx-spark { animation: hiss 0.22s ease-in-out infinite alternate; }
body.no-anim .pid-svg.flowing .rot > *, body.no-anim .pid-svg .hflame { animation: none; }
body.no-fx .pid-svg .fx-arc, body.no-fx .pid-svg .fx-spark, body.no-fx .pid-svg .fx-arcglow { animation: none; }

/* ---------- pilihan skenario per sektor ---------- */
.sector-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.chip-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 2px solid var(--sv2); background: linear-gradient(180deg, #ffffff, #e8edf1); font: inherit; font-size: 13px; font-weight: 800; color: var(--ink); box-shadow: 0 2px 0 var(--sv3); transition: transform 0.1s, border-color 0.1s; }
.chip-tab svg { width: 16px; height: 16px; fill: var(--steel); }
.chip-tab b { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--sv2); font-size: 11.5px; text-align: center; }
@media (hover: hover) { .chip-tab:hover { border-color: var(--lb3); transform: translateY(-1px); } }
.chip-tab.active { border-color: var(--lb2); background: linear-gradient(180deg, #e9f8fe, #c9ecfa); }
.chip-tab.active svg { fill: var(--db); }
.chip-tab.active b { background: var(--lb2); color: #fff; }
.scn-sector { margin-top: 18px; }
.sector-h { display: flex; align-items: center; gap: 8px; font-size: 17px; color: var(--ink); padding-bottom: 6px; border-bottom: 2px solid var(--sv2); }
.sector-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(180deg, #6fd0f5, var(--lb2)); box-shadow: 0 2px 0 #126e9c; }
.sector-ico svg { width: 18px; height: 18px; fill: #fff; }
.pid-svg .eq-label.on-dark { stroke: rgba(11, 16, 21, 0.75); }

/* ---------- kasus faktor manusia: obrolan tim bergaya komik ---------- */
.ev-dot.hf { background: linear-gradient(180deg, #ffe082, #ffb300); color: #4e342e; }
.ev-dot.hf svg { width: 15px; height: 15px; fill: #4e342e; }
.ev-dot.hf.active { background: linear-gradient(180deg, #ffd54f, #f39c12); box-shadow: 0 0 0 3px #ffe8a3, inset 0 -3px 0 rgba(0, 0, 0, 0.25); }
.ev-dot.hf.done { opacity: 0.75; }
.hf-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; padding: 7px 9px; border-radius: 10px; background: #fff8e1; border: 1px dashed #f0b429; color: #5d4a1c; }
.hf-note svg { width: 18px; height: 18px; fill: #e09b00; flex: none; }
.chat-card h4 { display: flex; align-items: center; gap: 8px; }
.chat-card h4 > svg { width: 20px; height: 20px; fill: var(--db); }
.chat-card h4 .btn3d { margin-left: auto; padding: 5px 10px; font-size: 12px; }
.chat-card h4 .btn3d svg { width: 14px; height: 14px; }
.chat-log { list-style: none; padding: 2px 2px 6px; margin: 0; display: grid; gap: 9px; max-height: 300px; overflow: auto;
  background: radial-gradient(circle, rgba(31, 42, 53, 0.07) 1px, transparent 1.4px) 0 0 / 9px 9px, #fffdf6; border-radius: 12px; border: 2px solid #1f2a35; padding: 8px; }
.chat-log li.empty { color: var(--muted); font-size: 12.5px; }
.chat-msg { display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: start; animation: chatIn 0.35s cubic-bezier(.2, 1.4, .4, 1); }
.chat-msg .av svg, .cf-bub .av svg { width: 44px; height: 44px; display: block; }
.chat-msg .bub { position: relative; background: #fff; border: 2.4px solid #1f2a35; border-radius: 14px; padding: 6px 10px 7px; box-shadow: 3px 3px 0 #1f2a35; }
.chat-msg .bub::before { content: ''; position: absolute; left: -11px; top: 12px; border: 6px solid transparent; border-right: 9px solid #1f2a35; }
.chat-msg .bub::after { content: ''; position: absolute; left: -6.5px; top: 13.5px; border: 4.5px solid transparent; border-right: 7px solid #fff; }
.chat-msg .ch { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.chat-msg .ch b { font-size: 12.5px; color: var(--team); }
.chat-msg .ch small { font-size: 11px; color: var(--muted); font-weight: 700; }
.chat-msg .ch time { margin-left: auto; font-size: 11px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.chat-msg p { margin: 2px 0 0; font-size: 13px; line-height: 1.38; color: #1b1f24; font-weight: 600; }
@keyframes chatIn { from { opacity: 0; transform: translateY(8px) scale(0.96); } to { opacity: 1; transform: none; } }

.chat-float { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
/* Balon diletakkan JS pada koordinat kiri-atas. Kelas tail-down, tail-up, tail-left, dan tail-right
   menentukan sisi ekor yang menunjuk peralatan; kelas free berarti balon tanpa ekor. */
.cf-bub { position: absolute; left: 0; top: 0; transform: scale(0.85); transform-origin: var(--ox, 50%) var(--oy, 100%); opacity: 0; display: grid; grid-template-columns: 40px 1fr; gap: 7px; align-items: start; max-width: 290px;
  background: #fff; border: 2.6px solid #1b1f24; border-radius: 16px; padding: 7px 10px 8px 7px; box-shadow: 4px 4px 0 #1b1f24; transition: opacity 0.25s, transform 0.3s cubic-bezier(.2, 1.4, .4, 1); }
.cf-bub.show { opacity: 1; transform: scale(1); }
.cf-bub .av svg { width: 40px; height: 40px; }
.cf-bub b { display: block; font-size: 12px; color: var(--team); }
.cf-bub p { margin: 1px 0 0; font-size: 12.5px; line-height: 1.35; font-weight: 700; color: #1b1f24; }
.cf-bub::after, .cf-bub::before { content: none; position: absolute; }
.cf-bub.tail-down::after, .cf-bub.tail-up::after, .cf-bub.tail-left::after, .cf-bub.tail-right::after { content: ''; background: #1b1f24; }
.cf-bub.tail-down::before, .cf-bub.tail-up::before, .cf-bub.tail-left::before, .cf-bub.tail-right::before { content: ''; background: #fff; z-index: 1; }
.cf-bub.tail-down::after { left: var(--tail, 50%); bottom: -13px; width: 18px; height: 13px; transform: translateX(-50%); clip-path: polygon(0 0, 100% 0, 30% 100%); }
.cf-bub.tail-down::before { left: var(--tail, 50%); bottom: -8px; width: 12px; height: 9px; transform: translateX(-56%); clip-path: polygon(0 0, 100% 0, 30% 100%); }
.cf-bub.tail-up::after { left: var(--tail, 50%); top: -13px; width: 18px; height: 13px; transform: translateX(-50%); clip-path: polygon(30% 0, 100% 100%, 0 100%); }
.cf-bub.tail-up::before { left: var(--tail, 50%); top: -8px; width: 12px; height: 9px; transform: translateX(-56%); clip-path: polygon(30% 0, 100% 100%, 0 100%); }
.cf-bub.tail-left::after { top: var(--tail, 50%); left: -13px; width: 13px; height: 18px; transform: translateY(-50%); clip-path: polygon(100% 0, 100% 100%, 0 30%); }
.cf-bub.tail-left::before { top: var(--tail, 50%); left: -8px; width: 9px; height: 12px; transform: translateY(-56%); clip-path: polygon(100% 0, 100% 100%, 0 30%); }
.cf-bub.tail-right::after { top: var(--tail, 50%); right: -13px; width: 13px; height: 18px; transform: translateY(-50%); clip-path: polygon(0 0, 100% 30%, 0 100%); }
.cf-bub.tail-right::before { top: var(--tail, 50%); right: -8px; width: 9px; height: 12px; transform: translateY(-56%); clip-path: polygon(0 0, 100% 30%, 0 100%); }

.comic-wrap { position: fixed; inset: 0; z-index: 70; background: rgba(8, 12, 16, 0.72); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity 0.2s; }
.comic-wrap.show { opacity: 1; }
.comic-sheet { width: min(1080px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; background: #fbf4df; border: 4px solid #1b1f24; border-radius: 10px; box-shadow: 8px 8px 0 #1b1f24; padding: 14px 16px 12px; }
.comic-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.comic-head h3 { display: flex; align-items: center; gap: 8px; font-family: 'Baloo 2', 'Nunito', sans-serif; font-size: 22px; color: #1b1f24; margin: 0; }
.comic-head h3 svg { width: 24px; height: 24px; fill: #e09b00; }
.comic-head .btn3d { margin-left: auto; }
.comic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.comic-panel { position: relative; min-height: 210px; padding: 12px 12px 10px; border: 3px solid #1b1f24; background: radial-gradient(circle, rgba(27, 31, 36, 0.09) 1.1px, transparent 1.6px) 0 0 / 8px 8px, linear-gradient(160deg, #ffffff, #f4ecd4);
  box-shadow: 4px 4px 0 #1b1f24; display: flex; flex-direction: column; gap: 8px; }
.comic-panel.tilt { transform: rotate(-0.6deg); }
.comic-panel .scene { align-self: flex-start; max-width: calc(100% - 38px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 800 11.5px 'Baloo 2', 'Nunito', sans-serif; letter-spacing: 0.3px; background: #ffd54f; border: 2px solid #1b1f24; padding: 1px 8px; transform: rotate(-2deg); box-shadow: 2px 2px 0 #1b1f24; }
.comic-case { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; color: #5d4a1c; background: #fff3cd; border: 2px solid #1b1f24; border-radius: 999px; padding: 3px 10px; box-shadow: 2px 2px 0 #1b1f24; }
.comic-case svg { width: 14px; height: 14px; fill: #b26a00; }
.comic-panel .pnum { position: absolute; top: 8px; right: 10px; font: 800 13px 'Baloo 2', 'Nunito', sans-serif; color: #fff; background: #1b1f24; border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; }
.comic-panel .speech { position: relative; background: #fff; border: 2.6px solid #1b1f24; border-radius: 20px; padding: 9px 12px; font-weight: 700; font-size: 13.5px; line-height: 1.4; color: #1b1f24; }
.comic-panel .speech::after { content: ''; position: absolute; left: 30px; bottom: -14px; width: 20px; height: 14px; background: #1b1f24; clip-path: polygon(0 0, 100% 0, 15% 100%); }
.comic-panel .speech::before { content: ''; position: absolute; left: 33px; bottom: -8.5px; width: 13px; height: 9px; background: #fff; clip-path: polygon(0 0, 100% 0, 15% 100%); z-index: 1; }
.comic-panel .figure { margin-top: auto; display: flex; align-items: flex-end; gap: 8px; }
.comic-panel .figure svg { width: 74px; height: 74px; flex: none; }
.comic-panel .tag { display: grid; line-height: 1.2; }
.comic-panel .tag b { color: var(--team); font-size: 14px; }
.comic-panel .tag small { font-size: 11.5px; color: #44505c; font-weight: 700; }
.comic-panel .figure time { margin-left: auto; font-weight: 800; font-size: 12px; color: #44505c; font-variant-numeric: tabular-nums; }
.comic-panel.boom { align-items: center; justify-content: center; text-align: center; background: radial-gradient(circle, rgba(183, 28, 28, 0.18) 1.2px, transparent 1.7px) 0 0 / 8px 8px, linear-gradient(160deg, #fff3e0, #ffccbc); }
.comic-panel.boom .burst-wrap { position: relative; width: 100%; max-width: 250px; height: 112px; display: grid; place-items: center; }
.comic-panel.boom .burst { position: absolute; inset: 0; width: 100%; height: 100%; }
.comic-panel.boom b { position: relative; font: 800 32px 'Baloo 2', 'Nunito', sans-serif; color: #b71c1c; letter-spacing: 1px; transform: rotate(-4deg); text-shadow: 2px 2px 0 #fff; }
.comic-panel.boom p { position: relative; font-weight: 700; font-size: 13px; line-height: 1.4; color: #3e2723; margin: 4px 0 0; }

.hf-sec > b { display: flex; align-items: center; gap: 6px; }
.hf-sec > b svg { width: 16px; height: 16px; fill: #b26a00; }
.hf-sec .radios span b { color: #8a5300; }
.hf-lesson { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: #fff8e1; border: 2px solid #f0b429; }
.hf-lesson h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; color: #5d4a1c; }
.hf-lesson h4 svg { width: 18px; height: 18px; fill: #b26a00; }
.hf-lesson p { margin: 0 0 8px; font-size: 13.5px; }
.hf-controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.hf-controls b { font-size: 12.5px; margin-right: 4px; }
.bt-hf-txt { font-size: 10px; font-weight: 800; color: #6d4300; line-height: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bt-legend .lg.hf { background: #fff4dc; border: 1.6px dashed #e09b00; }
@media (prefers-reduced-motion: reduce) { .chat-msg, .cf-bub { animation: none; transition: none; } }
body.no-anim .chat-msg { animation: none; }

/* =====================================================================
   Ponsel dan tablet: sentuhan, ukuran target, dan tata letak ringkas
   ===================================================================== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
button, a, label, select, input, [role=tab] { touch-action: manipulation; }

/* tombol perbesar P&ID dan petunjuk cubit */
.pid-zoom { position: absolute; right: 10px; bottom: 10px; z-index: 3; display: flex; gap: 6px; opacity: 0.92; }
.pid-zoom button { width: 36px; height: 36px; padding: 0; border-radius: 10px; border: 1px solid var(--sv3); display: grid; place-items: center; color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #e2e7ec); box-shadow: 0 2px 0 var(--sv4), 0 3px 8px rgba(15, 22, 29, 0.18); }
.pid-zoom button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pid-zoom button:disabled { opacity: 0.4; cursor: default; }
/* saat belum diperbesar hanya tombol + yang berguna */
.pid-wrap:not(.zoomed) .pid-zoom [data-z=out], .pid-wrap:not(.zoomed) .pid-zoom [data-z=fit] { display: none; }
.pid-zoom button:focus-visible { outline: 3px solid var(--lb3); outline-offset: 2px; }
@media (hover: hover) { .pid-zoom button:not(:disabled):hover { color: var(--db); border-color: var(--lb3); } }
.pid-hint { position: absolute; left: 10px; top: 10px; z-index: 3; display: none; max-width: calc(100% - 20px); padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 800; color: var(--ink); background: rgba(255, 255, 255, 0.94); border: 1px solid var(--lb3); box-shadow: 0 2px 6px rgba(15, 22, 29, 0.15); pointer-events: none; }
.pid-wrap.show-hint:not(.zoomed) .pid-hint { display: block; }
.pid-svg { touch-action: pan-x pan-y; }
.pid-wrap.zoomed .pid-svg { touch-action: none; cursor: grab; }
.pid-wrap.panning .pid-svg { cursor: grabbing; }

/* pop-up sebagai lembar bawah di ponsel */
.pop.sheet { position: fixed; left: 8px; right: 8px; top: auto !important; bottom: 8px; bottom: max(8px, env(safe-area-inset-bottom)); width: auto; max-width: 560px; margin: 0 auto;
  max-height: min(70vh, 560px); max-height: min(70dvh, 560px); z-index: 48; padding-top: 20px; border-radius: 18px; transform: translateY(24px); }
.pop.sheet.show { transform: none; }
.pop.sheet::before { content: ''; position: absolute; top: 8px; left: 50%; width: 42px; height: 4px; margin-left: -21px; border-radius: 2px; background: var(--sv3); }
.pop.sheet .pop-arrow { display: none; }
.pick.armed, .prog.armed { border-color: var(--lb2); background: var(--lb4); box-shadow: 0 0 0 3px rgba(41, 171, 226, 0.3); }
.prog.current { border-color: #126e9c; background: #e3f4fb; }
.prog .pname em.cur { background: #126e9c; }
.pop.ef-pop { width: min(380px, calc(100% - 16px)); }
.pick-go { display: block; margin-top: 4px; font-weight: 800; color: var(--db); }

/* bilah aksi Tahap 2 pada tata letak bertumpuk: status dan tombol lapor selalu terjangkau */
.m-bar { display: none; position: fixed; left: 8px; right: 8px; bottom: 8px; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 40; max-width: 720px; margin: 0 auto;
  align-items: center; gap: 8px; padding: 7px 8px 7px 12px; border-radius: 16px; color: #fff; background: rgba(17, 24, 31, 0.96); box-shadow: 0 0 0 2px var(--lb), 0 10px 26px rgba(0, 0, 0, 0.5); }
.m-bar .mb-stat { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.m-bar .lamp { width: 12px; height: 12px; border-radius: 50%; background: var(--lb2); box-shadow: 0 0 6px var(--lb2); flex: none; }
.m-bar.alarm .lamp { background: var(--red); box-shadow: 0 0 10px var(--red); animation: blink 0.5s steps(2) infinite; }
.m-bar .mb-stat > div { min-width: 0; }
.m-bar b { display: block; font-size: 13.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-bar b.st-warn { color: #ffcf66; } .m-bar b.st-crit { color: #ff8a80; } .m-bar b.st-ok { color: var(--lb3); } .m-bar b.st-idle { color: var(--sv2); }
.m-bar small { display: block; font-size: 11.5px; line-height: 1.25; color: var(--sv3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-bar .btn3d { flex: none; padding: 8px 12px; min-height: 44px; font-size: 13px; }
.m-bar .btn3d svg { width: 16px; height: 16px; }
@media (max-width: 999px), (max-height: 599px), (orientation: portrait) and (max-width: 1199px) { .m-bar { display: flex; } }
body.has-dock .m-bar { display: none !important; }

/* petunjuk geser bow-tie */
.bt-hint { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.bt-hint svg { width: 16px; height: 16px; fill: var(--lb2); flex: none; }

/* target sentuh minimal sekitar 44 px dan input 16 px agar iOS tidak memperbesar halaman saat mengisi */
@media (pointer: coarse) {
  .btn3d.small { min-height: 44px; }
  .btn3d.icon-only { min-width: 44px; }
  .pop-x { width: 40px; height: 40px; top: 6px; right: 6px; }
  .pop-x svg { width: 16px; height: 16px; }
  .pop-head { padding-right: 46px; }
  .chip-tab, .tab { min-height: 44px; }
  .eq-list li, .hs-list li, .eq-insp li { min-height: 44px; }
  .radios label { min-height: 44px; align-items: center; }
  .radios input { width: 20px; height: 20px; margin: 0; flex: none; }
  .opt, .pick, .prog { min-height: 48px; }
  .tool { min-height: 52px; }
  .modal-min { width: 44px; height: 44px; }
  .chat-card h4 .btn3d { min-height: 40px; }
  .pid-zoom button { width: 40px; height: 40px; }
  .cfg-row input[type=text], .cfg-row input[type=number], .cfg-row select, .form-grid select { font-size: 16px; min-height: 44px; }
  input[type=range] { height: 40px; }
  .switch { width: 60px; height: 34px; }
  .switch::after { content: ''; position: absolute; inset: -6px -4px; }
  .hs-list li small, .eq-insp li small, .chain li small { font-size: 11.5px; }
  .tool .tcode { font-size: 11px; }
  .pick { grid-template-columns: 38px 1fr; }
  .pick .tcode { width: 38px; height: 38px; font-size: 10.5px; }
  .switch span::before { width: 28px; height: 28px; }
  .switch input:checked + span::before { transform: translateX(26px); }
}

/* ponsel tegak: bilah atas dua baris, stepper ikon, panel lebih rapat */
@media (max-width: 599px) {
  .topbar { flex-wrap: wrap; gap: 8px 10px; padding: 8px 10px; }
  .brand { flex: 1 1 0; }
  .brand-logo { height: 40px; }
  .top-actions .btn3d[data-act=menu] span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .top-actions .btn3d[data-act=menu] { padding: 8px 10px; min-width: 44px; }
  .stepper { order: 3; flex: 1 0 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .step, .step:not(.active) { justify-content: center; gap: 6px; padding: 5px 6px; }
  .step .lbl { display: none; }
  .play-main { padding: 8px; gap: 8px; }
  .side { padding: 10px; border-radius: 16px; }
  .card { padding: 10px 12px; }
  .toolbox { grid-template-columns: 1fr; }
  .screen.sub { padding: 12px 10px; }
  .panel { padding: 16px 14px 18px; border-radius: 20px; }
  .panel-head h2 { font-size: 22px; }
  .sector-tabs { flex-wrap: nowrap; overflow-x: auto; margin: 12px -14px 4px; padding: 2px 14px 10px; scroll-snap-type: x proximity; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 28px), transparent); }
  .sector-tabs::-webkit-scrollbar { display: none; }
  .chip-tab { flex: none; scroll-snap-align: start; }
  .result-top { flex-direction: column; align-items: stretch; gap: 6px; }
  .score-big { font-size: 60px; margin: 2px 0 6px; }
  .score-grid { grid-template-columns: repeat(2, 1fr); }
  .eval-sum { grid-template-columns: repeat(2, 1fr); }
  .bowtie { min-width: 860px; }
  .comic-head { flex-wrap: wrap; }
  .comic-head h3 { font-size: 18px; }
  .comic-sheet { padding: 12px; }
  .cf-bub { max-width: min(250px, calc(100% - 24px)); grid-template-columns: 30px 1fr; gap: 6px; padding: 5px 8px 6px 5px; border-width: 2px; box-shadow: 3px 3px 0 #1b1f24; }
  .cf-bub .av svg { width: 30px; height: 30px; }
  .cf-bub p { font-size: 12px; }
  .fx-banner { grid-template-columns: 32px 1fr auto; gap: 8px; padding: 8px 10px; }
  .fx-banner .wi { width: 32px; height: 32px; }
  .fx-banner .wi svg { width: 20px; height: 20px; }
  .fx-banner b { font-size: 13px; }
  .fx-banner span { font-size: 12px; }
  .m-bar .btn3d span { font-size: 12.5px; }
}
@media (max-width: 359px) {
  .m-bar .btn3d[id=mb-run] span { display: none; }
}

/* ponsel mendatar dan layar pendek */
@media (max-height: 500px) and (orientation: landscape) {
  .menu-card { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 4px 24px; width: min(780px, calc(100vw - 132px)); padding: 16px 22px; }
  .menu-card .logo-wrap { grid-column: 1; grid-row: 1; }
  .menu-card .tagline { grid-column: 1; grid-row: 2; margin: 6px 0 0; }
  .menu-card .menu-btns { grid-column: 2; grid-row: 1 / span 2; gap: 10px; }
  .btn3d.big { padding: 10px 18px; font-size: 16px; }
  .btn3d.big small { margin-left: 40px; }
  .topbar { padding: 6px 12px; gap: 10px; }
  .brand-logo { height: 38px; }
  .modal-wrap, .comic-wrap { padding: 8px; }
  .modal, .comic-sheet { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .modal-head { padding: 8px 16px; }
  .modal-head h3 { font-size: 18px; }
  .modal-body { padding: 10px 16px; }
  .modal-foot { padding: 8px 16px 10px; }
  .intro-ico { width: 44px; height: 44px; margin-bottom: 6px; box-shadow: 0 4px 0 #126e9c; }
  .intro-ico svg { width: 24px; height: 24px; }
  .eval-list { max-height: none; }
  .trend-wrap { height: 300px; }
  .pop.sheet { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
}

/* ---------- keandalan: klaim sebelum evaluasi, terverifikasi sesudahnya ---------- */
.card.rel h4 small { margin-left: auto; text-transform: uppercase; letter-spacing: 0.5px; font-size: 10.5px; }

/* ---------- jeda iklan Nusa Safety sebelum misi berikutnya ---------- */
.promo-screen { align-items: center; }
.promo { position: relative; z-index: 1; width: min(720px, 100%); margin: auto 0; background: linear-gradient(180deg, #232c36, #19212a); border: 1px solid #3a4652; border-radius: 22px; padding: 24px 28px; color: #e6ebf0; box-shadow: var(--shadow); animation: promoIn 0.35s ease-out; }
.promo:focus { outline: none; }
@keyframes promoIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.promo-tag { display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: #f2c14e; border: 1px solid rgba(242, 193, 78, 0.55); border-radius: 999px; padding: 3px 12px; }
.promo-head { display: flex; align-items: center; gap: 18px; margin: 16px 0 12px; }
.promo-logo { flex: none; display: grid; place-items: center; background: #fff; border-radius: 12px; padding: 14px 16px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35); }
.promo-logo img { display: block; width: 170px; height: auto; }
.promo-head h2 { font-size: 30px; line-height: 1.15; color: #fff; }
.promo-body { font-size: 15px; line-height: 1.6; color: #c9d2da; margin: 0 0 10px; }
.promo-cta { font-size: 13px; font-weight: 800; color: #e6ebf0; margin: 0 0 4px; }
.promo-contact { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 3px; }
.promo-contact a { color: #f2c14e; font-weight: 700; text-decoration: none; }
.promo-contact a:focus-visible { outline: 2px solid #f2c14e; outline-offset: 2px; border-radius: 4px; }
.promo-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.promo-btn { font: inherit; font-size: 14px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 11px 18px; border-radius: 12px; border: 1px solid #46525e; background: #222b34; color: #fff; text-decoration: none; cursor: pointer; }
.promo-btn.primary { background: linear-gradient(180deg, #ffd96a, #f4b400); border-color: #f4b400; color: #1b1f24; box-shadow: 0 6px 18px rgba(244, 180, 0, 0.32); min-width: 190px; font-variant-numeric: tabular-nums; }
.promo-btn:disabled { cursor: default; }
.promo-btn.primary:disabled { background: linear-gradient(180deg, #f1dc9c, #d9b24a); box-shadow: none; }
.promo-btn:focus-visible { outline: 3px solid #f2c14e; outline-offset: 2px; }
@media (hover: hover) {
  .promo-contact a:hover { text-decoration: underline; }
  .promo-btn:not(:disabled):hover { border-color: #f2c14e; }
  .promo-btn.primary:not(:disabled):hover { filter: brightness(1.05); }
}
.promo-prev { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid #333e49; font-size: 12.5px; color: #9aa6b1; }
@media (max-width: 599px) {
  .promo { padding: 18px 16px; border-radius: 18px; }
  .promo-head { flex-direction: column; align-items: flex-start; gap: 12px; margin: 14px 0 10px; }
  .promo-logo { padding: 10px 12px; }
  .promo-logo img { width: 150px; }
  .promo-head h2 { font-size: 23px; }
  .promo-body { font-size: 14px; }
  .promo-actions .promo-btn { flex: 1 1 auto; }
  .promo-actions .promo-btn.primary { flex-basis: 100%; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .promo { padding: 12px 20px; }
  .promo-head { margin: 8px 0 6px; gap: 14px; }
  .promo-logo { padding: 8px 12px; }
  .promo-logo img { width: 130px; }
  .promo-head h2 { font-size: 21px; }
  .promo-body { font-size: 13px; line-height: 1.5; margin-bottom: 6px; }
  .promo-cta { margin-bottom: 2px; }
  .promo-contact { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-bottom: 10px; }
  .promo-btn { min-height: 42px; padding: 9px 16px; }
  .promo-prev { margin-top: 8px; padding-top: 6px; }
}
@media (prefers-reduced-motion: reduce) { .promo { animation: none; } }

/* target sentuh tautan kontak minimal 44 px tanpa mengubah tata letak teks */
@media (pointer: coarse) {
  .promo-contact a { display: inline-flex; align-items: center; min-height: 44px; }
  .promo-contact { row-gap: 0; }
  .company-links .muted a { padding: 14px 2px; }
}
