* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
        "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f3f5f8;
    color: #222;
}
button {
    cursor: pointer; border: 0; padding: 8px 14px; border-radius: 6px;
    background: #2b7cff; color: #fff; font-size: 14px;
}
button:hover { background: #1f66dc; }
button:disabled { background: #aaa; cursor: not-allowed; }
input[type=text], input[type=password] {
    width: 100%; padding: 10px; border: 1px solid #d0d4dc;
    border-radius: 6px; font-size: 14px;
}
.err { color: #d32f2f; min-height: 20px; margin-top: 8px; font-size: 13px; }

/* 登录 */
.login-bg {
    height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1a3d8f 0%, #2b7cff 100%);
}
.login-box {
    width: 360px; padding: 32px; background: #fff; border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,.18);
}
.login-box h1 {
    margin: 0 0 20px; font-size: 22px; color: #1a3d8f; text-align: center;
}
.login-box label {
    display: block; margin: 12px 0 6px; font-size: 13px; color: #555;
}
.login-box button { width: 100%; margin-top: 16px; padding: 12px; font-size: 15px; }
.footer { margin-top: 16px; text-align: center; color: #999; font-size: 12px; }

/* 顶栏 */
.topbar {
    height: 56px; background: #1a3d8f; color: #fff; display: flex;
    justify-content: space-between; align-items: center; padding: 0 24px;
}
.topbar .brand { font-size: 16px; font-weight: 600; }
.topbar .brand a { color: #fff; text-decoration: none; }
.topbar .user { display: flex; gap: 12px; align-items: center; font-size: 14px; }

/* 列表页 */
.dashboard { padding: 24px; }
.dashboard h2 { margin-top: 0; }
.dashboard .conn { color: #888; margin-bottom: 12px; font-size: 13px; }
.table-wrap { overflow-x: auto; }
.vehicle-table {
    width: 100%; border-collapse: collapse; background: #fff;
    border-radius: 8px; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.05); min-width: 900px;
}
.vehicle-table th, .vehicle-table td {
    padding: 12px; text-align: left; border-bottom: 1px solid #eef;
    font-size: 13px;
}
.vehicle-table th { background: #f3f5f8; color: #555; font-weight: 600; }
.vehicle-table tbody tr:hover { background: #f8faff; }
.online-tag, .offline-tag {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    font-size: 12px; color: #fff;
}
.online-tag { background: #2dbf61; }
.offline-tag { background: #b1b6c0; }

/* 控制页 */
.control-page {
    padding: 12px; display: grid; gap: 10px;
    grid-template-columns: 1fr; max-width: 1400px; margin: 0 auto;
}
.status-grid {
    display: grid; gap: 10px; grid-template-columns: repeat(4, 1fr);
}
.control-pad {
    display: grid; gap: 10px; grid-template-columns: 1fr 1fr;
}
/* v2 紧凑布局:运动 | 作业 | 视频 三列横排 */
.control-pad-v2 {
    display: grid; gap: 10px;
    grid-template-columns: minmax(280px, 0.9fr) minmax(220px, 0.7fr) minmax(360px, 1.4fr);
    align-items: stretch;
}
.card {
    background: #fff; border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.card-title {
    padding: 8px 12px; border-bottom: 1px solid #eef;
    font-size: 13px; color: #1a3d8f; font-weight: 600;
}
.card-body { padding: 10px 12px; font-size: 13px; line-height: 1.6; }
.row { display: flex; gap: 6px; margin-top: 6px; }
.row button, .row > button { padding: 4px 10px; }

/* 运动控制更紧凑:D-pad 缩到 60px */
.motion-card .dpad {
    display: grid; gap: 6px;
    grid-template-columns: 60px 60px 60px;
    grid-template-rows: 60px 60px 60px;
    grid-template-areas: ". up ." "left stop right" ". down .";
    justify-content: center; margin: 6px 0;
}
/* 旧 .dpad 保持兼容(任务页或其他地方未来若用) */
.dpad {
    display: grid; gap: 8px;
    grid-template-columns: 70px 70px 70px;
    grid-template-rows: 70px 70px 70px;
    grid-template-areas: ". up ." "left stop right" ". down .";
    justify-content: center; margin: 8px 0;
}
.dp {
    border-radius: 50%; padding: 0; font-size: 12px; line-height: 1.15;
    background: #2b7cff; color: #fff; user-select: none;
    -webkit-user-select: none;
}
.dp:active { background: #134eb0; transform: scale(0.96); }
.dp-up    { grid-area: up;    }
.dp-down  { grid-area: down;  }
.dp-left  { grid-area: left;  }
.dp-right { grid-area: right; }
.dp-stop  { grid-area: stop; background: #d32f2f; }
.dp-stop:active { background: #951d1d; }

.speed-row { display: grid; gap: 4px; margin-top: 8px; font-size: 12px; }
.speed-row label { color: #555; }
.speed-row input[type=range] { width: 100%; height: 16px; }
.hint { color: #888; font-size: 11px; margin-top: 6px; line-height: 1.4; }

/* 作业卡片 */
.action-card .card-body { display: flex; flex-direction: column; gap: 6px; }
.action-btn {
    padding: 8px 10px; font-size: 13px; border: 0; border-radius: 5px;
    cursor: pointer; color: #fff;
}
.action-honk      { background: #f5a623; }
.action-honk:hover { background: #d18a13; }
.action-spray-on  { background: #2b7cff; }
.action-spray-on:hover { background: #1c66e0; }
.action-spray-off { background: #888; }
.action-spray-off:hover { background: #555; }
.action-pump-on   { background: #17a2b8; }
.action-pump-on:hover { background: #12808f; }
.action-pump-off  { background: #888; }
.action-pump-off:hover { background: #555; }
.action-row { display: flex; gap: 6px; }
.action-row .action-btn { flex: 1; }
.action-pumps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.action-pumps button {
    padding: 5px 0; font-size: 12px; background: #f3f5f8; color: #333;
    border: 1px solid #ccd; border-radius: 4px; cursor: pointer;
}
.action-pumps button:hover { background: #e1e6ee; }
.action-pumps button:active { background: #2b7cff; color: #fff; border-color: #2b7cff; }
.action-status {
    margin-top: 4px; padding: 6px 8px; font-size: 12px;
    background: #f3f5f8; border-radius: 4px; color: #555;
}
.action-status span { color: #1a3d8f; font-weight: 500; }
/* 页面顶部作业状态横幅(顶栏下方,通栏) */
.work-status-bar {
    display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center;
    padding: 8px 18px; background: #eef4ff; border-bottom: 1px solid #d6e2f8;
    font-size: 13px;
}
.work-status-bar .wsb-item { color: #1a3d8f; font-weight: 500; }

/* 水箱余量 */
.liquid-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: #555; }
.liquid-row > span { flex: 0 0 auto; }
.liquid-row b { flex: 0 0 auto; color: #1a3d8f; }
.liquid-bar { flex: 1; height: 12px; background: #e6ebf2; border-radius: 6px; overflow: hidden; }
.liquid-fill { height: 100%; width: 0%; background: #17a2b8; border-radius: 6px; transition: width .4s ease, background .3s; }
.liquid-fill.warn { background: #f5a623; }
.liquid-fill.low  { background: #d32f2f; }
.liquid-fill.stale { opacity: .45; }

/* 日志单独占一行,有滚动条 */
.log-section { display: grid; }
.log-card pre {
    margin: 0; padding: 12px; max-height: 180px; min-height: 100px;
    overflow-y: auto;
    background: #0e1525; color: #b9d8ff; font-size: 12px;
    border-radius: 0 0 8px 8px; line-height: 1.55;
    white-space: pre-wrap; word-break: break-word;
}

.dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #b1b6c0; display: inline-block;
}
.dot.online { background: #2dbf61; }

@media (max-width: 1100px) {
    .control-pad-v2 { grid-template-columns: 1fr 1fr; }
    .control-pad-v2 .video-card { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
    .status-grid, .control-pad, .control-pad-v2 { grid-template-columns: 1fr; }
    .control-pad-v2 .video-card { grid-column: auto; }
}

/* SDK 状态徽章 (dashboard 列表 + control 页头) */
.tag-ok, .tag-warn, .tag-err {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    color: #fff;
    margin-left: 4px;
}
.tag-ok   { background: #2dbf61; }
.tag-warn { background: #f5a623; }
.tag-err  { background: #d32f2f; }

.status-badge {
    font-size: 13px;
    padding: 4px 10px;
}

.dev-info-bar {
    color: #6b7280;
    font-size: 12px;
    padding: 4px 8px;
    margin-bottom: 4px;
}


/* 控制页车载视频卡片 */
.video-card .card-title {
    display: flex; justify-content: space-between; align-items: center;
}
.video-status {
    font-size: 12px; color: #888; font-weight: normal;
}
.cam-video {
    width: 100%; height: 220px; background: #000;
    display: block; object-fit: contain;
}
.video-url-row {
    display: flex; gap: 6px; padding: 6px 8px;
}
.video-url-row input {
    flex: 1; font-size: 11px; padding: 3px 6px;
    border: 1px solid #ccd; border-radius: 4px;
}
.video-url-row button {
    font-size: 11px; padding: 3px 8px; background: #2b7cff;
    color: #fff; border: 0; border-radius: 4px; cursor: pointer;
}
.video-url-row button:hover { background: #1c66e0; }

/* RTT 网络质量徽章(顶栏右侧) */
.rtt-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    background: rgba(255, 255, 255, 0.15);
    color: #ddd;
    transition: background 200ms, color 200ms;
    cursor: help;
}
.rtt-idle { background: rgba(255, 255, 255, 0.12); color: #aaa; }
.rtt-good { background: rgba(45, 191, 97, 0.35);  color: #b8f0c8; }
.rtt-warn { background: rgba(245, 166, 35, 0.40); color: #ffe2b0; }
.rtt-bad  { background: rgba(211, 47, 47, 0.55);  color: #ffd0d0;
            animation: rtt-pulse 1.2s ease-in-out infinite; }
@keyframes rtt-pulse {
    50% { background: rgba(211, 47, 47, 0.85); }
}

/* 本地放大倍数选择(运动控制卡内底部) */
.amp-row {
    display: flex; align-items: center; gap: 8px;
    margin-top: 6px; font-size: 11px; color: #666;
}
.amp-row label { color: #555; font-size: 11px; }
.amp-btns { display: flex; gap: 3px; flex: 1; }
.amp-btn {
    flex: 1; padding: 3px 0; font-size: 11px;
    background: #f3f5f8; color: #555;
    border: 1px solid #ccd; border-radius: 4px; cursor: pointer;
    font-variant-numeric: tabular-nums;
}
.amp-btn:hover { background: #e1e6ee; }
.amp-btn.active {
    background: #2b7cff; color: #fff; border-color: #2b7cff; font-weight: 600;
}

/* 作业卡:喷洒 / 冲管 分组 */
.action-group {
    margin-top: 6px;
    border-top: 1px dashed #dde3ee;
    padding-top: 6px;
}
.action-group-title {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

/* 冲管按钮:跟单独的"开喷洒"色调区分开,用灰底以提示这是"清洗维护"功能 */
.flush-btn {
    padding: 5px 0; font-size: 12px; background: #f3f5f8; color: #333;
    border: 1px solid #ccd; border-radius: 4px; cursor: pointer;
}
.flush-btn:hover  { background: #e1e6ee; }
.flush-btn:active { background: #2b7cff; color: #fff; border-color: #2b7cff; }
.flush-btn.flush-all  { background: #2b7cff; color: #fff; border-color: #2b7cff; }
.flush-btn.flush-all:hover { background: #1c66e0; }
.flush-btn.flush-stop { background: #888; color: #fff; border-color: #888; }
.flush-btn.flush-stop:hover { background: #555; }

/* 行内多按钮等宽 */
.action-row .flush-btn { flex: 1; }

/* ===== v0.6.6: 双摄像头 + 雷达可视化 ===== */

/* 视频卡现在装两路:用网格 2x1 排列两个 video */
.video-card-dual {
    /* 视频卡现在占用更多横向空间(两路并排) */
}
.dual-video-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #0e1525;
}
.dual-video-cell {
    position: relative;
    background: #000;
}
.dual-video-tag {
    position: absolute;
    top: 4px; left: 6px; z-index: 2;
    padding: 1px 6px; border-radius: 3px;
    font-size: 11px; color: #fff;
    background: rgba(43, 124, 255, 0.85);
    pointer-events: none;
}
.dual-video-cell .cam-video {
    width: 100%; height: 180px;
    background: #000; display: block; object-fit: contain;
}

/* URL 行带"前/后"标签 */
.url-tag {
    flex: 0 0 18px;
    font-size: 11px; color: #888;
    text-align: center; line-height: 24px;
}

/* 视频状态行从单状态变成"前 X · 后 Y" */
.video-mini-status {
    font-size: 11px; color: #888; font-weight: normal;
    display: inline-flex; align-items: center; gap: 4px;
}
.vid-label {
    background: #2b7cff; color: #fff;
    padding: 0 4px; border-radius: 2px;
    font-size: 10px;
}

/* 把视频卡的 grid 列宽放大(因为现在装两路) */
.control-pad-v2 {
    grid-template-columns: minmax(280px, 0.85fr) minmax(220px, 0.55fr) minmax(520px, 1.8fr);
}
@media (max-width: 1100px) {
    .control-pad-v2 { grid-template-columns: 1fr 1fr; }
    .control-pad-v2 .video-card { grid-column: 1 / -1; }
    .dual-video-cell .cam-video { height: 220px; }
}

/* 底栏:雷达 + 日志 横向并排 */
.bottom-row {
    display: grid; gap: 10px;
    grid-template-columns: 260px 1fr;
}
.radar-card .card-title {
    display: flex; justify-content: space-between; align-items: center;
}
.radar-mini-status {
    font-size: 11px; color: #888; font-weight: normal;
    font-variant-numeric: tabular-nums;
}
.radar-svg {
    display: block;
    width: 100%;
    /* 不设宽度上限 — 让 SVG 撑满 .radar-card 卡片宽度,
       aspect-ratio:1 保证圆环不被压扁,viewBox 自动缩放内容 */
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    border-radius: 6px;
}
.radar-legend {
    margin-top: 6px;
    font-size: 11px; color: #888;
    display: flex; gap: 10px; flex-wrap: wrap;
}
.radar-legend .legend-dot {
    display: inline-block;
    width: 8px; height: 8px; border-radius: 50%;
    margin-right: 3px; vertical-align: -1px;
    border: 1px solid #fff;
}
.legend-dot.dot-front { background: #ff3b3b; }
.legend-dot.dot-rear  { background: #ff8c42; }
.radar-hint { margin-left: auto; color: #aaa; }

@media (max-width: 900px) {
    .bottom-row { grid-template-columns: 1fr; }
}

/* ===== v0.6.7: 紧凑控制页重排 ===== */

/* 顶栏内嵌 dev-info(SN/SDK,已删除 Model) */
.dev-info-inline {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    margin-left: 4px;
    font-variant-numeric: tabular-nums;
}
.remark-edit {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
    border-radius: 3px;
    padding: 0 4px;
    margin-left: 4px;
    font-size: 11px;
    cursor: pointer;
    line-height: 18px;
}
.remark-edit:hover { background: rgba(255,255,255,0.12); color: #fff; }
/* 备注部分在 vehicle-id-label 里直接渲染:`VEH001 (备注)` */

/* 状态卡 4 列 → 3 列(电池并入系统状态) */
.status-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}
/* 系统状态卡里电池行 */
.bat-row {
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px dashed #dde3ee;
    display: flex; gap: 10px;
    font-size: 12px; color: #444;
    flex-wrap: wrap;
}
.bat-row b { color: #1a3d8f; font-weight: 600; font-variant-numeric: tabular-nums; }

/* 主行 4 列:运动 | 作业 | 雷达 | 视频
   雷达列 minmax 上限拉大,让 SVG 在宽屏时能铺得更开 */
.control-pad-v3 {
    display: grid; gap: 10px;
    grid-template-columns:
        minmax(240px, 0.75fr)
        minmax(200px, 0.65fr)
        minmax(260px, 1.1fr)
        minmax(320px, 1.3fr);
    align-items: stretch;
}

/* 视频卡上下叠(替代之前的左右排版) */
.video-card-stacked .stacked-video-grid {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 1px;
    background: #0e1525;
}
.video-card-stacked .stacked-video-cell {
    position: relative; background: #000;
}
.video-card-stacked .stacked-video-tag {
    position: absolute; top: 4px; left: 6px; z-index: 2;
    padding: 1px 6px; border-radius: 3px;
    font-size: 11px; color: #fff;
    background: rgba(43, 124, 255, 0.85);
    pointer-events: none;
}
.video-card-stacked .cam-video {
    width: 100%; height: 240px;
    background: #000; display: block; object-fit: contain;
}

/* 雷达卡:SVG 撑满列宽,图例字号略小一点节省高度 */
.control-pad-v3 .radar-card .radar-legend {
    font-size: 10px;
}

/* 1100 以下塌成 2x2 */
@media (max-width: 1280px) {
    .control-pad-v3 { grid-template-columns: 1fr 1fr; }
    .control-pad-v3 .video-card { grid-column: 1 / -1; }
    .control-pad-v3 .video-card-stacked .cam-video { height: 200px; }
}
@media (max-width: 900px) {
    .control-pad-v3 { grid-template-columns: 1fr; }
    .status-grid-3 { grid-template-columns: 1fr; }
}

/* ===== v0.6.8: 雷达健康状态在系统卡内 ===== */
.radar-status-row {
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px dashed #dde3ee;
    display: flex; flex-direction: column; gap: 3px;
    font-size: 12px;
}
.rs-line {
    display: flex; align-items: center; gap: 6px;
    /* 不换行 — 一行写不下时由 .rs-detail 自己省略,避免行高跳变 */
    flex-wrap: nowrap;
    min-width: 0;
}
.rs-tag {
    background: #f3f5f8; color: #555;
    padding: 0 6px; border-radius: 3px;
    font-size: 11px; line-height: 16px;
    font-variant-numeric: tabular-nums;
    min-width: 50px; text-align: center;
    flex: 0 0 auto;
}
.rs-text {
    font-weight: 600;
    padding: 0 4px;
    flex: 0 0 auto;
    white-space: nowrap;
}
.rs-text.rs-ok      { color: #1f8a4c; }
.rs-text.rs-warn    { color: #b8761b; }
.rs-text.rs-err     { color: #c0392b; }
.rs-text.rs-off     { color: #888; }
.rs-text.rs-unknown { color: #999; }
.rs-detail {
    font-size: 11px; color: #888; flex: 1 1 auto;
    font-variant-numeric: tabular-nums;
    /* 强制单行,超长时省略号代替而非换行 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* 车辆列表"更多"下拉菜单 */
.more-dd { position: relative; display: inline-block; }
.more-dd > summary {
  list-style: none; cursor: pointer; display: inline-block;
  padding: 6px 12px; border-radius: 4px; font-size: 13px;
  background: #eef1f7; color: #345; border: 1px solid #d6deea;
  user-select: none;
}
.more-dd > summary::-webkit-details-marker { display: none; }
.more-dd > summary:hover { background: #e2e8f4; }
.more-dd[open] > summary { background: #dbe4f3; }
.more-menu {
  position: fixed; left: -9999px; top: -9999px; z-index: 3000;
  background: #fff; border: 1px solid #dce3ee; border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12); padding: 6px; min-width: 148px;
  display: flex; flex-direction: column; gap: 4px;
}
.more-menu button {
  width: 100%; text-align: left; padding: 7px 10px; border: 0;
  background: #fff; border-radius: 4px; font-size: 13px; color: #234; cursor: pointer;
}
.more-menu button:hover { background: #eef4ff; }

/* 喷洒/喷水状态徽标(用于控制页/列表/任务页) */
.spray-badge {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 12px; line-height: 18px; color: #fff; background: #8a94a6; white-space: nowrap;
}
.spray-badge.off  { background: #8a94a6; }
.spray-badge.unk  { background: #c9a227; }
.spray-badge.mist-on { background: #2b7cff; }          /* 雾化喷洒中=蓝 */
.spray-badge.pump-on { background: #17a2b8; font-weight: 600; }  /* 水泵喷水中=青 */
@keyframes spray-blink { 0%,100%{opacity:1} 50%{opacity:.55} }
.spray-badge.pump-on, .spray-badge.mist-on { animation: spray-blink 1.2s ease-in-out infinite; }
/* 作业按钮:水泵开启时高亮 */
.action-pump-on.active { box-shadow: 0 0 0 3px rgba(23,162,184,.35); }


/* 加水面板复用card、card-title、card-body、row、hint及全局按钮样式。 */
.water-card {
    position: fixed; right: 16px; bottom: 16px; z-index: 1400;
    width: 720px; max-width: calc(100vw - 24px);
    height: 640px; max-height: calc(100vh - 80px);
    display: flex; flex-direction: column; min-width: 0;
    background: #f8faff; color: #222;
    border: 1px solid #c8d8ef; border-top: 3px solid #2b7cff;
    border-radius: 8px; overflow: hidden;
    box-shadow: 0 8px 28px rgba(26,61,143,.16), 0 2px 6px rgba(26,61,143,.08);
}
.water-card[hidden] { display: none; }
.water-card > .card-body { flex: 1; overflow-y: scroll; min-height: 0; overscroll-behavior: contain; scrollbar-gutter: stable; overflow-anchor: none; }
.water-title {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0;
    background: #eaf1fc; color: #1a3d8f; border-bottom: 1px solid #d6e2f3;
}
.water-close { background: transparent; color: #526b91; padding: 0 6px; font-size: 20px; line-height: 24px; }
.water-title { cursor: grab; user-select: none; touch-action: none; }
.water-title.is-dragging { cursor: grabbing; }
.water-close { cursor: pointer; }
.water-close:hover { background: #dbe7fa; color: #1a3d8f; }
.water-version { font-size: 11px; font-weight: normal; color: #68758a; margin-left: 6px; }
.water-card button:focus-visible, .water-fields input:focus-visible, .water-settings > summary:focus-visible {
    outline: 2px solid #2b7cff; outline-offset: 2px;
}
.water-toggle { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 13px; white-space: nowrap; margin-right: 8px; }
.water-toggle input { cursor: pointer; margin: 0; }
.water-toggle-standalone { position: fixed; top: 12px; right: 12px; z-index: 1400; padding: 8px 12px; background: #fff; border-radius: 6px; }
@media (max-width: 600px) {
    .water-card { right: 12px; bottom: 12px; }
}
.water-detail { margin: 6px 0; }
.water-info-row { display: grid; grid-template-columns: 12em minmax(0, 1fr); column-gap: .6em; height: 2.4em; align-items: start; }
.water-info-label { min-width: 0; white-space: nowrap; line-height: 1.7; overflow: hidden; text-overflow: ellipsis; }
.water-info-value { display: block; min-width: 0; height: 2.4em; line-height: 1.7; white-space: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.water-card [data-status] { height: 3em; line-height: 1.5; overflow-y: auto; overflow-wrap: anywhere; }
.water-card [data-notice] { height: 2.4em; line-height: 1.7; white-space: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.water-actions { flex-wrap: wrap; }
.water-settings { margin-top: 10px; padding: 8px 10px; background: #fff; border: 1px solid #dce5f2; border-radius: 6px; }
.water-settings > summary { cursor: pointer; color: #1a3d8f; }
.water-fields { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 8px 0; }
.water-fields label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.water-fields input[type=number] {
    width: 96px; padding: 5px 8px; border: 1px solid #d0d4dc;
    border-radius: 6px; font: inherit; color: inherit; background: #fff;
}
.water-card .hint { margin-bottom: 0; color: #68758a; }
.water-test,.water-station-video {margin-top:12px;padding:10px;border:1px solid #dce5f2;border-radius:6px;background:#fff;}
.water-station-video video {display:block;width:100%;aspect-ratio:16/9;object-fit:contain;background:#17243a;border-radius:5px;}
.water-station-video h4 {margin:0 0 8px;color:#1a3d8f;}
.water-station-video [data-video-status] {display:block;min-width:0;white-space:nowrap;overflow:auto;max-width:100%;}
.water-test [data-test-hold] {touch-action:none;user-select:none;}

/* Server-owned refill settings; existing fixed status rows are unchanged. */
.water-settings-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0;}
.water-settings-grid label {display:flex;flex-direction:column;gap:4px;color:#1d3d71;font-size:14px;}
.water-settings-grid small {color:#70819c;font-size:12px;}
.water-settings-grid input,.water-settings-grid select,.water-settings textarea {box-sizing:border-box;width:100%;border:1px solid #cbd8ee;border-radius:5px;padding:6px;background:white;color:#273b58;}
.water-settings-grid input[type=checkbox] {width:18px;height:18px;}
@media(max-width:520px){.water-settings-grid {grid-template-columns:1fr;}}
