/* layout-live-v1: retains existing theme, three-column breakpoints and dialogs. */
.connection.offline { color:#ff9b9e; border:1px solid #a54b55; background:#321b26; }
.connection.offline i { background:#ff6974; box-shadow:none; animation:none; }
.connection-detail { font-size:14px; line-height:1.5; color:#9dc9ae; margin:8px 0 0; text-align:right; max-width:420px; }
.connection-detail.offline { color:#efa6ab; }
.header-status { display:flex; align-items:flex-end; flex-direction:column; min-width:0; }
.layout-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin:18px 0 12px; }
.layout-toolbar p { margin:0; font-size:15px; line-height:1.55; color:#adb9cc; max-width:760px; }
.layout-toolbar .button { min-height:46px; }
.layout-save-status { min-height:22px; font-size:14px; color:#bfd3ed; margin:0 0 12px; }
.sensor-card { position:relative; }
.layout-card-tools { display:flex; align-items:center; gap:8px; border-bottom:1px solid #354256; padding-bottom:12px; margin-bottom:14px; }
.layout-card-tools[hidden] { display:none; }
.layout-grip,.layout-step { min-width:44px; min-height:44px; border:1px solid #526178; border-radius:12px; color:#dce8f8; background:#202c40; font-size:24px; line-height:1; }
.layout-grip { cursor:grab; touch-action:none; -webkit-user-select:none; user-select:none; }
.layout-grip:active { cursor:grabbing; }
.layout-step { font-size:21px; cursor:pointer; }
.layout-step:disabled,.layout-grip:disabled { opacity:.38; cursor:default; }
.layout-rank { flex:1; font:700 14px/1.3 ui-monospace,monospace; color:#adc3de; letter-spacing:.08em; }
.layout-editing .sensor-card { border-style:dashed; }
.layout-drag-source { opacity:.45; }
#sensors > [data-layout-drop] { outline:3px solid #ff8e39; outline-offset:2px; }
#sensors > [data-layout-drop]::after { position:absolute; inset:auto 10px 10px; background:#ff8e39; color:#231204; padding:6px 10px; border-radius:8px; font-size:13px; font-weight:800; z-index:5; pointer-events:none; }
#sensors > [data-layout-drop=before]::after { content:'Bu kartın önüne bırak'; }
#sensors > [data-layout-drop=after]::after { content:'Bu kartın arkasına bırak'; }
.layout-drag-ghost { position:fixed; z-index:9999; width:250px; box-sizing:border-box; pointer-events:none; padding:16px; border:2px solid #ff8e39; border-radius:16px; background:#1c2739; box-shadow:0 15px 44px #0009; color:#fff; }
.layout-drag-ghost strong,.layout-drag-ghost span { display:block; overflow-wrap:anywhere; }
.layout-drag-ghost strong { font-size:18px; margin-bottom:5px; }
.layout-drag-ghost span { font-size:13px; color:#bdd0e9; }
.layout-new-data { position:absolute; top:-10px; right:18px; padding:4px 10px; font-size:12px; font-weight:800; line-height:1.4; background:#ff9c50; border:1px solid #ffc494; color:#2f1706; border-radius:999px; pointer-events:none; z-index:2; }
.layout-new-data[hidden] { display:none; }
.sensor-card.layout-data-pulse { animation:layout-sample-flash 2.2s ease-out 1; }
@keyframes layout-sample-flash {
  0% { box-shadow:0 0 0 3px #ffa052c0,0 0 32px #ff8a362e; }
  25% { box-shadow:0 0 0 2px #ffa05280,0 0 24px #ff8a3620; }
  100% { box-shadow:0 0 0 0 #ffa05200,0 0 0 #ff8a3600; }
}
/* Limit-alarm red border always wins; a new reading must not hide an alarm. */
.sensor-card.alarm-active { border-color:#f27d86; }
body.paused .sensor-card.layout-data-pulse { animation:none; outline:2px solid #bf824d; }
@media (prefers-reduced-motion:reduce) {
 .sensor-card.layout-data-pulse { animation:none; outline:2px solid #bf824d; }
}
@media (max-width:800px) {
 .header-status { width:100%; align-items:stretch; }
 .connection-detail { text-align:left; font-size:13px; max-width:none; }
 .header-right { flex-wrap:wrap; }
 .layout-toolbar { align-items:stretch; }
 .layout-toolbar .button { width:100%; }
 .layout-toolbar p { font-size:14px; }
}
/* On phones reserve a separate row for connectivity; never squeeze the brand
   caption under the status detail. */
@media (max-width:800px) {
 .header-inner { display:grid; grid-template-columns:minmax(0,1fr); gap:14px; }
 .header-inner .brand { display:grid; grid-template-columns:120px minmax(0,1fr); align-items:center; gap:14px; width:100%; }
 .header-inner .brand img { width:120px; height:auto; }
 .header-inner .brand-caption { min-width:0; border:0; padding:0; margin:0; font-size:14px; line-height:1.5; white-space:normal; overflow-wrap:anywhere; }
 .header-status { align-items:stretch; }
 .header-right { display:flex; flex-direction:row; justify-content:space-between; align-items:center; }
 .connection-detail { margin-top:6px; }
}
@media (max-width:359px) {
 .header-inner .brand { grid-template-columns:104px minmax(0,1fr); gap:12px; }
 .header-inner .brand img { width:104px; }
 .header-inner .brand-caption { font-size:13px; }
}
