/* cpr-hmi.css — HMI-only styles, ported from project doc SMA-floor-report-v3.html (§9.1)
 * Self-contained: hmi.html does NOT load cpr-tokens.css (different visual language: Roboto, its own tokens).
 */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Roboto', sans-serif; }
button, a { user-select: none; }

:root {
  --primary-blue: #005EFF; --primary-blue-light: #E6EFFF;
  --accent-orange: #FA8848; --accent-orange-light: #FFF3ED;
  --accent-purple: #8850E3; --accent-teal: #1ABC9C; --accent-teal-light: #EEFBF9;
  --accent-yellow: #FFC700; --accent-yellow-light: #FFFDF0;
  --accent-red: #EC575D; --accent-red-light: #FDE6EA;
  --machine-blue: #4678DD; --machine-blue-dark: #2F5FC4;
  --person-orange: #FA8848; --person-orange-dark: #E36F2D; --person-orange-text: #C2561B;
  --amber-strong: #B45309; --teal-strong: #0E8C74; --idle-grey: #C4C9D0;
  --dt-man: #FA8848; --dt-machine: #EC575D; --dt-material: #8850E3; --dt-method: #E052A8;
  --bg-screen: #F9F9FA; --bg-card: #FFFFFF; --text-dark: #222325; --text-muted: #5A5D62;
  --text-placeholder: #A9ACB0; --border-color: #EDEEF0; --border-radius: 8px;
  --shadow-hover: 0px 4px 12px 0px rgba(165, 163, 174, 0.08); --transition-speed: 0.3s;
  --critical: #E90229; --success: #3EB645; --warning: #F59E0B; --high: #F97316;
}

body { background-color: var(--bg-screen); color: var(--text-dark); display: flex; min-height: 100vh; overflow-x: hidden; }

.sidebar { width: 52px; background-color: var(--bg-card); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; align-items: center; padding: 20px 0; position: fixed; height: 100vh; z-index: 100; box-shadow: 0px 0px 8px 0px rgba(165,163,174,0.25); transition: width var(--transition-speed) cubic-bezier(0.4,0,0.2,1); overflow: hidden; white-space: nowrap; }
.sidebar:hover { width: 240px; }
.sidebar-header { width: 100%; display: flex; justify-content: center; align-items: center; padding-bottom: 24px; border-bottom: 1px solid var(--border-color); }
.sidebar:hover .sidebar-header { justify-content: flex-start; padding-left: 12px; }
.logo-container { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background-color: var(--primary-blue-light); border-radius: 8px; font-weight: 700; color: var(--primary-blue); font-size: 20px; }
.logo-text { font-size: 18px; font-weight: 700; margin-left: 12px; opacity: 0; transition: opacity var(--transition-speed); pointer-events: none; }
.sidebar:hover .logo-text { opacity: 1; }
.menu-list { width: 100%; list-style: none; margin-top: 24px; display: flex; flex-direction: column; gap: 8px; padding: 0 8px; }
.menu-item-link { display: flex; align-items: center; padding: 10px 12px; border-radius: 6px; text-decoration: none; color: var(--text-muted); transition: all var(--transition-speed); height: 44px; }
.menu-item-link:hover { background-color: var(--border-color); color: var(--text-dark); }
.menu-item-link.active { background-color: var(--primary-blue); color: var(--bg-card); }
.menu-icon { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; }
.menu-label { font-size: 14px; font-weight: 500; margin-left: 16px; opacity: 0; transition: opacity var(--transition-speed); }
.sidebar:hover .menu-label { opacity: 1; }

.main-container { margin-left: 52px; flex-grow: 1; display: flex; flex-direction: column; min-height: 100vh; }
.navbar { height: 60px; background-color: var(--bg-card); border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; padding: 0 24px; box-shadow: 0px 0px 4px 0px rgba(165,163,174,0.25); position: sticky; top: 0; z-index: 90; }
.brand-title { font-size: 14px; font-weight: 600; color: var(--primary-blue); letter-spacing: 0.3px; }
.navbar-right { display: flex; align-items: center; gap: 20px; }
.notification-btn { background: none; border: none; position: relative; cursor: pointer; color: var(--text-muted); width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: background-color var(--transition-speed); }
.notification-btn:hover { background-color: var(--border-color); }
.notification-badge { position: absolute; top: 2px; right: 2px; background-color: #E90229; color: white; font-size: 10px; font-weight: 700; border-radius: 50%; width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; }
.user-profile { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 4px 8px; border-radius: 6px; position: relative; }
.user-info { text-align: right; }
.username { font-size: 14px; font-weight: 500; }
.user-role { font-size: 12px; color: var(--text-muted); }
.avatar-placeholder { width: 36px; height: 36px; border-radius: 50%; background-color: var(--primary-blue-light); display: flex; align-items: center; justify-content: center; color: var(--primary-blue); font-weight: 700; border: 1px solid var(--border-color); }

.content-area { padding: 24px; max-width: 1600px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

.dashboard-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.dashboard-title { font-size: 24px; font-weight: 500; }
.header-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all var(--transition-speed); border: 1px solid transparent; }
.btn-outline { background: var(--bg-card); border-color: var(--primary-blue); color: var(--primary-blue); }
.btn-outline:hover { background: var(--primary-blue-light); }
.btn-icon { background: var(--bg-card); border-color: var(--border-color); color: var(--text-muted); padding: 0 11px; }
.btn-icon:hover { background: var(--border-color); color: var(--text-dark); }
.btn-danger-outline { background: var(--bg-card); border-color: var(--accent-red); color: var(--accent-red); }
.btn-danger-outline:hover { background: var(--accent-red-light); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.run-controls { display: flex; align-items: center; gap: 8px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; padding: 6px 10px; }
.btn-start { background: var(--primary-blue); color: #fff; font-weight: 700; }
.btn-start:hover { background: #0048C4; }
.btn-start.running { background: var(--accent-teal); }
.btn-stop { background: var(--bg-screen); color: var(--text-placeholder); font-weight: 700; border-color: var(--border-color); }
.btn-stop.enabled { background: var(--accent-red-light); color: var(--accent-red); border-color: var(--accent-red); cursor: pointer; }
.timer-segments { display: flex; align-items: center; gap: 4px; margin-left: 4px; }
.timer-box { background: var(--bg-screen); border: 1px solid var(--primary-blue); color: var(--primary-blue); border-radius: 6px; min-width: 44px; height: 36px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer-colon { color: var(--text-muted); font-weight: 700; }

.page-grid { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .page-grid { grid-template-columns: 1fr; } }
.left-rail, .main-col { display: flex; flex-direction: column; gap: 20px; }

.card { background: var(--bg-card); border-radius: var(--border-radius); border: 1px solid var(--border-color); overflow: hidden; transition: box-shadow var(--transition-speed); }
.card:hover { box-shadow: var(--shadow-hover); }
.card-pad { padding: 16px; }
.card-header-styled { padding: 10px 14px; color: #fff; font-weight: 700; font-size: 14px; background-color: var(--machine-blue); display: flex; justify-content: space-between; align-items: center; }
.header-detail-btn { background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.5); color: #fff; font-size: 12px; font-weight: 500; border-radius: 4px; padding: 3px 10px; cursor: pointer; }
.info-pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.info-label { font-size: 12px; color: var(--text-muted); }
.info-value { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* downtime banner (new, §9.2) */
.downtime-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--accent-red-light); border: 1px solid var(--accent-red); border-radius: 8px; padding: 12px 16px; }
.downtime-banner .db-text { font-weight: 700; color: #8A0016; font-size: 14px; }
.downtime-banner .db-timer { font-variant-numeric: tabular-nums; font-weight: 700; margin-left: 10px; }

/* Active Change Points (new, §9.2) */
.cp-item { border: 1px solid var(--border-color); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; transition: box-shadow .15s; }
.cp-item:hover { box-shadow: var(--shadow-hover); }
.cp-item:last-child { margin-bottom: 0; }
.cp-item .cp-top { display: flex; justify-content: space-between; align-items: center; }
.cp-item .cp-num { font-weight: 700; font-size: 13px; }
.cp-item .cp-reason { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.cp-item .cp-status { font-size: 11px; margin-top: 4px; }
.gate-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.gate-NONE { background: #EEF0F3; color: var(--text-muted); }
.gate-WARNING { background: #FFFDF0; color: var(--amber-strong); }
.gate-ACK_REQUIRED { background: #FFF3ED; color: #C2540C; }
.gate-HOLD { background: var(--accent-red-light); color: var(--critical); }
.risk-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.risk-LOW { background: #E7F8EA; color: var(--success); }
.risk-MEDIUM { background: #FFFDF0; color: var(--amber-strong); }
.risk-HIGH { background: #FFF3ED; color: var(--high); }
.risk-CRITICAL { background: var(--accent-red-light); color: var(--critical); }

.time-card-grid { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.clock-box { background: var(--machine-blue); color: #fff; border-radius: 8px; padding: 12px 14px; text-align: center; min-width: 108px; }
.clock-box .clock-lbl { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; opacity: 0.85; text-transform: uppercase; }
.clock-box .clock-val { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.plan-act-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.pa-item .pa-lbl { font-size: 11px; color: var(--text-muted); }
.pa-item .pa-val { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pa-item .pa-val.ontime { color: var(--teal-strong); }
.pa-item .pa-val.late { color: var(--accent-red); }
.pa-item .pa-val.pending { color: var(--text-placeholder); }

.ap-headline { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.ap-title { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.ap-value { font-size: 22px; font-weight: 700; }
.ap-bar-bg { background: var(--primary-blue-light); border-radius: 4px; height: 8px; overflow: hidden; margin-bottom: 4px; }
.ap-bar-fill { background: var(--primary-blue); height: 100%; width: 50%; border-radius: 4px; }
.ap-bar-caption { font-size: 11px; color: var(--text-muted); text-align: right; margin-bottom: 12px; }
.ap-rows { display: flex; flex-direction: column; }
.ap-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px dashed var(--border-color); }
.ap-row:last-child { border-bottom: none; }
.ap-ic { width: 26px; height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ap-lbl { font-size: 14px; flex-grow: 1; }
.ap-num { font-size: 16px; font-weight: 700; }

.card-title-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.card-title-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card-title-text { font-size: 15px; font-weight: 700; }
.count-chip { margin-left: auto; background: var(--accent-red-light); color: var(--accent-red); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.defect-list { display: flex; flex-direction: column; gap: 8px; max-height: 200px; overflow-y: auto; }
.defect-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; background: var(--bg-screen); border-radius: 6px; border-left: 3px solid transparent; }
.defect-item.sensor { border-left-color: var(--accent-purple); }
.defect-item.manual { border-left-color: var(--accent-orange); }
.defect-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.defect-code { font-size: 11px; color: var(--text-placeholder); margin-top: 1px; }
.badge-mini { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 3px; color: #fff; }
.badge-sensor { background: var(--accent-purple); }
.badge-manual { background: var(--accent-orange); }

.time-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) { .time-strip { grid-template-columns: repeat(2, 1fr); } }
.time-tile { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 12px 14px; border-top: 3px solid var(--border-color); }
.time-tile.operator { border-top-color: var(--person-orange); }
.time-tile.machine { border-top-color: var(--machine-blue); }
.tt-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.tt-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.tt-value { font-size: 26px; font-weight: 700; }
.tt-unit { font-size: 10px; color: var(--text-placeholder); margin-bottom: 6px; }
.tt-bar-bg { height: 5px; background: var(--bg-screen); border: 1px solid var(--border-color); border-radius: 3px; overflow: hidden; }
.tt-bar-fill { height: 100%; border-radius: 3px; width: 0%; }
.time-tile.operator .tt-bar-fill { background: var(--person-orange); }
.time-tile.machine .tt-bar-fill { background: var(--machine-blue); }

.timeline-title-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.timeline-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.timeline-legend { display: flex; gap: 12px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; color: var(--text-muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 2px; }
.timeline-chart-wrapper { display: grid; grid-template-columns: 56px 1fr; align-items: center; gap: 12px; background: var(--bg-screen); border: 1px solid var(--border-color); border-radius: 6px; padding: 14px 12px; }
.timeline-y-axis { font-size: 11px; font-weight: 700; color: var(--text-muted); text-align: center; }
.timeline-bar { display: flex; height: 44px; border-radius: 4px; overflow: hidden; position: relative; }
.timeline-segment { height: 100%; position: relative; cursor: pointer; }
.timeline-segment.idle { background: var(--idle-grey); }
.timeline-segment.running { background: var(--accent-teal); }
.timeline-segment.dt-man { background: var(--dt-man); }
.timeline-segment.dt-machine { background: var(--dt-machine); }
.timeline-segment.dt-material { background: var(--dt-material); }
.timeline-segment.dt-method { background: var(--dt-method); }
.timeline-segment.planned { background: var(--machine-blue); }
.timeline-segment.minor { background: var(--accent-yellow); }
.timeline-x-axis { display: flex; justify-content: space-between; padding: 2px 4px 0; }
.time-label { font-size: 10px; color: var(--text-muted); font-weight: 500; }
.cp-marker { position: absolute; top: -14px; font-size: 11px; color: var(--primary-blue); }

.metrics-andon-row { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: stretch; }
@media (max-width: 1100px) { .metrics-andon-row { grid-template-columns: 1fr; } }
.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.metric-block { border: 1px solid var(--border-color); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.metric-block.oee { background: var(--accent-teal-light); }
.metric-block.peff { background: var(--accent-yellow-light); }
.donut-wrap { position: relative; width: 128px; height: 128px; }
.donut-svg { transform: rotate(-90deg); }
.donut-bg { fill: none; stroke: rgba(0,0,0,0.07); stroke-width: 11; }
.donut-fill { fill: none; stroke-width: 11; stroke-linecap: round; stroke-dasharray: 339.3; stroke-dashoffset: 339.3; transition: stroke-dashoffset 1.1s ease-out; }
.donut-fill.oee { stroke: var(--teal-strong); }
.donut-fill.peff { stroke: var(--amber-strong); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-pct { font-size: 26px; font-weight: 700; }
.metric-block.oee .donut-pct { color: var(--teal-strong); }
.metric-block.peff .donut-pct { color: var(--amber-strong); }
.donut-name { font-size: 13px; font-weight: 700; }
.donut-scope { font-size: 10px; color: var(--text-muted); }
.factor-mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.metric-block.peff .factor-mini-grid { grid-template-columns: repeat(2, 1fr); }
.fm-tile { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 6px; padding: 8px 4px; text-align: center; }
.fm-val { font-size: 15px; font-weight: 700; }
.fm-val.good { color: var(--teal-strong); }
.fm-lbl { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

.andon-card { display: flex; flex-direction: column; gap: 12px; }
.action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.action-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; transition: all var(--transition-speed); text-decoration: none; min-height: 60px; justify-content: center; }
.action-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: var(--primary-blue); }
.action-icon-box { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; color: var(--primary-blue); }
.action-icon-box svg { width: 28px; height: 28px; }
.action-label-bar { background: var(--primary-blue); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 8px; border-radius: 4px; width: 100%; text-align: center; }
.history-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.history-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 9px 12px; display: flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none; }
.history-label-bar { background: var(--primary-blue-light); padding: 4px 10px; border-radius: 4px; flex-grow: 1; }
.history-label { color: var(--primary-blue); font-size: 12px; font-weight: 700; }

/* ---------------- Drawer / Modal / Toast (HMI-flavored, self-contained) ---------------- */
.overlay { position: fixed; inset: 0; background: rgba(20,22,28,.45); z-index: 500; display: none; }
.overlay.open { display: block; }
.hmi-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 520px; max-width: 94vw; background: #fff; z-index: 501; box-shadow: -8px 0 24px rgba(0,0,0,.14); transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; }
.hmi-drawer.open { transform: translateX(0); }
.hmi-drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 18px; border-bottom: 1px solid var(--border-color); }
.hmi-drawer-title { font-size: 17px; font-weight: 700; }
.hmi-drawer-close { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--bg-screen); font-size: 18px; }
.hmi-drawer-body { padding: 18px; overflow-y: auto; flex-grow: 1; display: flex; flex-direction: column; gap: 16px; }
.hmi-drawer-footer { padding: 16px 18px; border-top: 1px solid var(--border-color); display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.hmi-drawer-footer:empty { padding: 0; border-top: none; }

.hmi-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 460px; max-width: 92vw; background: #fff; border-radius: 12px; z-index: 502; box-shadow: 0 20px 50px rgba(0,0,0,.3); display: none; }
.hmi-modal.open { display: block; }
.hmi-modal-header { padding: 18px; border-bottom: 1px solid var(--border-color); }
.hmi-modal-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.hmi-modal-footer { padding: 16px 18px; border-top: 1px solid var(--border-color); display: flex; gap: 10px; justify-content: flex-end; }
.hmi-modal.hold .hmi-modal-header { background: var(--accent-red-light); color: #8A0016; }
.hmi-modal.warn .hmi-modal-header { background: #FFFDF0; color: var(--amber-strong); }

.toast-wrap { position: fixed; top: 16px; right: 16px; z-index: 600; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 260px; max-width: 360px; padding: 12px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; box-shadow: 0 6px 18px rgba(0,0,0,.15); color: #fff; }
.toast-success { background: var(--success); }
.toast-error { background: var(--critical); }
.toast-info { background: var(--machine-blue); }

/* 4M drawer stepper */
.stepper-body { display: flex; flex-direction: column; gap: 16px; }
.tile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile-btn { min-height: 56px; border: 1px solid var(--border-color); border-radius: 8px; background: #fff; font-size: 13px; font-weight: 600; padding: 10px; text-align: left; }
.tile-btn:hover { border-color: var(--primary-blue); box-shadow: var(--shadow-hover); }
.tile-btn.selected { background: var(--primary-blue-light); border-color: var(--primary-blue); color: var(--primary-blue); }
.q-field { display: flex; flex-direction: column; gap: 8px; }
.q-label { font-size: 13px; font-weight: 600; }
.q-label .req { color: var(--critical); }
.bool-yn { display: flex; gap: 10px; }
.bool-yn button { flex: 1; height: 52px; border-radius: 8px; border: 1px solid var(--border-color); background: #fff; font-weight: 700; font-size: 15px; }
.bool-yn button.sel-yes { background: #E7F8EA; border-color: var(--success); color: var(--success); }
.bool-yn button.sel-no { background: var(--accent-red-light); border-color: var(--accent-red); color: var(--accent-red); }
.q-input { height: 48px; border: 1px solid var(--border-color); border-radius: 8px; padding: 0 12px; font-size: 15px; width: 100%; }
.q-textarea { border: 1px solid var(--border-color); border-radius: 8px; padding: 10px 12px; font-size: 14px; width: 100%; min-height: 70px; }
.result-panel { border-radius: 10px; padding: 16px; }
.result-panel.not-cpr { background: #E7F8EA; border: 1px solid var(--success); }
.result-panel.review { background: #FFFDF0; border: 1px solid var(--amber-strong); }
.result-panel.cpr { background: var(--accent-red-light); border: 1px solid var(--critical); }
.result-panel h4 { font-size: 15px; margin-bottom: 6px; }
.result-req-list { margin: 8px 0; padding-left: 18px; font-size: 13px; }
.retry-link { font-size: 11px; color: var(--text-muted); text-decoration: underline; background: none; border: none; cursor: pointer; }

button:focus-visible, a:focus-visible { outline: 2px solid var(--primary-blue); outline-offset: 2px; border-radius: 6px; }

/* P7: Demo Script (assets/cpr-shell.js Shell.demoScriptModal) reuses the generic .modal/.tabs-bar
   markup shared with the rest of the app, but this page stays deliberately self-contained (see
   file header), so those classes are re-styled here with HMI's own tokens rather than pulling in
   cpr-tokens.css wholesale. */
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 460px; max-width: 92vw; background: var(--bg-card); border-radius: var(--border-radius); z-index: 502; box-shadow: 0 20px 50px rgba(0,0,0,.3); display: none; max-height: 86vh; overflow-y: auto; }
.modal.open { display: block; }
.modal.modal-wide { width: 720px; }
.modal-header { padding: 18px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.modal-footer { padding: 16px 18px; border-top: 1px solid var(--border-color); display: flex; gap: 10px; justify-content: flex-end; }
.modal-footer:empty { padding: 0; border-top: none; }
.drawer-close { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--bg-screen); font-size: 18px; cursor: pointer; }
.btn-ghost { background: transparent; color: var(--text-dark); border-color: var(--border-color); }
.btn-ghost:hover { background: var(--bg-screen); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.tabs-bar { display: flex; gap: 4px; }
.tab-btn { background: none; border: none; padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; cursor: pointer; }
.tab-btn:hover { color: var(--text-dark); }
.tab-btn.active { color: var(--primary-blue); border-bottom-color: var(--primary-blue); }
.demo-script-list { display: flex; flex-direction: column; gap: 10px; }
.demo-step { border: 1px solid var(--border-color); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.demo-step .ds-role { font-weight: 700; color: var(--primary-blue); }
.sticky-fab { position: fixed; right: 22px; bottom: 22px; width: 52px; height: 52px; border-radius: 50%; background: var(--primary-blue); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px rgba(0,94,255,.35); z-index: 550; text-decoration: none; border: none; cursor: pointer; transition: transform .15s ease; }
.sticky-fab:hover { transform: scale(1.06); background: #0048C4; }
.sticky-fab-script { background: var(--accent-purple); box-shadow: 0 10px 24px rgba(136,80,227,.35); }
.sticky-fab-script:hover { background: #6F3ECB; }
