*,*::before,*::after{box-sizing:border-box}
body{font-family:'Segoe UI',sans-serif;background:#f6f7fb;margin:0;padding:24px;color:#0f172a}
body.page--login{min-height:100vh;padding:16px;background:#0b6b3a;display:flex;align-items:center;justify-content:center}
body.auth-locked{min-height:100vh;overflow:hidden;background:#0b6b3a}
body.name-editor-open{overflow:hidden}
#appRoot{min-height:100vh}
#appRoot[hidden]{display:none}
body.auth-locked #appRoot{opacity:0;pointer-events:none}
.auth-overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:24px;background:#0b6b3a url('../images/doken_logo2_bg.ico') no-repeat center/180px;z-index:1000}
.auth-overlay[hidden]{display:none!important}
.login-page{width:100%;max-width:480px}
.auth-card{background:#fff;border-radius:16px;box-shadow:0 20px 60px rgba(0,0,0,0.25);padding:32px 28px;max-width:360px;width:100%;text-align:center;margin:0 auto}
.auth-card__logo{width:64px;height:64px;object-fit:contain;margin:0 auto 12px;display:block}
.auth-card h1{margin:0 0 10px;font-size:22px;color:#0f172a}
.auth-card__hint{margin:0 0 20px;color:#475569;font-size:14px}
.auth-field{display:flex;flex-direction:column;text-align:left;gap:6px;margin-bottom:14px;font-size:14px;color:#475569}
.auth-field input{padding:10px 12px;border:1px solid #cbd5f5;border-radius:8px;font-size:15px}
.auth-remember{display:flex;align-items:center;gap:8px;font-size:13px;color:#0f172a;margin-bottom:14px;justify-content:flex-start}
.auth-remember input{accent-color:#0078d7;width:16px;height:16px}
.auth-error{margin-bottom:12px;color:#d1342f;font-size:13px;font-weight:600}
.auth-submit{width:100%;padding:12px;border:none;border-radius:8px;background:#0078d7;color:#fff;font-weight:600;font-size:15px;cursor:pointer}
.auth-submit:focus-visible{outline:2px solid #0f172a;outline-offset:2px}
.device-discovery{display:flex;justify-content:center;padding:30px 16px}
.device-discovery__card{background:#fff;max-width:720px;width:100%;border-radius:18px;box-shadow:0 25px 80px rgba(15,23,42,0.18);padding:32px}
.device-discovery__card h2{margin:0 0 12px;font-size:24px;color:#0f172a;text-align:center}
.device-discovery__card p{text-align:center;margin:0 0 18px;color:#475569;font-size:14px}
.device-discovery__actions{display:flex;justify-content:center;gap:12px;margin-bottom:16px;flex-wrap:wrap}
.device-discovery__search-input{flex:1 1 260px;max-width:360px;padding:10px 14px;border:1px solid #cbd5f5;border-radius:10px;font-size:14px;background:#fff;box-shadow:inset 0 1px 2px rgba(15,23,42,0.08)}
.device-discovery__search-input:focus{outline:2px solid #0078d7;outline-offset:2px}
.device-discovery__type-select{flex:0 1 160px;padding:10px 12px;border:1px solid #cbd5f5;border-radius:10px;font-size:14px;background:#fff;color:#0f172a}
.device-discovery__type-select:focus{outline:2px solid #0078d7;outline-offset:2px}
.device-discovery__btn{padding:10px 18px;border:none;border-radius:10px;font-weight:600;cursor:pointer;font-size:14px;background:#0078d7;color:#fff}
.device-discovery__btn--ghost{background:#e2e8f0;color:#0f172a}
.device-discovery__status{text-align:center;font-size:13px;color:#475569;margin-bottom:16px}
.device-discovery__list{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;max-height:340px;overflow:auto}
.device-discovery__item{min-width:140px;padding:12px 16px;border-radius:12px;border:1px solid #cbd5f5;background:#f8fafc;cursor:pointer;text-align:center;font-weight:600;color:#0f172a;transition:transform .15s ease,box-shadow .15s ease}
.device-discovery__item:hover,.device-discovery__item:focus{transform:translateY(-2px);box-shadow:0 10px 24px rgba(2,132,199,0.25);outline:none}
.device-discovery__empty{color:#94a3b8;font-size:13px}
.dashboard-stage__head{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.device-back-btn{padding:8px 14px;border-radius:999px;border:1px solid #0f172a;background:#0f172a;color:#fff;font-weight:600;font-size:12px;cursor:pointer}
.device-back-btn[hidden]{display:none!important}
.selected-device{padding:6px 14px;border-radius:999px;background:#e0f2fe;color:#0369a1;font-weight:600;font-size:13px}
h2{text-align:center;margin:0 0 20px;color:#222}
#dashboardStage[hidden]{display:none!important}
#deviceDiscoveryStage[hidden]{display:none!important}
#status{text-align:center;font-weight:600;margin-bottom:12px}
.dashboard-unsupported{max-width:1200px;margin:20px auto;padding:32px 26px;border:1px dashed #cbd5f5;border-radius:16px;background:#fff8f0;text-align:center;box-shadow:0 10px 30px rgba(15,23,42,0.06)}
.dashboard-unsupported h3{margin:0 0 10px;font-size:20px;color:#b45309}
.dashboard-unsupported p{margin:0 0 14px;color:#92400e;font-weight:500}
.dashboard-unsupported__action{display:inline-flex;justify-content:center;align-items:center;padding:10px 18px;border-radius:999px;background:#b45309;color:#fff;font-weight:600;text-decoration:none;transition:background .2s}
.dashboard-unsupported__action:hover{background:#92400e}
.dashboard-unsupported__action[hidden]{display:none!important}
.device-list{max-width:1200px;margin:0 auto 18px;background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:18px;box-shadow:0 4px 18px rgba(15,23,42,0.08)}
.device-list__header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:10px}
.device-list__title{margin:0;font-size:18px;font-weight:600;color:#0f172a}
.device-list__meta{font-size:13px;color:#64748b;font-weight:500}
.device-list__rows{display:flex;flex-direction:column;gap:10px}
.device-list__rows[hidden]{display:none!important}
.device-list__row{display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:12px 14px;border-radius:12px;border:1px solid #e2e8f0;background:#f8fafc;font-weight:600;color:#0f172a;transition:background .2s,color .2s,border-color .2s}
.device-list__row--active{border-color:#34d399;background:#ecfdf3;color:#065f46}
.device-list__row--inactive{border-color:#e2e8f0;background:#f1f5f9;color:#475569}
.device-list__row--unnamed:not(.device-list__row--active){background:#fffbea;border-color:#fde68a;color:#92400e}
.device-list__row-top{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%}
.device-list__col{display:flex;align-items:center;gap:10px;font-size:14px}
.device-list__mac{font-family:monospace;letter-spacing:.05em}
.device-list__label{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.device-list__name{font-size:13px;color:#334155;font-weight:600}
.device-list__row--active .device-list__name{color:#065f46}
.device-list__tag-group{display:flex;align-items:center;gap:6px}
.device-list__action-btn{width:30px;height:30px;border:none;border-radius:50%;font-size:16px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.device-list__action-btn--add{background:rgba(15,23,42,0.08);color:#0f172a}
.device-list__action-btn--remove{background:#dc2626;color:#fff}
.device-list__action-btn:focus-visible{outline:2px solid #0f172a;outline-offset:2px}
.device-list__tag{font-size:13px;letter-spacing:.08em;text-transform:uppercase;color:#0f172a;padding:4px 10px;border-radius:999px;background:rgba(15,23,42,0.08)}
.device-list__row--active .device-list__tag{background:rgba(5,150,105,0.12);color:#065f46}
.device-list__row--active .device-list__action-btn--add{background:rgba(5,150,105,0.12);color:#065f46}
.device-list__status-dot{width:10px;height:10px;border-radius:999px;background:#94a3b8}
.device-list__row--active .device-list__status-dot{background:#16a34a}
.device-list__row--inactive .device-list__status-dot{background:#94a3b8}
.device-list__row-meta{display:flex;align-items:center;justify-content:space-between;width:100%;gap:12px;font-size:12px;letter-spacing:.02em}
.device-list__state{font-weight:700;min-width:120px}
.device-list__meta-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end;width:100%}
.device-list__history{font-weight:500;color:#475569}
.device-list__row--active .device-list__state{color:#047857}
.device-list__row--inactive .device-list__state{color:#475569}
.device-list__details-btn{padding:4px 10px;border-radius:999px;border:1px solid #cbd5f5;background:#fff;color:#0f172a;font-size:11px;font-weight:600;cursor:pointer}
.device-list__details{width:100%;border-top:1px dashed #cbd5f5;padding-top:8px;margin-top:4px}
.device-list__details-empty{font-size:12px;color:#94a3b8}
.device-list__details-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}
.device-list__details-list li{display:flex;align-items:center;justify-content:space-between;font-size:12px;color:#0f172a;font-weight:500}
.device-list__empty{font-size:14px;color:#94a3b8;text-align:center;padding:14px;border-radius:12px;border:1px dashed #cbd5f5;margin-bottom:4px}
.device-list__empty[hidden]{display:none!important}
.controls{text-align:center;margin-bottom:16px}
.button-row{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:6px;margin-bottom:8px}
.controls{position:relative}
.input-row{display:flex;justify-content:center;flex-wrap:wrap;gap:12px}
.controls label{display:flex;flex-direction:column;gap:4px;font-size:13px;color:#475569}
.controls input{margin:0;padding:6px 10px;border:1px solid #ccc;border-radius:6px;width:110px;text-align:center}
.controls input[type="datetime-local"]{width:220px;text-align:left}
.input-row--range{display:flex;align-items:flex-end;margin-top:10px;flex-wrap:wrap;gap:12px;justify-content:center}
.range-fetch-btn{height:38px;padding:0 16px;border:none;border-radius:6px;background:#16a085;color:#fff;font-weight:600;cursor:pointer}
.range-fetch-btn--secondary{background:#0f172a}
.range-fetch-btn:disabled{opacity:.5;cursor:not-allowed}
.range-quick-controls{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;justify-content:center}
.range-settings-btn{margin-left:4px;width:38px;height:38px;border-radius:50%;border:1px solid #cbd5f5;background:#fff;color:#0f172a;font-size:18px;font-weight:600;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:all .15s ease}
.range-settings-btn:disabled{opacity:.4;cursor:not-allowed}
.range-settings-btn:not(:disabled):hover{background:#0f172a;color:#fff;border-color:#0f172a}
.range-settings-btn:focus-visible{outline:2px solid #0078d7;outline-offset:2px}
.range-quick-controls label{display:flex;flex-direction:column;font-size:12px;color:#475569}
.range-quick-controls select{width:140px;padding:6px 8px;border:1px solid #cbd5f5;border-radius:6px;background:#fff;font-size:13px}
.range-quick-controls select:disabled{opacity:.6}
.range-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.range-action-btn{height:38px;padding:0 16px;border:none;border-radius:6px;background:#0f172a;color:#fff;font-weight:600;cursor:pointer}
.range-action-btn:disabled{opacity:.5;cursor:not-allowed}
.range-action-btn--auto{background:#d1342f}
.range-action-btn--auto.range-action-btn--active{background:#16a085}
.range-hint{font-size:12px;color:#475569;flex:1 1 100%;text-align:center;padding-top:4px}
.controls button{margin:0;padding:6px 10px;border:none;border-radius:6px;cursor:pointer;background:#0078d7;color:#fff;font-weight:600}
.controls button:disabled{opacity:.55;cursor:not-allowed}
#liveDataBtn.live-ready{background:#d1342f}
.paste-area{max-width:1200px;margin:18px auto 0;text-align:left}
.paste-area__hint{margin:0 0 8px;font-size:14px;color:#475569}
.paste-area textarea{width:100%;min-height:220px;padding:12px;border:1px solid #cbd5f5;border-radius:10px;font-family:monospace;font-size:13px;box-shadow:inset 0 1px 2px rgba(0,0,0,0.08);background:#fff}
.button-row--secondary{justify-content:flex-end}
.device{background:#fff;border-radius:12px;box-shadow:0 3px 12px rgba(0,0,0,0.08);padding:24px;margin:0 0 30px;width:100%}
.device-panel{background:#fdfdfd;border:1px solid #e5e7eb;border-radius:10px;padding:16px;margin-top:18px}
.device-panel h4{margin:0 0 10px;font-size:15px;color:#0f172a}
.chart-panel__title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px;flex-wrap:wrap}
.chart-panel__title h4{margin:0}
.chart-panel__controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.sensor-panel__body{margin-top:10px}
.sensor-panel-collapsed .sensor-panel__body{display:none}
.chart-toggle{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.chart-toggle__btn{padding:4px 12px;border-radius:999px;border:1px solid #cbd5f5;background:#fff;font-size:12px;font-weight:600;color:#475569;cursor:pointer;transition:all .15s ease}
.chart-toggle__btn--active{background:#0f172a;color:#fff;border-color:#0f172a}
.chart-toggle__btn:focus-visible{outline:2px solid #0078d7;outline-offset:2px}
.sensor-collapse-btn{padding:4px 10px;border-radius:8px;border:1px solid #cbd5f5;background:#eef2ff;font-size:12px;font-weight:600;color:#1e293b;cursor:pointer;transition:all .15s ease}
.sensor-collapse-btn:hover{background:#dbeafe}
.sensor-collapse-btn:focus-visible{outline:2px solid #0078d7;outline-offset:2px}
.device-grid{display:grid;grid-template-columns:repeat(2,minmax(320px,1fr));gap:20px;margin-top:18px}
.device-head-mobile{display:none;flex-direction:column;gap:12px;margin-top:12px}
.device-head-mobile__section{border:1px solid #e2e8f0;border-radius:12px;padding:12px;background:#fff}
.device-head-mobile__section-title{font-size:12px;color:#475569;text-transform:uppercase;letter-spacing:.08em;margin:0 0 8px}
.device-head-mobile__values{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:8px}
.device-head-mobile__item{background:#f8fafc;border-radius:8px;padding:8px}
.device-head-mobile__label{display:block;font-size:11px;color:#475569;font-weight:600;margin-bottom:2px;text-transform:uppercase;letter-spacing:.08em}
.device-head-mobile__value{font-size:14px;font-weight:600;color:#0f172a}
.device-head-mobile__value--status{display:flex;align-items:center;gap:8px}
.device-head-mobile__value--time{color:#1d4ed8}
.device-panel--wide{grid-column:span 2}
.chart-divider{grid-column:span 2;display:flex;align-items:center;gap:12px;margin:4px 0 8px}
.chart-divider__line{flex:1;height:1px;background:#dcdcdc}
.chart-divider__label{font-weight:600;color:#0f172a;letter-spacing:.4px;white-space:nowrap}
.panel-toggle__title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0;font-size:15px;color:#0f172a;cursor:pointer;user-select:none}
.panel-toggle__title:focus-visible{outline:2px solid #0078d7;outline-offset:4px}
.panel-toggle__indicator{width:22px;height:22px;border-radius:50%;background:#e2e8f0;color:#0f172a;display:inline-flex;align-items:center;justify-content:center;font-weight:600;font-size:13px;flex-shrink:0}
.panel-toggle__indicator::before{content:"−"}
.panel-toggle__body{margin-top:12px}
.panel-collapsed .panel-toggle__body{display:none}
.panel-collapsed .panel-toggle__indicator::before{content:"+"}
.device-list__row-top{flex-wrap:wrap}
@media(max-width:640px){
.device-discovery{padding:20px 10px}
.device-discovery__card{padding:24px 18px}
.device-discovery__actions{flex-direction:column;align-items:stretch}
.device-discovery__search-input,.device-discovery__type-select{max-width:100%;width:100%}
.device-list{padding:14px}
.device-list__row{padding:12px}
.device-list__row-top{flex-direction:column;align-items:flex-start;gap:10px}
.device-list__tag-group{width:100%;justify-content:space-between}
.device-list__row-meta{flex-direction:column;align-items:flex-start;gap:6px}
.controls .input-row{flex-direction:column;align-items:stretch}
.range-actions{justify-content:center;width:100%}
}
.name-editor-overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(15,23,42,0.6);z-index:1200;padding:16px}
.name-editor-overlay[hidden]{display:none!important}
.name-editor{background:#fff;border-radius:16px;max-width:420px;width:100%;box-shadow:0 20px 50px rgba(15,23,42,0.3);padding:20px;display:flex;flex-direction:column;gap:12px;max-height:90vh;overflow:auto}
.name-editor h3{margin:0;font-size:20px;color:#0f172a}
.name-editor__fields{display:flex;flex-direction:column;gap:10px}
.name-editor label{display:flex;flex-direction:column;font-size:13px;color:#475569;font-weight:600;gap:6px}
.name-editor input,.name-editor textarea{padding:10px;border:1px solid #cbd5f5;border-radius:8px;font-size:14px}
.name-editor textarea{min-height:80px;resize:vertical}
.name-editor__actions{display:flex;justify-content:flex-end;gap:10px;margin-top:4px}
.name-editor__actions button{border:none;border-radius:8px;padding:10px 16px;font-weight:600;cursor:pointer}
.name-editor__actions button[name='cancel']{background:#e2e8f0;color:#0f172a}
.name-editor__actions button[type='submit']{background:#0078d7;color:#fff}
.name-editor__error{color:#dc2626;font-size:13px;font-weight:600}
.name-delete-overlay .name-editor{border:2px solid #dc2626;box-shadow:0 25px 60px rgba(220,38,38,0.45)}
.name-delete-overlay h3{color:#b91c1c}
.name-delete-overlay [data-role='delete-hint'],
.name-delete-overlay [data-role='delete-mac'],
.name-delete-overlay [data-role='delete-device-name']{color:#b91c1c;font-weight:700}

@media(max-width:1024px){
  body{padding:18px}
  .device-grid{grid-template-columns:1fr}
}

@media(max-width:768px){
  body{padding:12px}
  .device-discovery{padding:16px 10px}
  .device-discovery__card{padding:20px;border-radius:0;max-width:none;width:100%;box-shadow:none}
  .device-list{padding:14px}
  .device-list__row-top{flex-direction:column;align-items:flex-start}
  .device-list__meta-actions{justify-content:flex-start}
  .device-list__details-btn{width:100%;text-align:center}
  .device-list__tag-group{width:100%;justify-content:flex-start}
  .controls{padding:0 8px}
  .input-row{flex-direction:column;align-items:stretch}
  .input-row label{width:100%}
  .controls input{width:100%}
  .range-quick-controls{flex-direction:column}
  .range-quick-controls select{width:100%}
  .device-list,.device-list--discovery{width:100%;max-width:none;border-radius:0}
}

@media(max-width:600px){
  body.page--login{padding:12px}
  .auth-card{padding:24px 20px}
  .device-discovery__card h2{font-size:20px}
  .device-list__row{padding:12px}
  .device-list__row-meta{flex-direction:column;align-items:flex-start}
  .device-list__state{min-width:auto}
  .name-editor-overlay{align-items:flex-end}
  .name-editor{max-width:none;border-radius:20px 20px 0 0;padding:24px}
  .name-editor__actions{flex-direction:column-reverse}
  .name-editor__actions button{width:100%}
  .device-head-mobile{display:flex;flex-direction:column;gap:10px}
  .device-grid{grid-template-columns:1fr}
}
.confirm-modal{background:#fff;border-radius:16px;max-width:520px;width:100%;box-shadow:0 20px 50px rgba(15,23,42,0.3);padding:22px;display:flex;flex-direction:column;gap:12px}
.confirm-modal h3{margin:0;font-size:20px;color:#0f172a}
.confirm-modal p{margin:0;font-size:14px;color:#475569;line-height:1.5}
.confirm-modal label{display:flex;flex-direction:column;font-size:13px;color:#475569;font-weight:600;gap:6px}
.confirm-modal input{padding:10px;border:1px solid #cbd5f5;border-radius:8px;font-size:14px}
.confirm-modal code{background:#f1f5f9;padding:0 6px;border-radius:4px;font-weight:600;color:#0f172a}
@media(max-width:1200px){
  body{padding:16px}
}
@media(max-width:900px){
  .device-grid{grid-template-columns:minmax(260px,1fr)}
  .device-panel--wide{grid-column:span 1}
}
body.is-mobile-device .device-grid{display:flex;flex-direction:column;gap:16px}
body.is-mobile-device .device-grid>*{width:100%}
body.is-mobile-device .panel-dev table.device-head{display:none}
body.is-mobile-device .device-head-mobile{display:flex;flex-direction:column;gap:10px;margin-top:12px}
body.is-mobile-device .device-panel.panel-dev{padding-bottom:8px}
@media(max-width:600px){
  body.is-mobile-device .device-head-mobile{gap:10px}
}
.panel-dev{margin-top:10px}
.device-panel table{margin-top:0}
.legend-grid{display:flex;flex-wrap:wrap;gap:16px;margin:0 auto 20px;max-width:1200px}
.legend-card{background:#fff;border-radius:12px;box-shadow:0 2px 8px rgba(0,0,0,0.06);padding:16px;flex:1 1 340px}
.legend-card h4{margin:0 0 10px;color:#0078d7}
.legend-table{width:100%;border-collapse:collapse;font-size:13px}
.legend-table th{background:#e9f2ff;color:#065ea8}
.head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;font-size:18px;font-weight:600;color:#0078d7;gap:12px;flex-wrap:wrap}
.head__meta{font-size:13px;font-weight:500;color:#475569}
table{width:100%;border-collapse:collapse;margin-top:10px;font-size:14px}
th,td{border:1px solid #dcdcdc;padding:6px 8px;text-align:center;vertical-align:middle}
.device-head{width:100%;border-collapse:separate;border-spacing:0;margin-top:6px}
.device-head td,.device-head th{padding:12px 8px;text-align:center;vertical-align:middle}
.device-head__row{background:#fff}
.device-head__row td{border-bottom:1px solid #e2e8f0}
.device-head__row:last-child td{border-bottom:none}
.device-head__row--history td{background:#f8fafc}
.device-head__cell--lead{font-weight:600;color:#0f172a;min-width:160px;text-align:center;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:6px;min-height:64px}
.device-head__status{display:flex;align-items:center;justify-content:center;gap:8px;text-align:center}
.device-head__status-dot{width:14px;height:14px;border-radius:999px;background:#94a3b8;position:relative}
.device-head__status-dot::after{content:"";position:absolute;inset:-4px;border-radius:999px;border:2px solid rgba(148,163,184,0.4);opacity:0;transition:opacity .2s}
.device-head__status-dot--active{background:#22c55e;box-shadow:0 0 0 rgba(34,197,94,0.45);animation:statusPulse 1.6s infinite}
.device-head__status-dot--active::after{border-color:rgba(34,197,94,0.45);opacity:1}
.device-head__time-label{font-weight:600;color:#1d4ed8;display:flex;align-items:center;justify-content:center;width:100%}
.heading-cell{min-width:90px}
th{background:#0078d7;color:#fff}
.log-panel{max-width:1200px;margin:14px auto;background:#fff;border:1px solid #ddd;border-radius:8px;padding:10px}
.log-panel summary{cursor:pointer;font-weight:600;color:#0f172a;outline:none}
.log-panel[open]{box-shadow:0 2px 8px rgba(0,0,0,0.08)}
#log{font-family:monospace;background:#f8fafc;border:1px solid #e2e8f0;border-radius:6px;padding:10px;margin-top:10px;max-height:180px;overflow:auto}
.raw-output{position:relative;font-family:monospace;background:#fff;border:1px solid #ddd;border-radius:8px;padding:14px;max-width:1200px;margin:12px auto 0;white-space:pre-wrap;word-break:break-all;max-height:320px;overflow:auto}
.raw-output--secondary{background:#fefefe}
.raw-output.loading{opacity:.65}
.raw-output.collapsed{max-height:120px;overflow:hidden;padding-bottom:24px}
.raw-output.collapsed::after{content:"";position:absolute;left:0;right:0;bottom:0;height:36px;background:linear-gradient(180deg,rgba(255,255,255,0) 0,rgba(255,255,255,0.94) 65%,rgba(255,255,255,1));pointer-events:none;border-radius:0 0 8px 8px}
canvas{margin-top:10px}
.heading-indicator{width:34px;height:34px;border-radius:50%;border:2px solid #0078d7;display:inline-flex;flex-direction:column;align-items:center;justify-content:center;position:relative;margin:0 auto;cursor:default;background:radial-gradient(circle at center,#fff 60%,#e9f2ff 100%);gap:4px}
.heading-indicator__needle{position:absolute;bottom:50%;left:50%;width:2px;height:14px;background:#d1342f;transform-origin:center bottom;border-radius:2px}
.heading-indicator__center{width:6px;height:6px;border-radius:50%;background:#0078d7;position:absolute}
.record-timer{display:none;font-weight:600;color:#475569;text-align:left;margin-right:4px}
.record-timer.active{color:#16a085}
.record-timer--visible{display:inline-flex}
@keyframes statusPulse{
  0%{box-shadow:0 0 0 0 rgba(34,197,94,0.45)}
  70%{box-shadow:0 0 0 8px rgba(34,197,94,0)}
  100%{box-shadow:0 0 0 0 rgba(34,197,94,0)}
}
