/* Java Electrindo v72 — light-only MQTT dashboard */
:root{--bg:#f6f8fc;--card:#fff;--card2:#f8fafc;--ink:#0f172a;--muted:#5f6f85;--line:#d8e0ec;--line2:#cbd5e1;--blue:#2557d6;--red:#b5164c;--green:#16a34a;--shadow:0 22px 60px rgba(15,23,42,.12);--soft:0 10px 30px rgba(15,23,42,.08);color-scheme:light}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;overflow:hidden}button,input,select,textarea{font:inherit}button{cursor:pointer}.hidden{display:none!important}
.auth-screen{min-height:100vh;display:grid;place-items:center;padding:28px;background:radial-gradient(circle at top left,rgba(37,99,235,.12),transparent 34%),radial-gradient(circle at bottom right,rgba(181,22,76,.10),transparent 34%),#081225}.auth-card{width:min(1120px,100%);min-height:620px;display:grid;grid-template-columns:1.1fr .95fr;overflow:hidden;background:#fff;border:1px solid var(--line);border-radius:28px;box-shadow:var(--shadow)}.auth-left{padding:34px 40px;background:linear-gradient(135deg,#eef3ff 0%,#f7e8ee 100%);display:flex;flex-direction:column;gap:20px}.back-btn{width:max-content;border:1px solid var(--line);background:#fff;color:var(--ink);border-radius:13px;min-height:36px;padding:0 14px;font-weight:900;box-shadow:0 8px 22px rgba(15,23,42,.06)}.brand-line,.dash-brand{display:flex;align-items:center;gap:12px;font-size:30px;font-weight:950;letter-spacing:.02em;color:#0b1b3d}.auth-lead{max-width:560px;margin:0;color:#15233f;font-weight:760;font-size:17px;line-height:1.55}.tier-list{display:grid;gap:12px;margin-top:12px}.tier-card{background:rgba(255,255,255,.62);border:1px solid rgba(15,23,42,.13);border-radius:18px;padding:18px}.tier-card h3{margin:0 0 8px;font-size:18px}.tier-card p{margin:0;color:#233045;line-height:1.45}.small-note{margin-top:auto;color:#334155;line-height:1.45;font-size:14px}.auth-right{position:relative;padding:28px;display:flex;flex-direction:column;justify-content:center;gap:18px}.auth-top-actions{position:absolute;right:28px;top:24px}.mini-btn{min-width:46px;min-height:34px;border-radius:12px;border:1px solid var(--line);background:#fff;color:#0f172a;font-weight:900}.auth-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:22px}.tab-btn{min-height:56px;border:none;border-radius:16px;background:#111827;color:#fff;font-weight:950}.tab-btn.active{background:linear-gradient(120deg,#3156db,#c7124f)}.auth-form{display:none;gap:14px}.auth-form.active{display:grid}.auth-form label{display:grid;gap:8px;padding:16px 18px;border:1px solid var(--line);border-radius:17px;background:#fff}.auth-form label span{font-weight:900;font-size:13px}.auth-form input{width:100%;min-height:44px;border:1px solid var(--line2);border-radius:14px;padding:0 14px;background:#fff;color:#0f172a;outline:none}.auth-form input:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(37,99,235,.12)}.primary-btn{min-height:58px;border:none;border-radius:16px;color:#fff;font-weight:950;background:linear-gradient(120deg,#3156db,#c7124f);box-shadow:0 12px 28px rgba(37,99,235,.18)}.guest-form{display:none;padding:22px;border:1px solid var(--line);border-radius:18px;background:var(--card2)}.guest-form.active{display:grid}.guest-form h3{margin:0}.guest-form p{margin:0 0 8px;color:var(--muted);line-height:1.5}.status-message{min-height:22px;margin:0;color:var(--muted);font-size:14px}.status-message.error{color:#b91c1c;font-weight:800}.status-message.ok{color:#15803d;font-weight:800}
.dash-screen{height:100vh;display:grid;grid-template-rows:auto 1fr auto;background:#edf2f8}.dash-header{display:flex;align-items:center;gap:12px;justify-content:space-between;padding:14px 18px;background:rgba(255,255,255,.96);border-bottom:1px solid var(--line);backdrop-filter:blur(12px);z-index:40}.header-left,.header-center,.header-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.dash-brand{font-size:25px}.session-chip{min-height:40px;display:inline-flex;align-items:center;gap:6px;padding:0 14px;border:1px solid var(--line);border-radius:999px;background:#fff;color:#0f172a;font-weight:850}.dot{width:10px;height:10px;border-radius:50%;background:var(--green)}.header-btn,.logout-btn{min-height:40px;border-radius:13px;border:1px solid var(--line);background:#fff;color:#0f172a;padding:0 13px;font-weight:900}.logout-btn{border:none;background:linear-gradient(120deg,#3156db,#c7124f);color:#fff}.dash-menu-wrap{position:relative;display:inline-flex}.dash-menu{position:absolute;right:0;top:calc(100% + 8px);min-width:220px;display:grid;gap:7px;padding:10px;border:1px solid var(--line);border-radius:18px;background:#fff;box-shadow:var(--shadow);z-index:100}.dash-menu[hidden]{display:none}.dash-menu button{min-height:40px;text-align:left;border:1px solid var(--line);border-radius:12px;background:#fff;color:#0f172a;font-weight:900;padding:0 12px}.dash-menu button:hover{border-color:var(--blue);box-shadow:0 0 0 3px rgba(37,99,235,.10)}
.dash-main{position:relative;display:grid;grid-template-columns:1fr 96px;min-height:0;overflow:hidden}.viewport{position:relative;overflow:hidden;background:linear-gradient(rgba(15,23,42,.04) 1px,transparent 1px),linear-gradient(90deg,rgba(15,23,42,.04) 1px,transparent 1px),#f8fafc;background-size:28px 28px;cursor:grab;touch-action:none}.viewport.panning{cursor:grabbing}.canvas{position:absolute;left:50%;top:50%;transform-origin:0 0;background:rgba(255,255,255,.66);border:2px solid #2e67ff;box-shadow:var(--soft)}
.block{position:absolute;min-width:150px;min-height:90px;background:#fff;border:1px solid var(--line2);border-radius:16px;box-shadow:0 10px 24px rgba(15,23,42,.08);padding:14px;user-select:none;touch-action:none;overflow:hidden;display:flex;flex-direction:column}.block.selected{outline:2px solid var(--blue);outline-offset:2px}.block .block-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}.block h4{margin:0;font-size:14px;line-height:1.15}.block .tag{font-size:10px;background:linear-gradient(120deg,#3156db,#c7124f);color:#fff;padding:4px 8px;border-radius:999px;font-weight:900}.block .value{font-size:30px;font-weight:950;color:#11356c;line-height:1.05}.block .topic{font-size:12px;color:var(--muted);font-weight:750;word-break:break-all;margin-top:auto;padding-top:6px}.block[data-type="lamp"]{min-height:92px}.lamp-layout{display:grid;grid-template-columns:46px minmax(0,1fr);gap:12px;align-items:center;flex:1}.lamp-dot{width:38px;height:38px;border-radius:50%;background:#cbd5e1;border:7px solid #e2e8f0}.lamp-dot.on{background:#22c55e;border-color:#bbf7d0}.block[data-type="lamp"] .value{font-size:24px}.block[data-type="display"]{min-height:94px}.block[data-type="display"] .value{font-size:28px}.gauge-ring{height:76px;border-radius:80px 80px 0 0;border:16px solid #dbeafe;border-bottom:0;position:relative}.gauge-needle{position:absolute;left:50%;bottom:0;width:70px;height:5px;background:#e11d48;transform-origin:left center}.trend-box,.table-box,.image-box{height:80px;border:1px solid var(--line);border-radius:12px;background:#f1f5f9;display:grid;place-items:center;color:var(--muted);font-weight:900}.trend-box{min-height:58px;height:auto;flex:1}.block[data-type="text"] .value{font-size:22px;line-height:1.25}.cmd-btn{min-height:40px;border:none;border-radius:12px;background:linear-gradient(120deg,#3156db,#c7124f);color:#fff;font-weight:950;width:100%}.resize-handle{position:absolute;right:6px;bottom:6px;width:18px;height:18px;border-right:3px solid #94a3b8;border-bottom:3px solid #94a3b8;border-radius:3px;cursor:nwse-resize;opacity:.72}.block.selected .resize-handle{border-color:var(--blue);opacity:1}
.right-rail{width:94px;min-width:94px;background:#eaf0f7;border-left:1px solid var(--line);display:flex;flex-direction:column;align-items:stretch;gap:9px;padding:12px 8px;overflow-y:auto}.right-rail button{width:auto;min-height:54px;padding:6px 5px;display:grid;grid-template-rows:auto auto;place-items:center;gap:2px;border-radius:15px;border:1px solid var(--line);background:#fff;color:#0f172a;font-weight:950;box-shadow:0 8px 18px rgba(15,23,42,.04)}.right-rail button:hover,.right-rail button.active{border-color:var(--blue);box-shadow:0 0 0 3px rgba(37,99,235,.12)}.tool-icon{font-size:17px;line-height:1}.tool-label{font-size:10px;font-weight:900;line-height:1.05;color:#334155}
.tool-panel{position:absolute;right:106px;top:16px;width:min(520px,calc(100vw - 136px));max-height:calc(100% - 32px);overflow:auto;background:#fff;border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow);z-index:30;padding:20px}.panel-head{display:flex;align-items:start;justify-content:space-between;gap:12px;margin-bottom:14px}.panel-head h2{margin:0;font-size:22px}.panel-head p{margin:6px 0 0;color:var(--muted);font-weight:720}.close-panel{border:1px solid var(--line);background:#fff;border-radius:12px;width:40px;height:40px;font-weight:950}.grid-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.card-btn{min-height:78px;text-align:left;border:1px solid var(--line);background:#fff;color:#0f172a;border-radius:15px;padding:13px;font-weight:900}.card-btn small{display:block;color:var(--muted);margin-top:5px;font-weight:760}.form-grid,.block-settings-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.form-grid label,.full-label,.block-settings-row label,.block-settings-full label{display:grid;gap:7px;font-weight:900;color:#0f172a}.form-grid input,.form-grid select,.full-label textarea,.full-label input,.full-label select,.block-settings-row input,.block-settings-row select,.block-settings-full input,.block-settings-full textarea{min-height:42px;border:1px solid var(--line2);border-radius:13px;padding:0 12px;background:#fff;color:#0f172a;outline:none}.full-label textarea,.block-settings-full textarea{min-height:120px;padding:12px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.panel-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}.panel-actions button{min-height:40px;border-radius:12px;border:1px solid var(--line);background:#fff;font-weight:900;padding:0 13px}.panel-actions .primary{border:none;background:linear-gradient(120deg,#3156db,#c7124f);color:#fff}.danger-btn{background:#fff1f2!important;border-color:#fecdd3!important;color:#be123c!important}.log-box{height:150px;overflow:auto;background:#0f172a;color:#dbeafe;border-radius:14px;padding:12px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.5}.small-panel-note{margin:8px 0 0;color:var(--muted);font-size:12px;line-height:1.45}
.dash-status{min-height:38px;display:flex;align-items:center;flex-wrap:wrap;gap:14px;padding:7px 14px;background:#fff;border-top:1px solid var(--line);color:#0f172a;font-size:13px}.dash-status span{white-space:nowrap}.preview-mode .right-rail,.preview-mode .tool-panel{display:none}.preview-mode .dash-main{grid-template-columns:1fr}.preview-mode .block{box-shadow:0 12px 30px rgba(15,23,42,.10)}
@media(max-width:1100px){.primary-actions{display:none}.header-actions .header-btn:not(#moreBtn):not(.primary-actions){display:none}}@media(max-width:980px){.auth-card{grid-template-columns:1fr;min-height:auto}.dash-header{align-items:flex-start}.header-actions{width:auto}.dash-main{grid-template-columns:1fr 72px}.right-rail{width:70px;min-width:70px}.right-rail button{min-height:50px}.tool-label{font-size:9px}.tool-panel{right:78px;width:calc(100vw - 90px)}}@media(max-width:620px){.auth-screen{padding:12px}.auth-left,.auth-right{padding:20px}.brand-line{font-size:23px}.auth-tabs{gap:6px}.tab-btn{min-height:46px}.session-chip{min-height:34px;font-size:12px}.dash-brand{font-size:18px}.dash-status{font-size:11px;gap:8px}.right-rail{width:62px;min-width:62px;padding:8px 5px}.right-rail button{min-height:48px;padding:5px 3px}.tool-label{font-size:8.5px}.tool-panel{right:68px;width:calc(100vw - 76px)}.grid-cards,.form-grid,.block-settings-row{grid-template-columns:1fr}.dash-menu{right:0;min-width:min(230px,80vw)}}

/* v72 — resize stability, mobile menu simplification, extra block displays */
.resize-handle{
  right:0;
  bottom:0;
  width:32px;
  height:32px;
  border-right:4px solid #64748b;
  border-bottom:4px solid #64748b;
  border-radius:0 0 13px 0;
  background:linear-gradient(135deg, transparent 45%, rgba(37,99,235,.10) 46%);
  z-index:8;
}
.resize-handle::before{
  content:"";
  position:absolute;
  inset:-10px;
}
.block.is-resizing,
.block.is-dragging{
  z-index:20;
  box-shadow:0 18px 42px rgba(15,23,42,.18);
}
.block[data-type="meter"] .meter-track,
.block[data-type="progress"] .meter-track{
  width:100%;
  height:18px;
  border-radius:999px;
  background:#e2e8f0;
  overflow:hidden;
  border:1px solid #cbd5e1;
}
.meter-fill{
  height:100%;
  width:0%;
  border-radius:999px;
  background:linear-gradient(120deg,#3156db,#16a34a);
}
.block[data-type="alarm"]{
  border-color:#fecdd3;
}
.alarm-box{
  display:flex;
  align-items:center;
  gap:12px;
  flex:1;
}
.alarm-badge{
  width:42px;
  height:42px;
  border-radius:13px;
  display:grid;
  place-items:center;
  background:#fee2e2;
  color:#be123c;
  font-weight:950;
}
.alarm-badge.ok{
  background:#dcfce7;
  color:#15803d;
}
.block[data-type="kpi"] .value{
  font-size:34px;
}
.kpi-desc{
  color:#64748b;
  font-weight:800;
  font-size:12px;
  margin-top:4px;
}
.toggle-state{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-weight:950;
}
.toggle-pill{
  width:52px;
  height:28px;
  border-radius:999px;
  background:#cbd5e1;
  position:relative;
}
.toggle-pill::after{
  content:"";
  position:absolute;
  width:22px;
  height:22px;
  top:3px;
  left:3px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 3px 10px rgba(15,23,42,.18);
}
.toggle-pill.on{
  background:#22c55e;
}
.toggle-pill.on::after{
  left:27px;
}
.setpoint-row{
  display:grid;
  grid-template-columns:1fr auto;
  gap:8px;
  align-items:center;
}
.setpoint-row input{
  min-height:38px;
  border:1px solid var(--line2);
  border-radius:12px;
  padding:0 10px;
  width:100%;
}
.indicator-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:7px;
  margin-top:6px;
}
.indicator-dot{
  height:34px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background:#e2e8f0;
  color:#334155;
  font-size:11px;
  font-weight:950;
}
.indicator-dot.on{
  background:#dcfce7;
  color:#15803d;
}
.indicator-dot.alarm{
  background:#fee2e2;
  color:#be123c;
}
.tool-panel{
  overscroll-behavior:contain;
}
@media(max-width:980px){
  .dash-header{
    display:grid;
    grid-template-columns:1fr auto;
    align-items:center;
  }
  .header-left{
    grid-column:1/2;
  }
  .header-center{
    grid-column:1/3;
    order:3;
    width:100%;
    overflow-x:auto;
    flex-wrap:nowrap;
    padding-top:4px;
  }
  .header-actions{
    grid-column:2/3;
    justify-content:end;
  }
  .primary-actions{
    display:none!important;
  }
  #moreBtn{
    display:inline-flex!important;
    align-items:center;
    justify-content:center;
    min-width:78px;
  }
}
@media(max-width:620px){
  .dash-header{
    padding:10px 10px;
    gap:8px;
  }
  .back-btn{
    min-height:32px;
    padding:0 10px;
    font-size:12px;
  }
  .dash-brand{
    font-size:17px;
    gap:7px;
  }
  #moreBtn{
    min-height:34px;
    min-width:74px;
    padding:0 10px;
  }
  .dash-menu{
    right:0;
    top:calc(100% + 7px);
  }
}


/* v72 — operational preview mode, limits/data mapping, live stream polish */
.preview-mode .block{
  cursor:default;
  outline:none!important;
  user-select:none;
}
.preview-mode .block.selected{
  outline:none!important;
}
.preview-mode .resize-handle{
  display:none!important;
}
.preview-mode .block .tag{
  opacity:0;
  pointer-events:none;
}
.preview-mode .block:hover{
  box-shadow:0 12px 30px rgba(15,23,42,.10);
}
.preview-mode .viewport{
  cursor:default;
}
.preview-mode .cmd-btn,
.preview-mode [data-setpoint-send]{
  pointer-events:auto;
}
.preview-mode .setpoint-row input{
  pointer-events:auto;
}
.limit-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-top:10px;
}
.limit-grid label{
  display:grid;
  gap:7px;
  font-weight:900;
}
.limit-grid input{
  min-height:40px;
  border:1px solid var(--line2);
  border-radius:12px;
  padding:0 11px;
  background:#fff;
  color:#0f172a;
}
.stream-on{
  color:#15803d!important;
  font-weight:950;
}
.stream-off{
  color:#b91c1c!important;
  font-weight:950;
}
.mode-preview{
  color:#2557d6!important;
  font-weight:950;
}
.mode-edit{
  color:#0f172a!important;
  font-weight:950;
}
@media(max-width:620px){
  .limit-grid{grid-template-columns:1fr}
}


/* v72 — public polish, layout management, block style, operator controls */
.dash-brand-title{
  max-width:240px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.canvas.grid-off{
  background-image:none!important;
}
.viewport.grid-off{
  background-image:none!important;
}
.block[data-visible="false"]{
  display:none!important;
}
.block[data-locked="true"] .resize-handle{
  display:none!important;
}
.block[data-locked="true"]{
  cursor:not-allowed;
}
.block[data-style="blue"]{border-color:#93c5fd;background:#eff6ff}
.block[data-style="green"]{border-color:#86efac;background:#f0fdf4}
.block[data-style="red"]{border-color:#fecdd3;background:#fff1f2}
.block[data-style="yellow"]{border-color:#fde68a;background:#fffbeb}
.block[data-style="gray"]{border-color:#cbd5e1;background:#f8fafc}
.layout-tools{
  display:grid;
  gap:10px;
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid var(--line);
}
.layout-tools h3{
  margin:0;
  font-size:15px;
}
.inline-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.inline-actions button,
.small-action{
  min-height:38px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  color:#0f172a;
  font-weight:900;
  padding:0 11px;
}
.mqtt-stats{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin-top:12px;
}
.mqtt-stat{
  border:1px solid var(--line);
  border-radius:14px;
  background:#f8fafc;
  padding:10px;
}
.mqtt-stat b{
  display:block;
  font-size:11px;
  color:#64748b;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.mqtt-stat span{
  display:block;
  margin-top:3px;
  font-weight:950;
  color:#0f172a;
  word-break:break-word;
}
.block[data-type="clock"] .value,
.block[data-type="mqttstatus"] .value{
  font-size:26px;
}
.mqtt-status-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  background:#fee2e2;
  color:#be123c;
  font-weight:950;
}
.mqtt-status-pill.ok{
  background:#dcfce7;
  color:#15803d;
}
.style-select-row{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin-top:10px;
}
.style-select-row label{
  display:grid;
  gap:7px;
  font-weight:900;
}
.style-select-row select,
.style-select-row input{
  min-height:40px;
  border:1px solid var(--line2);
  border-radius:12px;
  padding:0 11px;
  background:#fff;
  color:#0f172a;
}
@media(max-width:620px){
  .mqtt-stats,
  .style-select-row{
    grid-template-columns:1fr;
  }
}


/* v72 — operator pages, media/manual blocks, specific settings polish */
.dash-header{
  display:grid;
  grid-template-columns:minmax(280px,1fr) auto minmax(360px,auto);
  align-items:center;
}
.header-left{min-width:0}
.header-center{justify-content:center}
.header-actions{justify-content:flex-end}
.dash-brand{
  min-width:0;
}
.dash-brand strong{
  max-width:360px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.page-strip{
  display:flex;
  gap:8px;
  align-items:center;
  overflow-x:auto;
  padding:8px 10px;
  border-bottom:1px solid var(--line);
  background:#fff;
}
.page-chip{
  min-height:34px;
  border:1px solid var(--line);
  background:#fff;
  color:#0f172a;
  border-radius:999px;
  padding:0 12px;
  font-weight:900;
  white-space:nowrap;
}
.page-chip.active{
  background:linear-gradient(120deg,#3156db,#c7124f);
  color:#fff;
  border-color:transparent;
}
.manual-card{
  display:grid;
  gap:10px;
  align-content:center;
  justify-items:start;
  min-height:70px;
}
.manual-card .manual-title{
  font-size:20px;
  font-weight:950;
  color:#11356c;
}
.manual-card .manual-meta{
  font-size:12px;
  color:#64748b;
  font-weight:850;
}
.manual-card button{
  min-height:34px;
  border:none;
  border-radius:12px;
  background:linear-gradient(120deg,#3156db,#c7124f);
  color:#fff;
  padding:0 12px;
  font-weight:950;
}
.image-box img{
  width:100%;
  height:100%;
  object-fit:var(--fit,contain);
  opacity:var(--opacity,1);
  border-radius:10px;
}
.page-button-block{
  display:grid;
  place-items:center;
  height:100%;
}
.page-button-block button{
  min-height:42px;
  width:100%;
  border:none;
  border-radius:14px;
  background:linear-gradient(120deg,#3156db,#c7124f);
  color:#fff;
  font-weight:950;
}
.settings-section{
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid var(--line);
}
.settings-section h3{
  margin:0 0 10px;
  font-size:14px;
}
.simple-advanced-note{
  margin:8px 0 0;
  color:#64748b;
  font-size:12px;
  line-height:1.45;
}
.media-warning{
  margin:8px 0 0;
  color:#b45309;
  font-weight:850;
  font-size:12px;
}
@media(max-width:1100px){
  .dash-header{
    grid-template-columns:1fr auto;
  }
  .header-center{
    grid-column:1/3;
    justify-content:flex-start;
    overflow-x:auto;
  }
}
@media(max-width:620px){
  .dash-brand strong{
    max-width:160px;
  }
  .dash-status{
    overflow-x:auto;
    flex-wrap:nowrap;
  }
}


/* v72 — cleaner header, shortcut UX, primary/advanced tool balance, alarm history */
.dash-brand{
  gap:0!important;
  font-weight:950;
}
.dash-brand strong{
  max-width:220px;
  font-size:24px;
}
.right-rail [data-advanced-tool="1"]{
  display:none;
}
.shortcut-help{
  margin-top:12px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#f8fafc;
  color:#475569;
  font-size:12px;
  line-height:1.55;
}
.event-list{
  display:grid;
  gap:6px;
  width:100%;
  align-content:start;
}
.event-row{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:8px;
  align-items:center;
  font-size:12px;
  color:#334155;
  padding:6px 7px;
  border-radius:10px;
  background:#f8fafc;
  border:1px solid #e2e8f0;
}
.event-row.alarm{
  background:#fff1f2;
  border-color:#fecdd3;
  color:#9f1239;
}
.event-time{
  font-weight:950;
  color:#64748b;
}
.confirm-overlay{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.32);
  z-index:999;
  display:grid;
  place-items:center;
  padding:20px;
}
.confirm-box{
  width:min(420px,100%);
  background:#fff;
  border:1px solid var(--line);
  border-radius:22px;
  box-shadow:var(--shadow);
  padding:22px;
}
.confirm-box h3{
  margin:0 0 8px;
  font-size:20px;
}
.confirm-box p{
  margin:0 0 16px;
  color:#64748b;
  line-height:1.5;
}
.confirm-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
}
.confirm-actions button{
  min-height:40px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  font-weight:900;
  padding:0 14px;
}
.confirm-actions .danger{
  border:none;
  background:#be123c;
  color:#fff;
}
.block[data-type="eventlog"] .event-list,
.block[data-type="alarmlist"] .event-list{
  max-height:100%;
  overflow:hidden;
}
@media(max-width:620px){
  .dash-brand strong{font-size:18px;max-width:140px}
}


/* v72 — responsive compatibility and public deployment polish */
:root{
  --tap:44px;
}
body{
  -webkit-text-size-adjust:100%;
}
.dash-header{
  min-width:0;
}
.header-left,
.header-center,
.header-actions{
  min-width:0;
}
.header-btn,
.logout-btn,
.back-btn,
.dash-menu button,
.right-rail button,
.panel-actions button,
.inline-actions button,
.small-action{
  min-height:var(--tap);
}
.dash-menu{
  max-height:min(76vh,560px);
  overflow:auto;
}
.tool-panel{
  scrollbar-width:thin;
}
.viewport{
  min-width:0;
  min-height:0;
}
.canvas{
  will-change:transform;
}
.block{
  max-width:min(1400px, calc(100vw - 28px));
}
.block .block-head{
  min-height:22px;
}
.dash-status{
  overflow:hidden;
}
.dash-status span{
  min-width:0;
}
.right-rail{
  scrollbar-width:thin;
}
.mobile-tool-toggle{
  display:none;
}
body.mobile-tools-open .right-rail{
  transform:translateX(0);
}
body.mobile-tools-open::after{
  content:"";
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.22);
  z-index:24;
  pointer-events:none;
}
@media(max-width:1280px){
  .dash-header{
    grid-template-columns:minmax(190px,1fr) auto minmax(260px,auto);
    gap:8px;
    padding:10px 12px;
  }
  .header-btn,
  .logout-btn{
    padding:0 10px;
  }
  .dash-brand strong{
    font-size:21px;
  }
}
@media(max-width:1120px){
  .dash-header{
    grid-template-columns:minmax(170px,1fr) auto;
  }
  .header-center{
    grid-column:1/3;
    order:3;
    justify-content:flex-start;
    overflow-x:auto;
    flex-wrap:nowrap;
    padding-top:2px;
  }
  .header-actions{
    justify-content:flex-end;
  }
  .primary-actions{
    display:none!important;
  }
  #moreBtn{
    display:inline-flex!important;
    align-items:center;
    justify-content:center;
  }
  .session-chip{
    flex:0 0 auto;
  }
}
@media(max-width:900px){
  :root{--tap:48px}
  .dash-main{
    grid-template-columns:1fr 68px;
  }
  .right-rail{
    width:68px;
    min-width:68px;
    padding:8px 5px;
    gap:7px;
  }
  .right-rail button{
    min-height:50px;
    border-radius:14px;
  }
  .tool-label{
    font-size:8.5px;
  }
  .tool-panel{
    right:74px;
    top:10px;
    width:calc(100vw - 88px);
    max-height:calc(100% - 20px);
    border-radius:18px;
  }
  .form-grid,
  .block-settings-row,
  .limit-grid,
  .style-select-row{
    gap:10px;
  }
}
@media(max-width:720px){
  html,body{
    overflow:hidden;
  }
  .dash-screen{
    grid-template-rows:auto 1fr auto;
  }
  .dash-header{
    grid-template-columns:auto 1fr auto;
    padding:8px 8px;
    gap:6px;
  }
  .header-left{
    display:contents;
  }
  .back-btn{
    grid-column:1;
    min-width:58px;
    padding:0 8px;
  }
  .dash-brand{
    grid-column:2;
    justify-content:center;
  }
  .dash-brand strong{
    font-size:18px;
    max-width:150px;
  }
  .header-actions{
    grid-column:3;
  }
  .header-center{
    grid-column:1/4;
    order:4;
    display:flex;
    justify-content:flex-start;
    gap:6px;
    padding-top:3px;
  }
  .session-chip{
    min-height:30px;
    padding:0 9px;
    font-size:11px;
  }
  #moreBtn{
    min-width:82px;
    min-height:38px;
    border-radius:12px;
  }
  .dash-menu{
    position:fixed;
    right:8px;
    top:74px;
    width:min(300px, calc(100vw - 16px));
    max-height:calc(100vh - 92px);
  }
  .dash-main{
    display:block;
  }
  .viewport{
    position:absolute;
    inset:0;
  }
  .right-rail{
    position:absolute;
    top:8px;
    right:8px;
    bottom:8px;
    z-index:26;
    width:74px;
    min-width:74px;
    border:1px solid var(--line);
    border-radius:18px;
    box-shadow:var(--shadow);
    transform:translateX(calc(100% + 18px));
    transition:transform .18s ease;
  }
  .tool-panel{
    position:absolute;
    inset:auto 8px 8px 8px;
    right:8px;
    top:auto;
    width:auto;
    max-height:72vh;
    border-radius:22px 22px 16px 16px;
    padding:16px;
    z-index:35;
  }
  .panel-head{
    position:sticky;
    top:-16px;
    background:#fff;
    z-index:2;
    padding-top:4px;
    padding-bottom:8px;
  }
  .grid-cards{
    grid-template-columns:1fr 1fr;
  }
  .form-grid,
  .block-settings-row,
  .limit-grid,
  .style-select-row{
    grid-template-columns:1fr;
  }
  .dash-status{
    min-height:34px;
    padding:6px 8px;
    gap:8px;
    flex-wrap:nowrap;
    overflow-x:auto;
    font-size:11px;
  }
  .dash-status span:nth-child(n+5){
    display:none;
  }
  .resize-handle{
    width:38px;
    height:38px;
  }
}
@media(max-width:480px){
  .auth-card{
    border-radius:20px;
  }
  .auth-left,
  .auth-right{
    padding:16px;
  }
  .brand-line{
    font-size:20px;
  }
  .auth-lead{
    font-size:14px;
  }
  .tier-card{
    padding:12px;
  }
  .auth-tabs{
    grid-template-columns:1fr;
  }
  .tab-btn{
    min-height:44px;
  }
  .dash-brand strong{
    font-size:16px;
    max-width:122px;
  }
  .back-btn{
    min-width:50px;
    font-size:11px;
  }
  #moreBtn{
    min-width:72px;
    font-size:12px;
  }
  .session-chip{
    font-size:10px;
  }
  .grid-cards{
    grid-template-columns:1fr;
  }
  .right-rail{
    width:70px;
    min-width:70px;
  }
  .right-rail button{
    min-height:48px;
  }
  .tool-panel{
    max-height:76vh;
  }
  .panel-head h2{
    font-size:18px;
  }
  .card-btn{
    min-height:64px;
  }
  .block{
    padding:11px;
  }
  .block .value{
    font-size:24px;
  }
}
@media(orientation:landscape) and (max-height:520px){
  .dash-header{
    padding:6px 8px;
  }
  .header-center{
    display:none;
  }
  .dash-status{
    display:none;
  }
  .tool-panel{
    max-height:calc(100vh - 20px);
    top:10px;
    bottom:10px;
  }
  .dash-menu{
    top:54px;
  }
}


/* v72 — mobile auth and small-screen entry fix */
.mobile-access-summary{
  display:none;
}
.auth-screen{
  min-height:100vh;
  min-height:100dvh;
  overflow-y:auto;
  overflow-x:hidden;
}
.auth-card{
  max-height:none;
}
.auth-form input,
.auth-form label,
.primary-btn,
.tab-btn{
  min-width:0;
}
@media(max-width:900px){
  .auth-screen{
    display:block;
    padding:14px;
    min-height:100dvh;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
  }
  .auth-card{
    width:100%;
    max-width:720px;
    margin:0 auto;
    min-height:auto;
    display:block;
    border-radius:22px;
    overflow:visible;
  }
  .auth-left,
  .auth-right{
    padding:22px;
  }
  .auth-left{
    gap:14px;
  }
  .brand-line{
    font-size:25px;
    line-height:1.15;
  }
  .auth-lead{
    font-size:15px;
    line-height:1.45;
  }
  .tier-list{
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
  }
  .tier-card{
    padding:12px;
    border-radius:14px;
  }
  .tier-card h3{
    font-size:15px;
    margin-bottom:4px;
  }
  .tier-card p{
    font-size:12px;
    line-height:1.35;
  }
  .small-note{
    margin-top:0;
    font-size:12px;
  }
  .auth-top-actions{
    top:14px;
    right:18px;
  }
  .auth-tabs{
    margin-top:28px;
  }
  .auth-form label{
    padding:12px 14px;
  }
  .auth-form input{
    min-height:42px;
  }
  .primary-btn{
    min-height:48px;
  }
}
@media(max-width:620px){
  html,body{
    overflow:hidden;
  }
  body:has(.auth-screen:not(.hidden)){
    overflow:auto;
  }
  .auth-screen{
    min-height:100dvh;
    height:auto;
    display:block;
    place-items:unset;
    padding:8px;
    background:#081225;
  }
  .auth-card{
    display:flex;
    flex-direction:column;
    width:100%;
    min-height:auto;
    border-radius:18px;
    overflow:visible;
  }
  .auth-left{
    padding:14px;
    gap:8px;
    background:linear-gradient(135deg,#eef3ff 0%,#f7e8ee 100%);
  }
  .auth-right{
    padding:14px;
    gap:10px;
  }
  .brand-line{
    font-size:21px;
    gap:8px;
    line-height:1.15;
  }
  .brand-sep{
    display:none;
  }
  .auth-lead{
    font-size:13px;
    line-height:1.38;
    max-width:none;
  }
  .auth-left .back-btn{
    min-height:34px;
    font-size:12px;
    padding:0 10px;
  }
  .mobile-access-summary{
    display:block;
    border:1px solid rgba(15,23,42,.13);
    border-radius:14px;
    background:rgba(255,255,255,.70);
    padding:9px 10px;
  }
  .mobile-access-summary summary{
    cursor:pointer;
    font-weight:950;
    color:#0f172a;
    list-style:none;
  }
  .mobile-access-summary summary::-webkit-details-marker{
    display:none;
  }
  .mobile-access-summary summary::after{
    content:" ▼";
    font-size:10px;
    color:#64748b;
  }
  .mobile-access-summary[open] summary::after{
    content:" ▲";
  }
  .mobile-tier-mini{
    display:grid;
    gap:4px;
    margin-top:8px;
    font-size:12px;
    color:#334155;
    font-weight:800;
  }
  .tier-list{
    display:none;
  }
  .small-note{
    display:none;
  }
  .auth-top-actions{
    top:10px;
    right:12px;
  }
  .mini-btn{
    min-width:42px;
    min-height:32px;
    border-radius:10px;
    font-size:12px;
  }
  .auth-tabs{
    margin-top:4px;
    grid-template-columns:repeat(3,1fr);
    gap:6px;
  }
  .tab-btn{
    min-height:42px;
    border-radius:13px;
    font-size:13px;
  }
  .auth-form{
    gap:9px;
  }
  .auth-form label{
    padding:9px 10px;
    gap:5px;
    border-radius:13px;
  }
  .auth-form label span{
    font-size:12px;
  }
  .auth-form input{
    min-height:38px;
    border-radius:11px;
    padding:0 10px;
    font-size:14px;
  }
  .primary-btn{
    min-height:44px;
    border-radius:13px;
    font-size:14px;
  }
  .guest-form{
    padding:13px;
    border-radius:14px;
  }
  .guest-form h3{
    font-size:16px;
  }
  .guest-form p{
    font-size:12px;
    line-height:1.38;
  }
  .status-message{
    min-height:18px;
    font-size:12px;
  }
}
@media(max-width:390px){
  .auth-screen{
    padding:6px;
  }
  .auth-left,
  .auth-right{
    padding:12px;
  }
  .brand-line{
    font-size:19px;
  }
  .auth-lead{
    font-size:12.5px;
  }
  .auth-tabs{
    gap:5px;
  }
  .tab-btn{
    min-height:40px;
    font-size:12px;
  }
  .auth-form input{
    min-height:36px;
  }
  .primary-btn{
    min-height:42px;
  }
}
@media(max-height:620px) and (max-width:620px){
  .auth-left{
    padding-bottom:10px;
  }
  .auth-lead{
    display:none;
  }
  .mobile-access-summary{
    padding:7px 9px;
  }
  .auth-right{
    padding-top:10px;
  }
}


/* v72 — mobile recovery, helper controls, menu/panel escape, performance polish */
.menu-close-btn{
  background:#0f172a!important;
  color:#fff!important;
  border-color:#0f172a!important;
  text-align:center!important;
}
.quick-help-cluster{
  position:absolute;
  left:14px;
  bottom:48px;
  z-index:28;
  display:flex;
  gap:7px;
  padding:7px;
  border:1px solid var(--line);
  border-radius:999px;
  background:rgba(255,255,255,.92);
  box-shadow:0 12px 30px rgba(15,23,42,.14);
  backdrop-filter:blur(8px);
}
.quick-help-cluster button{
  width:38px;
  height:38px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  color:#0f172a;
  font-weight:950;
  font-size:16px;
}
.quick-help-cluster button:hover{
  border-color:var(--blue);
  box-shadow:0 0 0 3px rgba(37,99,235,.10);
}
.quick-help-cluster button:disabled{
  opacity:.42;
  cursor:not-allowed;
}
.help-panel-content{
  display:grid;
  gap:12px;
}
.help-panel-content h3{
  margin:0;
  font-size:15px;
}
.help-panel-content ul{
  margin:0;
  padding-left:18px;
  color:#475569;
  line-height:1.55;
}
.help-panel-content .help-card{
  border:1px solid var(--line);
  border-radius:15px;
  background:#f8fafc;
  padding:12px;
}
body.mobile-tools-open .quick-help-cluster{
  z-index:20;
}
@media(max-width:720px){
  .dash-menu{
    display:grid;
    gap:7px;
    padding:10px;
    top:58px;
    bottom:46px;
    max-height:none;
    overflow-y:auto;
    overscroll-behavior:contain;
  }
  .dash-menu[hidden]{
    display:none;
  }
  .dash-menu button{
    min-height:42px;
  }
  .tool-panel{
    max-height:min(72vh, calc(100dvh - 92px));
    overflow-y:auto;
    overscroll-behavior:contain;
  }
  .close-panel{
    min-width:44px;
    min-height:44px;
  }
  .quick-help-cluster{
    left:50%;
    transform:translateX(-50%);
    bottom:42px;
    padding:5px;
    gap:5px;
  }
  .quick-help-cluster button{
    width:34px;
    height:34px;
    font-size:14px;
  }
  .dash-status{
    position:relative;
    z-index:27;
    display:flex!important;
    min-height:36px;
    background:#fff;
    border-top:1px solid var(--line);
  }
  .dash-status span{
    flex:0 0 auto;
  }
  .dash-status span:nth-child(1),
  .dash-status span:nth-child(4),
  .dash-status span:nth-child(9){
    display:inline-flex!important;
  }
}
@media(max-width:480px){
  .quick-help-cluster{
    bottom:40px;
  }
  .quick-help-cluster button{
    width:32px;
    height:32px;
  }
  .dash-menu{
    top:52px;
    bottom:42px;
  }
}
@media(max-width:720px){
  .dash-header,
  .tool-panel,
  .right-rail,
  .dash-menu,
  .block{
    box-shadow:0 8px 20px rgba(15,23,42,.10)!important;
    backdrop-filter:none!important;
  }
  .block{
    transition:none!important;
  }
}


/* v72 — canvas boundaries, consistent templates, public auth cleanup, block-specific settings */
@media(max-width:900px){.tier-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
.visual-block-note{margin:8px 0 0;padding:10px;border:1px solid var(--line);border-radius:13px;background:#f8fafc;color:#475569;font-size:12px;line-height:1.45}
.boundary-note{margin:8px 0 0;color:#64748b;font-size:12px;font-weight:750}
.block-settings-row.compact-settings{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:620px){.block-settings-row.compact-settings{grid-template-columns:1fr}}


/* v72 — production block polish, gauge/table cleanup */
.shortcut-help{
  display:none!important;
}
.block{
  overflow:hidden;
  box-sizing:border-box;
}
.block.selected{
  outline:2px solid rgba(37,99,235,.88);
  outline-offset:2px;
  box-shadow:0 10px 26px rgba(15,23,42,.12);
}
.block .topic{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.block .value{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
}
.block .tag{
  max-width:74px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.block[data-type="gauge"]{
  display:flex;
  flex-direction:column;
}
.block[data-type="gauge"] .gauge-wrap{
  width:100%;
  min-height:64px;
  display:grid;
  place-items:center;
  margin-top:2px;
  flex:1;
}
.block[data-type="gauge"] svg{
  display:block;
  width:100%;
  max-height:105px;
  overflow:visible;
}
.gauge-overlimit{
  color:#be123c!important;
}
.table-block{
  width:100%;
  display:grid;
  gap:5px;
  overflow:hidden;
}
.table-row{
  display:grid;
  grid-template-columns:minmax(68px,.45fr) minmax(0,1fr);
  gap:8px;
  align-items:center;
  min-height:24px;
  padding:4px 6px;
  border:1px solid #e2e8f0;
  border-radius:9px;
  background:#f8fafc;
  overflow:hidden;
}
.table-row b,
.table-row span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.table-row b{
  color:#334155;
  font-size:11px;
}
.table-row span{
  color:#0f172a;
  font-weight:850;
  font-size:12px;
}
.block[data-compact-table="true"] .table-row{
  min-height:20px;
  padding:2px 5px;
}
.preview-mode .block.selected{
  outline:none!important;
  box-shadow:0 8px 18px rgba(15,23,42,.08);
}
@media(max-width:720px){
  .block.selected{
    outline-width:2px;
    outline-offset:1px;
  }
  .table-row{
    grid-template-columns:minmax(54px,.42fr) minmax(0,1fr);
    gap:5px;
  }
  .table-row b,
  .table-row span{
    font-size:10.5px;
  }
}


/* v72 — template layout rebuild and block size normalization */
.block{
  min-width:120px;
  min-height:72px;
}
.block .block-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  min-height:22px;
}
.block .block-head b{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.block .value{
  line-height:1.05;
  margin-top:4px;
}
.block[data-type="display"] .value,
.block[data-type="kpi"] .value{
  font-size:clamp(22px, 2.2vw, 34px);
}
.block[data-type="lamp"] .value,
.block[data-type="alarm"] .value{
  font-size:clamp(20px, 2vw, 30px);
}
.block[data-type="trend"]{
  display:flex;
  flex-direction:column;
}
.block[data-type="trend"] .trend-chart{
  min-height:74px;
  flex:1 1 auto;
  border:1px solid #dbe3ee;
  border-radius:12px;
  background:#f3f7fc;
  overflow:hidden;
  margin-top:6px;
}
.block[data-type="trend"] .value{
  margin-top:8px;
}
.block[data-type="gauge"] .gauge-wrap{
  min-height:92px;
}
.block[data-type="table"],
.block[data-type="eventlog"],
.block[data-type="alarmlist"]{
  display:flex;
  flex-direction:column;
}
.block[data-type="table"] .table-block,
.block[data-type="eventlog"] .event-list,
.block[data-type="alarmlist"] .event-list{
  flex:1 1 auto;
  min-height:0;
}
.block[data-type="section"] .value{
  font-size:clamp(24px, 2.4vw, 36px);
  line-height:1.05;
}
.block[data-type="text"] .value{
  font-size:clamp(20px, 2vw, 30px);
}
.resize-handle{
  opacity:.82;
}
.canvas{
  overflow:hidden;
}
@media(max-width:720px){
  .block[data-type="display"] .value,
  .block[data-type="kpi"] .value,
  .block[data-type="lamp"] .value,
  .block[data-type="alarm"] .value{
    font-size:22px;
  }
  .block[data-type="gauge"] .gauge-wrap{
    min-height:76px;
  }
  .block[data-type="trend"] .trend-chart{
    min-height:64px;
  }
}


/* v72 — larger canvas, template fit, block content visibility */
.canvas{
  min-width:1280px;
  min-height:800px;
}
.block{
  padding:16px;
}
.block .block-head{
  min-height:26px;
  margin-bottom:6px;
}
.block .block-head b{
  font-size:14px;
  line-height:1.2;
}
.block .tag{
  flex:0 0 auto;
  max-width:82px;
  padding:5px 10px;
  line-height:1;
}
.block .value{
  line-height:1.12;
  margin-top:6px;
  margin-bottom:4px;
}
.block .topic{
  margin-top:6px;
  line-height:1.2;
}
.block[data-type="display"],
.block[data-type="lamp"],
.block[data-type="alarm"],
.block[data-type="meter"],
.block[data-type="progress"],
.block[data-type="kpi"]{
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
.block[data-type="display"] .value,
.block[data-type="kpi"] .value{
  font-size:clamp(24px, 2.2vw, 36px);
}
.block[data-type="lamp"] .value,
.block[data-type="alarm"] .value{
  font-size:clamp(24px, 2vw, 34px);
}
.block[data-type="gauge"]{
  padding:16px 18px;
}
.block[data-type="gauge"] .gauge-wrap{
  min-height:112px;
  margin-top:2px;
}
.block[data-type="gauge"] svg{
  max-height:128px;
}
.block[data-type="gauge"] .value{
  text-align:center;
  font-size:clamp(24px, 2.2vw, 34px);
  margin-top:2px;
}
.block[data-type="gauge"] .topic{
  text-align:left;
}
.block[data-type="trend"]{
  padding:16px;
}
.block[data-type="trend"] .trend-chart{
  min-height:104px;
}
.block[data-type="trend"] .value{
  font-size:clamp(22px, 2vw, 32px);
}
.block[data-type="table"],
.block[data-type="eventlog"],
.block[data-type="alarmlist"]{
  padding:16px;
}
.table-row{
  min-height:28px;
  padding:6px 8px;
}
.event-row{
  min-height:28px;
}
.block[data-type="section"]{
  justify-content:center;
}
.block[data-type="section"] .value{
  font-size:clamp(26px, 2.2vw, 38px);
  line-height:1.1;
}
.block[data-type="text"] .value{
  font-size:clamp(22px, 1.9vw, 32px);
  line-height:1.15;
}
.resize-handle{
  width:30px;
  height:30px;
  opacity:.75;
}
@media(max-width:720px){
  .canvas{
    min-width:1280px;
    min-height:800px;
  }
  .block{
    padding:13px;
  }
  .block .block-head{
    min-height:24px;
  }
  .block[data-type="gauge"] .gauge-wrap{
    min-height:92px;
  }
  .block[data-type="trend"] .trend-chart{
    min-height:84px;
  }
}


/* v72 — larger canvas and guided tutorial */
.canvas{
  min-width:1440px;
  min-height:900px;
}
.block[data-type="gauge"]{
  padding:18px 20px;
}
.block[data-type="gauge"] .gauge-wrap{
  min-height:136px;
  margin-top:4px;
}
.block[data-type="gauge"] svg{
  max-height:148px;
}
.block[data-type="gauge"] .value{
  margin-top:4px;
  margin-bottom:6px;
}
.tutorial-entry-btn{
  width:100%;
  min-height:42px;
  border:1px solid rgba(37,99,235,.22);
  border-radius:14px;
  background:#eef4ff;
  color:#11356c;
  font-weight:950;
  margin:0 0 10px;
}
.tutorial-overlay{
  position:fixed;
  inset:0;
  z-index:5000;
  background:rgba(15,23,42,.56);
  pointer-events:auto;
}
.tutorial-overlay.hidden{
  display:none;
}
.tutorial-spotlight{
  position:absolute;
  border:3px solid #fff;
  border-radius:16px;
  box-shadow:0 0 0 9999px rgba(15,23,42,.54), 0 12px 40px rgba(0,0,0,.22);
  transition:all .18s ease;
  pointer-events:none;
}
.tutorial-card{
  position:absolute;
  width:min(360px, calc(100vw - 24px));
  border:1px solid var(--line);
  border-radius:22px;
  background:#fff;
  box-shadow:0 20px 60px rgba(0,0,0,.24);
  padding:18px;
  color:#0f172a;
}
.tutorial-kicker{
  color:#2557d6;
  font-size:12px;
  font-weight:950;
  text-transform:uppercase;
  letter-spacing:.05em;
  margin-bottom:6px;
}
.tutorial-card h3{
  margin:0 0 8px;
  font-size:21px;
}
.tutorial-card p{
  margin:0;
  color:#475569;
  line-height:1.5;
  font-weight:750;
}
.tutorial-actions{
  display:flex;
  gap:8px;
  justify-content:flex-end;
  margin-top:16px;
}
.tutorial-actions button{
  min-height:40px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  color:#0f172a;
  font-weight:950;
  padding:0 13px;
}
.tutorial-actions .primary{
  border:none;
  background:linear-gradient(120deg,#3156db,#c7124f);
  color:#fff;
}
@media(max-width:720px){
  .canvas{
    min-width:1440px;
    min-height:900px;
  }
  .block[data-type="gauge"] .gauge-wrap{
    min-height:112px;
  }
  .tutorial-card{
    left:12px!important;
    right:12px!important;
    bottom:12px!important;
    top:auto!important;
    width:auto;
    padding:15px;
  }
  .tutorial-spotlight{
    border-radius:12px;
  }
  .tutorial-actions button{
    flex:1;
  }
}


/* v72 — tutorial visibility and safe placement fix */
.tutorial-overlay{
  display:block;
  overflow:hidden;
}
.tutorial-overlay.hidden{
  display:none!important;
}
.tutorial-card{
  position:fixed!important;
  left:24px;
  top:auto;
  right:auto;
  bottom:24px;
  max-height:min(52vh, 420px);
  overflow:auto;
  z-index:5003;
}
.tutorial-close{
  position:absolute;
  top:10px;
  right:10px;
  width:34px;
  height:34px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  color:#0f172a;
  font-weight:950;
  font-size:18px;
}
.tutorial-card h3{
  padding-right:38px;
}
.tutorial-spotlight{
  z-index:5002;
  max-width:calc(100vw - 24px);
  max-height:calc(100vh - 24px);
}
@media(min-width:721px){
  .tutorial-card[data-side="right"]{
    left:auto!important;
    right:24px!important;
    bottom:24px!important;
    top:auto!important;
  }
  .tutorial-card[data-side="left"]{
    left:24px!important;
    right:auto!important;
    bottom:24px!important;
    top:auto!important;
  }
}
@media(max-width:720px){
  .tutorial-card{
    left:10px!important;
    right:10px!important;
    bottom:10px!important;
    top:auto!important;
    width:auto!important;
    max-height:44vh;
    padding:14px;
    border-radius:18px;
  }
  .tutorial-card h3{
    font-size:18px;
  }
  .tutorial-card p{
    font-size:13px;
    line-height:1.42;
  }
  .tutorial-actions{
    margin-top:12px;
    gap:6px;
  }
  .tutorial-actions button{
    min-height:38px;
    padding:0 8px;
    font-size:12px;
  }
  .tutorial-close{
    width:32px;
    height:32px;
  }
  .tutorial-spotlight{
    border-width:2px;
  }
}
@media(max-height:560px){
  .tutorial-card{
    max-height:56vh;
    bottom:8px!important;
  }
  .tutorial-card p{
    line-height:1.35;
  }
}


/* v72 — tutorial targeting and device-flow polish */
.tutorial-card{
  pointer-events:auto;
}
.tutorial-card .tutorial-hint{
  display:block;
  margin-top:8px;
  padding:8px 10px;
  border-radius:12px;
  background:#f8fafc;
  border:1px solid #e2e8f0;
  color:#334155;
  font-size:12px;
  line-height:1.35;
}
.tutorial-spotlight{
  pointer-events:none;
}
.tutorial-overlay[data-soft="true"]{
  background:rgba(15,23,42,.48);
}
.tutorial-overlay[data-soft="true"] .tutorial-spotlight{
  box-shadow:0 0 0 9999px rgba(15,23,42,.45), 0 12px 40px rgba(0,0,0,.22);
}
.tutorial-actions{
  flex-wrap:wrap;
}
.tutorial-actions button{
  white-space:nowrap;
}
@media(max-width:720px){
  .tutorial-card{
    max-height:50vh;
  }
  .tutorial-kicker{
    font-size:11px;
  }
  .tutorial-card h3{
    margin-bottom:6px;
  }
  .tutorial-card .tutorial-hint{
    font-size:11px;
    padding:7px 8px;
  }
}
