/* AiMaMi-inspired parallel UI for IoTTool v2. */
@import url("/styles/app.css?v=260603-desktop-porting-03");

:root {
  --ink: #f4f4f5;
  --muted: #a1a1aa;
  --dim: #71717a;
  --bg: #0e0e11;
  --deck: #18181b;
  --deck-2: #202024;
  --deck-3: #111114;
  --line: #2f2f35;
  --line-soft: rgba(255, 255, 255, 0.08);
  --line-hot: #3b82f6;
  --green: #10b981;
  --cyan: #3b82f6;
  --blue: #60a5fa;
  --amber: #f59e0b;
  --red: #ef4444;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  --page-grid-x: transparent;
  --page-grid-y: transparent;
  --page-gradient: #0e0e11;
  --scan-overlay: linear-gradient(transparent, transparent);
  --topbar-bg: rgba(24, 24, 27, 0.82);
  --brand-mark-bg: rgba(59, 130, 246, 0.12);
  --chip-bg: rgba(255, 255, 255, 0.045);
  --panel-bg: #18181b;
  --panel-head-bg: rgba(255, 255, 255, 0.025);
  --control-bg: rgba(255, 255, 255, 0.045);
  --control-hover-bg: rgba(59, 130, 246, 0.11);
  --log-list-bg: rgba(0, 0, 0, 0.2);
  --log-row-bg: rgba(255, 255, 255, 0.035);
  --auto-row-bg: rgba(255, 255, 255, 0.035);
  --auto-row-alt-bg: rgba(255, 255, 255, 0.055);
  --auto-current-bg: rgba(59, 130, 246, 0.15);
  --empty-bg: rgba(255, 255, 255, 0.035);
  --input-bg: rgba(255, 255, 255, 0.055);
  --selected-bg: rgba(59, 130, 246, 0.12);
  --primary-button-bg: linear-gradient(180deg, #60a5fa, #2563eb);
  --primary-button-ink: #ffffff;
  --danger-bg: rgba(239, 68, 68, 0.14);
  --success-text: #34d399;
  --error-text: #fca5a5;
  --warning-text: #fbbf24;
  --info-text: #93c5fd;
  --mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, Monaco, monospace;
  --display: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  --body: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

:root[data-theme="light"] {
  --ink: #171717;
  --muted: #60646c;
  --dim: #8a8f98;
  --bg: #f8f8fa;
  --deck: #ffffff;
  --deck-2: #f3f3f6;
  --deck-3: #ededf1;
  --line: #e5e5e5;
  --line-soft: rgba(0, 0, 0, 0.08);
  --line-hot: #2563eb;
  --cyan: #2563eb;
  --blue: #2563eb;
  --green: #059669;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
  --page-gradient: #f8f8fa;
  --topbar-bg: rgba(255, 255, 255, 0.82);
  --panel-bg: #ffffff;
  --panel-head-bg: rgba(0, 0, 0, 0.018);
  --control-bg: rgba(0, 0, 0, 0.035);
  --control-hover-bg: rgba(37, 99, 235, 0.08);
  --log-list-bg: rgba(0, 0, 0, 0.025);
  --log-row-bg: rgba(255, 255, 255, 0.94);
  --auto-row-bg: rgba(255, 255, 255, 0.92);
  --auto-row-alt-bg: rgba(245, 247, 250, 0.95);
  --input-bg: rgba(255, 255, 255, 0.86);
  --primary-button-bg: linear-gradient(180deg, #3b82f6, #2563eb);
  --primary-button-ink: #ffffff;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  background: var(--bg);
  overflow: hidden;
}

body::before {
  display: none;
}

.app-shell-v2 .manual-send-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  overflow: visible;
}

.app-shell-v2 .manual-send-title {
  flex: 0 0 auto;
}

.app-shell-v2 .manual-send-bottom {
  grid-template-columns: 34px minmax(140px, 1fr) max-content;
  justify-content: stretch;
  gap: 8px;
}

.app-shell-v2 .manual-target-control {
  grid-template-columns: auto minmax(0, 1fr) 62px;
  flex: 1 1 266px;
  width: auto;
  min-width: 0;
  max-width: 318px;
  gap: 6px;
}

.app-shell-v2 .manual-target-control select {
  min-width: 0;
}

.app-shell-v2 .manual-disconnect-btn {
  min-width: 0;
  padding: 0 5px;
}

.app-shell-v2 .send-history-select {
  width: 100%;
  max-width: none;
}

.app-shell-v2 .manual-send-tools {
  flex: 0 0 auto;
  width: auto;
  flex-wrap: nowrap;
  margin-left: 0;
}

.app-shell-v2 .manual-send-tools .btn {
  flex: 0 0 auto;
}

.app-shell-v2 .manual-send-actions {
  grid-column: auto;
  width: auto;
  min-width: max-content;
  flex: 0 0 auto;
}

.app-shell-v2 .manual-send-actions .btn {
  flex: 0 0 auto;
}

.app-shell-v2 .manual-send-bottom .btn.primary {
  min-width: 92px;
  padding: 0 12px;
}

.app-shell-v2 .manual-send-bottom .btn.danger {
  min-width: 88px;
  padding: 0 12px;
}

@container traffic-panel (max-width: 430px) {
  .app-shell-v2 .manual-send-toolbar {
    flex-wrap: wrap;
  }

  .app-shell-v2 .manual-send-tools {
    margin-left: auto;
  }

  .app-shell-v2 .manual-target-control {
    flex-basis: 100%;
    order: 3;
    width: 100%;
    max-width: none;
  }
}

.app-shell-v2 {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  min-height: 0;
  color: var(--ink);
  background: var(--bg);
  transition: grid-template-columns 0.18s cubic-bezier(0.2, 0.82, 0.3, 1);
}

.app-shell-v2.sidebar-hidden {
  grid-template-columns: 0 minmax(0, 1fr);
}

.app-sidebar {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 4px 8px 10px;
  border-right: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--deck) 72%, var(--bg));
  overflow: hidden;
  transition: opacity 0.14s ease, padding 0.18s ease, border-color 0.18s ease;
}

.app-shell-v2.sidebar-hidden .app-sidebar {
  padding-right: 0;
  padding-left: 0;
  border-right-color: transparent;
  opacity: 0;
  pointer-events: none;
}

.sidebar-brand {
  min-width: 0;
  border: 0;
  min-height: 36px;
  border-radius: 9px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  transition: background 0.16s ease;
}

.sidebar-brand:hover,
.sidebar-brand.active {
  background: var(--control-bg);
}

.sidebar-logo-wrap {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: #ffffff;
}

.sidebar-logo {
  width: 24px;
  height: 24px;
  display: block;
}

.sidebar-brand-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
  line-height: 1.1;
}

.sidebar-brand-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.sidebar-brand-copy span,
.sidebar-caption {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.sidebar-nav {
  align-self: start;
  min-height: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.sidebar-nav .module-tab {
  min-height: 34px;
  justify-content: flex-start;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  font-weight: 600;
}

.sidebar-nav .module-tab:hover,
.sidebar-nav .module-tab.active {
  color: var(--ink);
  border-color: transparent;
  background: var(--control-bg);
  box-shadow: none;
}

.sidebar-nav .module-tab.active svg {
  color: var(--cyan);
}

.sidebar-footer {
  display: grid;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

.sidebar-footer .theme-switch {
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: stretch;
  padding: 4px;
  border-radius: 11px;
  background: var(--control-bg);
}

.sidebar-footer .theme-option {
  min-width: 0;
  min-height: 32px;
  padding-inline: 8px;
  gap: 6px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.theme-option-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.app-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.app-topbar {
  min-height: 44px;
  margin: 0;
  padding: 5px 14px;
  border-width: 0 0 1px;
  border-color: var(--line-soft);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: blur(20px);
  display: grid;
  grid-template-columns: auto auto max-content minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.app-page-title {
  min-width: 0;
  display: flex;
  align-items: center;
}

.module-title {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 750;
  line-height: 1;
}

.topbar-divider {
  width: 1px;
  height: 18px;
  background: var(--line-soft);
}

.topbar-actions {
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
}

.topbar-icon-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.topbar-icon-btn:hover,
.topbar-icon-btn:focus-visible,
.topbar-icon-btn.active {
  color: var(--ink);
  border-color: var(--line-soft);
  background: var(--control-bg);
  outline: none;
}

.topbar-icon-btn .icon {
  width: 16px;
  height: 16px;
}

.sync-status-chip {
  position: relative;
  color: var(--success-text);
}

.sync-status-chip .dot {
  position: absolute;
  right: 7px;
  top: 7px;
}

.topbar-action-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.v2-frame {
  width: 100%;
  max-width: none;
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 14px 16px 18px;
  overflow: auto;
}

.flash-module .flash-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.flash-module .flash-grid {
  padding: 0;
}

.panel,
.placeholder-block,
.flash-card,
.sync-panel,
.highlight-panel {
  border-color: var(--line-soft);
  border-radius: 16px;
}

.panel-head {
  border-radius: 16px 16px 0 0;
}

.btn,
.chip,
input,
select,
textarea,
.send-tab,
.theme-option {
  border-radius: 8px;
}

.console-grid {
  margin-top: 0;
}

.control-panel,
.traffic-panel,
.auto-task-panel {
  height: max(460px, calc(100vh - 76px));
}

.app-shell-v2 .mqtt-module {
  margin-top: 0;
}

.app-shell-v2 .mqtt-workspace {
  --mqtt-left-width: 360px;
  --mqtt-right-width: 360px;
  height: max(460px, calc(100vh - 76px));
  overflow: visible;
  grid-template-columns:
    var(--mqtt-left-width)
    var(--mqtt-left-resizer-width)
    minmax(420px, 1fr)
    var(--mqtt-right-resizer-width)
    var(--mqtt-right-width);
}

.app-shell-v2 .mqtt-workspace.left-collapsed {
  --mqtt-left-width: 0px;
  --mqtt-left-resizer-width: 0px;
  grid-template-columns:
    var(--mqtt-left-width)
    var(--mqtt-left-resizer-width)
    minmax(420px, 1fr)
    var(--mqtt-right-resizer-width)
    var(--mqtt-right-width);
}

.app-shell-v2 .mqtt-workspace.right-collapsed {
  --mqtt-right-width: 0px;
  --mqtt-right-resizer-width: 0px;
  grid-template-columns:
    var(--mqtt-left-width)
    var(--mqtt-left-resizer-width)
    minmax(420px, 1fr)
    var(--mqtt-right-resizer-width)
    var(--mqtt-right-width);
}

.app-shell-v2 .mqtt-workspace.left-collapsed.right-collapsed {
  grid-template-columns: 0 0 minmax(420px, 1fr) 0 0;
}

.app-shell-v2 .mqtt-workspace.left-collapsed .mqtt-connection-panel,
.app-shell-v2 .mqtt-workspace.right-collapsed .mqtt-side-panel {
  display: grid;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  border-color: transparent;
  box-shadow: none;
}

.app-shell-v2 .mqtt-workspace.left-collapsed .layout-resizer-left,
.app-shell-v2 .mqtt-workspace.right-collapsed .layout-resizer-right {
  width: 0;
  min-width: 0;
  opacity: 0;
  pointer-events: none;
}

.app-shell-v2 .mqtt-workspace .mqtt-layout-resizer {
  display: flex;
}

.app-shell-v2 .mqtt-connection-panel > .mqtt-panel-head {
  min-height: 44px;
  padding: 10px 12px;
  gap: 8px;
}

.app-shell-v2 .mqtt-connection-panel .section-title {
  font-size: 15px;
  line-height: 20px;
  font-weight: 700;
}

.app-shell-v2 .mqtt-connection-panel .mqtt-status {
  min-height: 24px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.app-shell-v2 .mqtt-connection-panel .mqtt-panel-body {
  gap: 6px;
  padding: 8px 10px 20px;
  overflow-y: auto;
  padding-bottom: 20px;
  overscroll-behavior: contain;
}

.app-shell-v2 .mqtt-connection-panel .mqtt-profile-row {
  grid-template-columns: max-content minmax(0, 1fr) 30px;
  column-gap: 4px;
  row-gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.app-shell-v2 .mqtt-connection-panel .mqtt-profile-row label,
.app-shell-v2 .mqtt-connection-panel .mqtt-field,
.app-shell-v2 .mqtt-connection-panel .mqtt-check {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 15px;
}

.app-shell-v2 .mqtt-connection-panel .mqtt-field {
  gap: 4px;
  min-width: 0;
}

.app-shell-v2 .mqtt-connection-panel .mqtt-form-grid {
  gap: 6px;
  min-width: 0;
}

.app-shell-v2 .mqtt-connection-panel .mqtt-form-grid.two .mqtt-field,
.app-shell-v2 .mqtt-connection-panel .mqtt-connection-row .mqtt-field,
.app-shell-v2 .mqtt-connection-panel .mqtt-client-field,
.app-shell-v2 .mqtt-connection-panel .mqtt-credential-row .mqtt-field {
  gap: 4px;
}

.app-shell-v2 .mqtt-connection-panel .mqtt-broker-port-row {
  grid-template-columns: minmax(0, 1fr) 92px;
}

.app-shell-v2 .mqtt-connection-panel .mqtt-broker-field {
  grid-template-columns: max-content minmax(112px, 142px);
}

.app-shell-v2 .mqtt-connection-panel .mqtt-protocol-path-row {
  grid-template-columns: 108px minmax(0, 1fr);
}

.app-shell-v2 .mqtt-connection-panel input:not([type="checkbox"]),
.app-shell-v2 .mqtt-connection-panel select {
  box-sizing: border-box;
  min-height: 30px;
  max-width: 100%;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
}

.app-shell-v2 .mqtt-connection-panel textarea {
  box-sizing: border-box;
  max-width: 100%;
}

.app-shell-v2 .mqtt-connection-panel #mqttHost {
  width: 142px;
  max-width: 100%;
}

.app-shell-v2 .mqtt-connection-panel input:not([type="checkbox"]) {
  padding: 0 10px;
}

.app-shell-v2 .mqtt-connection-panel select {
  padding: 0 22px 0 9px;
}

.app-shell-v2 .mqtt-connection-panel .mqtt-port-field {
  grid-template-columns: max-content 62px;
}

.app-shell-v2 .mqtt-connection-panel #mqttPort {
  width: 62px;
  font-variant-numeric: tabular-nums;
}

.app-shell-v2 .mqtt-connection-panel .mqtt-advanced-row {
  grid-template-columns: minmax(104px, 0.9fr) minmax(132px, 1.1fr);
}

.app-shell-v2 .mqtt-connection-panel .mqtt-reconnect-row {
  grid-template-columns: minmax(88px, 0.8fr) minmax(172px, 1.2fr);
}

.app-shell-v2 .mqtt-connection-panel .mqtt-version-field {
  grid-template-columns: max-content minmax(66px, 1fr);
}

.app-shell-v2 .mqtt-connection-panel .mqtt-timeout-field {
  grid-template-columns: max-content 54px;
}

.app-shell-v2 .mqtt-connection-panel .mqtt-reconnect-period-field {
  grid-template-columns: max-content 66px;
}

.app-shell-v2 .mqtt-connection-panel .mqtt-will-qos-field {
  grid-template-columns: max-content 70px;
}

.app-shell-v2 .mqtt-connection-panel #mqttVersion,
.app-shell-v2 .mqtt-connection-panel #mqttWillQos {
  min-width: 0;
}

.app-shell-v2 .mqtt-connection-panel #mqttConnectTimeout {
  width: 54px;
  font-variant-numeric: tabular-nums;
}

.app-shell-v2 .mqtt-connection-panel #mqttReconnectPeriod {
  width: 66px;
  font-variant-numeric: tabular-nums;
}

.app-shell-v2 .mqtt-connection-panel .connection-icon-btn {
  min-width: 30px;
  min-height: 30px;
}

.app-shell-v2 .mqtt-client-id-control {
  grid-template-columns: minmax(0, 1fr) 30px;
}

.app-shell-v2 .mqtt-client-id-refresh {
  width: 30px;
}

.app-shell-v2 .mqtt-connection-panel .mqtt-check {
  min-height: 30px;
  gap: 6px;
}

.app-shell-v2 .mqtt-connection-panel .mqtt-url-preview {
  min-height: 24px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 650;
}

.app-shell-v2 .mqtt-connection-panel .mqtt-config-section {
  border-radius: 6px;
}

.app-shell-v2 .mqtt-config-section[open] {
  overflow: visible;
}

.app-shell-v2 .mqtt-connection-panel .mqtt-config-section summary {
  min-height: 30px;
  padding: 0 8px;
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
}

.app-shell-v2 .mqtt-connection-panel .mqtt-config-body {
  gap: 6px;
  margin: 0 8px 8px;
  padding-top: 0;
}

.app-shell-v2 .mqtt-connection-panel #mqttWillPayload {
  min-height: 64px;
  padding: 8px 10px;
  font-size: 12px;
}

.app-shell-v2 .mqtt-connection-panel .mqtt-action-row {
  gap: 6px;
}

.app-shell-v2 .mqtt-connection-panel .mqtt-action-row > .btn {
  min-height: 32px;
}

.app-shell-v2 .mqtt-connection-panel .mqtt-note {
  font-size: 11px;
  line-height: 1.45;
}

.app-shell-v2 .mqtt-message-panel {
  container-type: inline-size;
  container-name: mqtt-message-panel;
}

.app-shell-v2 .mqtt-message-panel .mqtt-panel-head {
  display: flex;
  min-height: 44px;
  padding: 10px 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
}

.app-shell-v2 .mqtt-message-panel .section-title {
  font-size: 15px;
}

.app-shell-v2 .mqtt-message-tools {
  width: auto;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-end;
  overflow: visible;
}

.app-shell-v2 .mqtt-message-tools .log-view-toggle,
.app-shell-v2 .mqtt-message-tools .mqtt-message-filter button {
  font-size: 12px;
  font-weight: 600;
  line-height: 15px;
}

.app-shell-v2 .mqtt-message-tools .log-view-controls {
  flex: 0 0 auto;
}

.app-shell-v2 .mqtt-message-tools .btn.icon-btn {
  width: 32px;
  min-height: 30px;
  padding: 0 10px;
  margin-left: 0;
  flex: 0 0 auto;
  font-size: 13px;
}

.app-shell-v2 .mqtt-format-select {
  box-sizing: border-box;
  width: 88px;
  min-height: 30px;
  border-radius: 4px;
  padding: 0 22px 0 10px;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
}

.app-shell-v2 .mqtt-message-filter {
  gap: 1px;
  padding: 0;
}

.app-shell-v2 .mqtt-message-filter button {
  min-width: 32px;
  padding: 0 5px;
}

.app-shell-v2 .mqtt-message-list {
  padding: 8px;
}

.app-shell-v2 .mqtt-system-scope {
  color: var(--muted);
  font-weight: 700;
}

.app-shell-v2 .mqtt-empty {
  min-height: 112px;
}

.app-shell-v2 .mqtt-publish-box {
  gap: 8px;
  padding: 10px 12px 12px;
  overflow: hidden;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-card);
}

.app-shell-v2 .mqtt-form-grid.publish {
  min-height: 32px;
  grid-template-columns: minmax(96px, 1fr) 112px 94px 62px;
  align-items: center;
}

.app-shell-v2 .mqtt-publish-box .mqtt-inline-field {
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px;
}

.app-shell-v2 .mqtt-publish-box .mqtt-field,
.app-shell-v2 .mqtt-publish-box .mqtt-check {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 15px;
}

.app-shell-v2 .mqtt-publish-box .mqtt-check {
  min-height: 30px;
  gap: 6px;
}

.app-shell-v2 .mqtt-publish-box .mqtt-topic-input-wrap input,
.app-shell-v2 .mqtt-publish-box .mqtt-inline-field select {
  box-sizing: border-box;
  min-width: 0;
  min-height: 30px;
  border-radius: 4px;
  padding: 0 22px 0 10px;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
}

.app-shell-v2 .mqtt-publish-box .mqtt-topic-input-wrap input {
  padding-right: 10px;
}

.app-shell-v2 #mqttPayloadFormat {
  width: 76px;
}

.app-shell-v2 #mqttPublishQos {
  width: 58px;
}

.app-shell-v2 #mqttPayload {
  min-height: 58px;
  height: 64px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.45;
}

.app-shell-v2 .mqtt-publish-actions {
  display: grid;
  grid-template-columns: 34px minmax(140px, 1fr) max-content;
  min-height: 34px;
  gap: 8px;
  align-items: center;
  justify-content: stretch;
  min-width: 0;
}

.app-shell-v2 .mqtt-publish-actions .btn.icon-btn {
  width: 34px;
  min-height: 34px;
  min-width: 0;
  padding: 0;
}

.app-shell-v2 .mqtt-publish-action-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: max-content;
}

.app-shell-v2 .mqtt-publish-history-select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  height: 34px;
}

.app-shell-v2 .mqtt-publish-actions .btn.primary {
  width: auto;
  min-width: 92px;
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
  justify-content: center;
}

.app-shell-v2 .mqtt-subscription-list {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  align-content: start;
}

.app-shell-v2 .mqtt-subscription-row {
  border-left: 4px solid var(--mqtt-topic-color, var(--green));
  background: color-mix(in srgb, var(--control-bg) 82%, transparent);
}

.app-shell-v2 .log-search-panel {
  top: 8px;
  right: 8px;
  border-radius: 8px;
  padding: 8px;
}

.app-shell-v2 .log-entry.is-search-match {
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.5), 0 0 0 2px rgba(250, 204, 21, 0.12);
}

.app-shell-v2 .log-entry.is-search-current {
  border-color: rgba(250, 204, 21, 0.85);
}

.app-shell-v2 .favorite-group-dialog {
  border-radius: 10px;
}

@media (max-width: 1180px) and (min-width: 981px) {
  .app-shell-v2 .mqtt-side-panel {
    grid-column: auto;
    min-height: 0;
  }
}

@container mqtt-message-panel (max-width: 620px) {
  .app-shell-v2 .mqtt-message-panel .mqtt-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-shell-v2 .mqtt-message-tools {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .app-shell-v2 .mqtt-message-tools .log-view-controls {
    border-right: 0;
    margin-right: 0;
    padding-right: 0;
  }

  .app-shell-v2 .mqtt-message-tools .btn.icon-btn {
    margin-left: auto;
  }
}

@container mqtt-message-panel (max-width: 430px) {
  .app-shell-v2 .mqtt-publish-actions {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .app-shell-v2 .mqtt-publish-action-group {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .app-shell-v2 .mqtt-publish-actions .btn.primary {
    width: 100%;
  }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app-shell-v2 {
    display: block;
    height: auto;
    min-height: 100vh;
  }

  .app-sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .sidebar-brand {
    grid-column: 1 / -1;
  }

  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
  }

  .sidebar-nav .module-tab {
    flex: 0 0 auto;
  }

  .sidebar-footer {
    display: none;
  }

  .app-main {
    display: block;
  }

  .v2-frame {
    overflow: visible;
  }
}
