/* ============================================================
   SerialWeb · topbar 部件样式（由 style.css 拆分）
   ============================================================ */
.topbar {
      min-height: var(--header-height);
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      gap: 6px 8px;
      padding: 5px 8px;
      align-items: stretch;
      background: var(--bg-elevated);
      border: 1px solid var(--border);
      border-radius: 0 0 calc(var(--radius) + 4px) calc(var(--radius) + 4px);
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
      backdrop-filter: none;
    }
.brand-block, .timeline-block, .corner-block {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
      justify-content: center;
    }
.brand-block {
      display: flex;
      align-items: stretch;
      width: max-content;
      max-width: 100%;
      justify-self: start;
      align-self: center;
    }
.status-pill {
      display: inline-grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      gap: 3px;
      align-items: center;
      min-width: 0;
      width: max-content;
      max-width: 100%;
      border-radius: 14px;
      padding: 0 0 0 8px;
      border: 1px solid var(--border-strong);
      background:
        radial-gradient(circle at 0% 0%, rgba(34, 197, 94, 0.12), transparent 50%),
        rgba(255, 255, 255, 0.22);
      cursor: pointer;
      transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
      justify-self: start;
    }
.status-pill:hover, .status-pill:focus-visible {
      transform: translateY(-1px);
    }
.status-pill:focus-visible {
      outline: none;
      border-color: rgba(86, 114, 205, 0.28);
      box-shadow: 0 0 0 4px rgba(86, 114, 205, 0.1);
    }
.status-pill.is-quick-active {
      background:
        radial-gradient(circle at 0% 0%, rgba(34, 197, 94, 0.14), transparent 50%),
        rgba(186, 194, 204, 0.34);
      border-color: rgba(150, 160, 172, 0.42);
      box-shadow: 0 10px 20px rgba(98, 112, 128, 0.14);
    }
.status-pill.is-quick-active .status-pill-title {
      color: var(--text);
    }
.status-pill.is-quick-active .status-pill-subtitle {
      color: var(--text-soft);
    }
.status-pill-copy {
      min-width: 0;
      display: grid;
      line-height: 1.05;
      align-content: center;
      padding: 0 5px;
    }
.status-pill-title {
      font-size: 16px;
      font-weight: 800;
      letter-spacing: 0.03em;
      line-height: 1;
    }
.status-pill-subtitle {
      font-size: 9px;
      color: var(--text-soft);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
.status-pill:hover .status-pill-subtitle {
      font-size: 0;
    }
.status-pill:hover .status-pill-subtitle::after {
      content: attr(data-hover);
      font-size: 9px;
    }
.logo-mode-switch {
      position: relative;
      width: 80px;
      min-width: 80px;
      max-width: 80px;
      display: grid;
      grid-template-columns: repeat(2, 40px);
      gap: 0;
      padding: 0;
      border-radius: inherit;
      overflow: hidden;
    }
.logo-mode-switch::before {
      content: "";
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      width: 40px;
      border-radius: inherit;
      background: var(--accent);
      border: 1px solid rgba(255,255,255,0.14);
      box-shadow: 0 10px 20px rgba(86, 114, 205, 0.2);
      transition: transform 0.2s ease;
      pointer-events: none;
    }
.logo-mode-btn {
      position: relative;
      z-index: 1;
      width: 40px;
      min-height: 40px;
      padding: 1;
      display: grid;
      grid-template-rows: auto auto;
      gap: 2px;
      place-items: center;
      align-content: center;
      border-radius: inherit;
      color: var(--text-soft);
      transition: color 0.16s ease;
    }
.logo-mode-btn.is-active {
      color: #eef2ff;
    }
#serial-mode-btn .logo-mode-icon, #serial-mode-btn .logo-mode-text {
      transform: translateX(1px);
    }
.logo-mode-icon {
      width: 15px;
      height: 15px;
      display: block;
    }
.logo-mode-icon svg {
      width: 15px;
      height: 15px;
      fill: none;
      stroke: currentColor;
      stroke-width: 1.8;
      stroke-linecap: round;
      stroke-linejoin: round;
      display: block;
    }
.logo-mode-text {
      font-size: 9px;
      font-weight: 700;
      line-height: 1;
    }
.topbar .primary-btn, .topbar .secondary-btn, .topbar .ghost-btn {
      padding: 7px 10px;
      font-size: 11px;
    }
.topbar .icon-btn, .topbar .mini-btn {
      width: 34px;
      min-width: 34px;
      font-size: 12px;
    }
.timeline-combo {
      display: grid;
      gap: 4px;
      padding: 6px 8px;
      border-radius: 18px;
      border: 1px solid var(--border);
      background: var(--bg-panel);
      min-width: 0;
    }
.timeline-select-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 6px;
      align-items: center;
      min-width: 0;
    }
.timeline-summary {
      min-width: 0;
      display: grid;
      gap: 2px;
    }
.timeline-summary-title {
      font-size: 12px;
      font-weight: 800;
      line-height: 1.1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
.timeline-summary-meta {
      font-size: 10px;
      color: var(--text-soft);
      line-height: 1.2;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
.timeline-tool-row {
      display: flex;
      gap: 6px;
      align-items: center;
      flex-wrap: nowrap;
    }
.timeline-picker, .select-wrap {
      position: relative;
      min-width: 180px;
      flex: 0 1 220px;
      display: flex;
      gap: 8px;
      align-items: center;
    }
.timeline-picker select {
      min-width: 180px;
      height: 32px;
      padding: 6px 10px;
      font-size: 11px;
    }
.timeline-picker select, .select-wrap select, select, .field select, .field input, .field textarea, .rule-table input, .rule-table textarea, .queue-table textarea, .queue-table input {
      width: 100%;
      border-radius: 14px;
      border: 1px solid var(--border-strong);
      background: var(--bg-panel-strong);
      color: var(--text);
      padding: 8px 10px;
      font-size: 13px;
      outline: none;
      transition: border-color 0.16s ease, box-shadow 0.16s ease;
    }
select:focus, .field input:not([type="checkbox"]):focus, .field select:focus, .field textarea:focus, .rule-table input:not([type="checkbox"]):focus, .queue-table textarea:focus, .queue-table input:not([type="checkbox"]):focus, .rule-table textarea:focus, #send-input:focus, .timeline-picker select:focus, .select-wrap select:focus {
      border-color: rgba(86, 114, 205, 0.52);
      box-shadow: 0 0 0 4px rgba(86, 114, 205, 0.12);
    }
.menu-anchor {
      position: relative;
    }
.floating-menu {
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      width: 300px;
      background: var(--bg-panel-strong);
      border-radius: 14px;
      border: 1px solid var(--border-strong);
      box-shadow: var(--shadow);
      padding: 8px;
      display: none;
      z-index: 90;
    }
.floating-menu.open {
      display: block;
    }
.floating-menu button:not(.menu-theme-opt), .floating-menu a, .floating-menu .menu-placeholder {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      border-radius: 10px;
      padding: 8px 10px;
      color: var(--text);
      font-size: 12px;
      background: transparent;
      border: 1px solid transparent;
      min-height: 36px;
      transition: background 0.16s ease;
    }
.floating-menu a:hover {
      background: var(--accent-soft);
    }
.floating-menu .menu-static-line {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      border-radius: 10px;
      padding: 8px 10px;
      color: var(--text);
      font-size: 12px;
      min-height: 36px;
      background: transparent;
      border: 1px solid transparent;
      cursor: default;
      user-select: text;
    }
.floating-menu button.version-info-btn {
      justify-content: space-between;
      gap: 8px;
      min-height: 28px;
      cursor: pointer;
      user-select: none;
      background: transparent;
      border: 1px solid transparent;
      transition: background 0.16s ease;
    }
.floating-menu button.version-info-btn:hover, .floating-menu button.version-info-btn:focus-visible {
      background: var(--accent-soft);
    }
.floating-menu .menu-config-line {
      display: flex;
      align-items: center;
      gap: 5px;
      min-height: 34px;
      padding: 5px 6px;
      border-radius: 10px;
      background: rgba(86, 114, 205, 0.06);
    }
.floating-menu .menu-config-label, .floating-menu .menu-config-warning {
      flex: 0 0 auto;
      color: var(--text-soft);
      font-size: 11px;
      font-weight: 700;
      white-space: nowrap;
    }
.floating-menu .menu-config-warning {
      flex: 1 1 auto;
      min-width: 0;
      color: var(--danger);
      overflow: hidden;
      text-overflow: ellipsis;
    }
.floating-menu .menu-config-line button {
      width: auto;
      min-height: 28px;
      flex: 1 1 0;
      justify-content: center;
      padding: 4px 6px;
      border-radius: 8px;
      font-size: 11px;
      white-space: nowrap;
      background: var(--bg-panel-strong);
      border: 1px solid var(--border-strong);
      transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
    }
.floating-menu .menu-config-line button:hover {
      transform: translateY(-1px);
      background: var(--accent-soft);
      border-color: rgba(86, 114, 205, 0.3);
    }
.floating-menu .menu-link-row {
      display: flex;
      gap: 6px;
      margin-top: 2px;
    }
.floating-menu .menu-link-row a {
      flex: 1 1 0;
      min-width: 0;
      justify-content: flex-start;
    }
.floating-menu .menu-link-row a:hover {
      background: var(--accent-soft);
    }
.floating-menu .menu-config-line button.danger-btn {
      flex: 1 1 0;
      background: rgba(194, 65, 12, 0.08);
      border-color: rgba(194, 65, 12, 0.2);
      color: var(--danger);
    }
.floating-menu .menu-config-line button.danger-btn:hover {
      background: rgba(194, 65, 12, 0.14);
      border-color: rgba(194, 65, 12, 0.3);
    }
.floating-menu .menu-theme-line {
      display: flex;
      align-items: center;
      gap: 6px;
      min-height: 34px;
      padding: 5px 6px;
      border-radius: 10px;
      background: rgba(86, 114, 205, 0.06);
      margin-top: 4px;
    }
.floating-menu .menu-theme-label {
      flex: 0 0 auto;
      color: var(--text-soft);
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      white-space: nowrap;
    }
.menu-theme-group {
      position: relative;
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 0;
      flex: 1 1 auto;
      min-width: 0;
      padding: 0;
      border-radius: 10px;
      border: 1px solid var(--border-strong);
      background: var(--bg-panel-strong);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
    }
.menu-theme-group::before {
      content: "";
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      width: calc(33.333%);
      border-radius: 8px;
      background: var(--accent);
      border: 1px solid rgba(255,255,255,0.14);
      box-shadow: 0 10px 20px rgba(86, 114, 205, 0.2);
      transition: transform 0.2s ease;
      pointer-events: none;
    }
.menu-theme-group.pos-light::before {
      transform: translateX(100%);
    }
.menu-theme-group.pos-dark::before {
      transform: translateX(200%);
    }
.menu-theme-opt {
      position: relative;
      z-index: 1;
      min-width: 0;
      min-height: 28px;
      padding: 4px 6px;
      border-radius: 7px;
      border: 1px solid transparent;
      background: transparent;
      color: var(--text);
      font-size: 11px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      cursor: pointer;
      transition: color 0.16s ease;
    }
.menu-theme-opt.is-active {
      color: #eef2ff;
    }
.floating-menu button:not(.menu-theme-opt):hover, .floating-menu button:not(.menu-theme-opt):focus-visible {
      background: var(--accent-soft);
    }
.menu-placeholder {
      opacity: 0.45;
      border: 1px dashed var(--border);
    }
.timeline-mode-row {
      display: grid;
      gap: 4px;
      min-width: 0;
    }
.player-controls {
      display: flex;
      gap: 6px;
      align-items: center;
    }
.player-controls button[disabled], .wide-send-btn[disabled], .primary-btn[disabled], .secondary-btn[disabled], .ghost-btn[disabled], .mini-btn[disabled] {
      opacity: 0.46;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
    }
.timeline-range-wrap {
      position: relative;
      min-height: 22px;
      display: flex;
      align-items: center;
    }
#timeline-slider {
      width: 100%;
      appearance: none;
      height: 20px;
      margin: 0;
      border-radius: 999px;
      background: transparent;
      outline: none;
      cursor: pointer;
      position: relative;
      z-index: 2;
    }
#timeline-slider::-webkit-slider-runnable-track {
      height: 6px;
      border-radius: 999px;
      background: linear-gradient(90deg, rgba(29,122,242,0.12), rgba(14,159,110,0.14));
    }
#timeline-slider::-moz-range-track {
      height: 6px;
      border-radius: 999px;
      background: linear-gradient(90deg, rgba(29,122,242,0.12), rgba(14,159,110,0.14));
    }
#timeline-slider::-webkit-slider-thumb {
      appearance: none;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: #ffffff;
      border: 3px solid var(--signal);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
      margin-top: -6px;
      position: relative;
      z-index: 4;
    }
#timeline-slider::-moz-range-thumb {
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: #ffffff;
      border: 3px solid var(--signal);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
    }
.timeline-progress {
      position: absolute;
      inset: 50% auto auto 0;
      transform: translateY(-50%);
      height: 6px;
      border-radius: 999px;
      background: var(--timeline-fill);
      pointer-events: none;
      width: 0%;
      z-index: 1;
    }
.timeline-inline-meta {
      display: grid;
      grid-template-columns: auto 1fr auto;
      gap: 5px 8px;
      align-items: center;
      font-size: 10px;
      color: var(--text-soft);
      margin-top: -8px;
    }
.timeline-inline-meta .player-controls {
      justify-content: center;
    }
.timeline-live-row {
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
    }
.live-indicator {
      min-width: 110px;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      font-size: 11px;
      font-weight: 700;
      color: var(--accent-strong);
    }
.live-indicator-inline {
      min-width: 0;
      justify-content: flex-start;
      gap: 8px;
      font-size: 10px;
    }
.live-bar {
      position: relative;
      width: 72px;
      height: 8px;
      border-radius: 999px;
      overflow: hidden;
      background: rgba(86, 114, 205, 0.14);
    }
.live-indicator-inline .live-bar {
      width: 100%;
      min-width: 110px;
    }
.live-bar::before {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(90deg, transparent, rgba(86, 114, 205, 0.82), transparent);
      animation: liveSweep 1.2s linear infinite;
    }
.corner-block {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      min-height: 40px;
    }
.topbar {
      position: sticky;
      z-index: 60;
      top: 0;
      min-height: 52px;
      padding: 4px 8px;
      gap: 6px 8px;
      overflow: visible;
      grid-template-columns: auto minmax(0, 1fr) auto;
      align-items: center;
      isolation: isolate;
    }
.topbar > * {
      min-width: 0;
    }
.brand-block {
      display: flex;
      align-items: stretch;
      min-height: 40px;
    }
.timeline-block {
      display: flex;
      align-items: center;
      justify-content: center;
      min-width: 0;
    }
.timeline-controls-wrap {
      width: 100%;
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 8px;
    }
.timeline-ribbon-shell {
      position: relative;
      flex: 1 1 auto;
      min-width: 0;
      min-height: 40px;
      padding: 6px 8px 5px 7px;
      border-radius: 16px;
      border: 1px solid var(--border);
      background: var(--bg-panel);
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) min-content;
      gap: 3px;
      align-items: center;
      overflow: visible;
      white-space: nowrap;
      cursor: pointer;
      transition: transform 0.16s ease;
    }
.timeline-ribbon-shell:hover {
      transform: translateY(-1px);
    }
.record-toggle-btn {
      width: 42px;
      min-width: 42px;
      height: 28px;
      border-radius: 10px;
      border: 1px solid var(--border-strong);
      background: rgba(18, 28, 37, 0.12);
      color: var(--accent-strong);
      font-weight: 800;
      font-size: 11px;
      display: inline-grid;
      place-items: center;
      flex: 0 0 auto;
      padding: 0;
    }
.record-toggle-btn.is-recording, .record-toggle-btn.is-playback {
      font-size: 0;
    }
.record-toggle-btn.is-recording {
      color: #fff;
      background: linear-gradient(135deg, #ef4444, #b91c1c);
      box-shadow: 0 10px 20px rgba(185, 28, 28, 0.25);
    }
.record-toggle-btn.is-recording::before {
      content: "";
      width: 10px;
      height: 10px;
      display: block;
      border-radius: 2px;
      background: currentColor;
    }
.record-toggle-btn.is-playback {
      background: rgba(86, 114, 205, 0.1);
      color: var(--accent-strong);
    }
.record-toggle-btn.is-playback::before {
      content: "";
      display: block;
      width: 0;
      height: 0;
      margin-left: 2px;
      border-style: solid;
      border-width: 6px 0 6px 10px;
      border-color: transparent transparent transparent currentColor;
    }
.record-toggle-btn.is-playback.is-playing::before {
      width: 10px;
      height: 10px;
      margin-left: 0;
      border: 0;
      background: linear-gradient(
        90deg,
        currentColor 0 36%,
        transparent 36% 64%,
        currentColor 64% 100%
      );
    }
.record-toggle-btn.is-detached {
      position: relative;
      font-size: 0;
      color: #c96a0a;
      background:
        radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.28), transparent 42%),
        rgba(245, 158, 11, 0.16);
      border-color: rgba(245, 158, 11, 0.4);
      box-shadow: 0 10px 20px rgba(217, 119, 6, 0.14);
    }
.record-toggle-btn.is-detached::before {
      content: "";
      position: absolute;
      top: 50%;
      left: 50%;
      display: block;
      width: 16px;
      height: 16px;
      background: currentColor;
      -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M9 15l3 -3m2 -2l1 -1'/%3E%3Cpath d='M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464'/%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463'/%3E%3C/svg%3E") no-repeat center / contain;
      mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M9 15l3 -3m2 -2l1 -1'/%3E%3Cpath d='M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464'/%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463'/%3E%3C/svg%3E") no-repeat center / contain;
      border: 0;
      transform: translate(-50%, -50%);
      box-sizing: border-box;
    }
.timeline-bar-wrap {
      min-width: 0;
      display: grid;
      gap: 6px;
      align-content: center;
    }
.timeline-track-box {
      position: relative;
      min-width: 0;
      height: 20px;
      overflow: visible;
      cursor: default;
    }
.timeline-live-indicator, .timeline-history-strip {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      min-width: 0;
      overflow: visible;
    }
.timeline-live-indicator {
      z-index: 1;
    }
.timeline-live-bar {
      width: 100%;
      height: 6px;
      border-radius: 999px;
      overflow: hidden;
      background: rgba(86, 114, 205, 0.14);
      position: relative;
    }
.timeline-live-bar::before {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(90deg, transparent, rgba(86, 114, 205, 0.82), transparent);
      animation: liveSweep 1.1s linear infinite;
    }
.timeline-ribbon-shell:hover .timeline-freeze-hub, .timeline-freeze-hub:hover, .timeline-ribbon-shell.is-live-frozen .timeline-freeze-hub {
      opacity: 1;
      pointer-events: auto;
    }
.timeline-freeze-hub {
      position: absolute;
      inset: 0 auto 0 50%;
      width: 56px;
      transform: translateX(-50%);
      z-index: 4;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.16s ease;
      display: flex;
      align-items: center;
      justify-content: center;
    }
.timeline-ribbon-shell:not(.is-freeze-available) .timeline-freeze-hub {
      opacity: 0 !important;
      pointer-events: none !important;
    }
.timeline-freeze-btn {
      position: relative;
      width: 28px;
      min-width: 28px;
      height: 28px;
      border-radius: 10px;
      border: 1px solid rgba(86, 114, 205, 0.30);
      background:
        linear-gradient(180deg, rgba(255,255,255,0.82), rgba(255,255,255,0.50));
      color: var(--signal);
      display: inline-grid;
      place-items: center;
      padding: 0;
      box-shadow: 0 10px 18px rgba(15, 23, 42, 0.10);
      cursor: pointer;
      transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
      z-index: 1;
    }
.timeline-freeze-btn:hover, .timeline-freeze-btn:focus-visible {
      transform: translateY(-1px);
      border-color: rgba(86, 114, 205, 0.40);
      background:
        linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.60));
      outline: none;
    }
.timeline-freeze-btn svg {
      width: 14px;
      height: 14px;
      display: block;
      stroke: currentColor;
      stroke-width: 1.9;
      fill: none;
      stroke-linecap: round;
      stroke-linejoin: round;
      pointer-events: none;
    }
.timeline-freeze-btn svg * {
      pointer-events: none;
    }
.timeline-ribbon-shell.is-live-frozen .timeline-live-bar {
      background: var(--signal);
      animation: reconnectRibbonPulse 1.2s ease-in-out infinite;
    }
.timeline-ribbon-shell.is-live-frozen .timeline-live-bar::before {
      display: none;
    }
.timeline-ribbon-shell.is-live-frozen .timeline-freeze-btn {
      color: #3730a3;
      border-color: var(--accent);
      background: var(--accent-soft);
    }
.timeline-ribbon-shell.is-recording .timeline-live-bar {
      background: rgba(248, 113, 113, 0.18);
    }
.timeline-ribbon-shell.is-recording .timeline-live-bar::before {
      background: linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.92), transparent);
    }
.timeline-ribbon-shell.is-serial-offline .timeline-live-bar {
      background: rgba(245, 158, 11, 0.78);
    }
.timeline-ribbon-shell.is-serial-offline .timeline-live-bar::before {
      display: none;
    }
.timeline-ribbon-shell.is-serial-waiting .timeline-live-bar {
      background: linear-gradient(90deg, rgba(245, 158, 11, 0.5), rgba(245, 158, 11, 0.86), rgba(245, 158, 11, 0.5));
      animation: reconnectRibbonPulse 0.58s ease-in-out infinite;
    }
.timeline-ribbon-shell.is-serial-waiting .timeline-live-bar::before {
      display: none;
    }
.timeline-history-strip {
      display: flex;
      align-items: center;
      height: 20px;
      z-index: 2;
    }
.timeline-history-strip .timeline-progress {
      position: absolute;
      inset: 50% auto auto 0;
      transform: translateY(-50%);
    }
.timeline-inline-meta {
      min-width: 0;
      font-size: 9px;
      color: var(--text-soft);
      line-height: 1.1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
.topbar .timeline-picker-btn {
      width: 8px;
      height: 18px;
      min-width: 8px;
      border: 0;
      background: transparent;
      font-size: 12px;
      line-height: 1;
      padding: 0;
      opacity: 0.8;
      justify-self: end;
      border-radius: 0;
      box-shadow: none;
    }
.timeline-picker-panel {
      position: absolute;
      inset: calc(100% + 8px) 0 auto auto;
      display: none;
      width: max(100%, min(360px, calc(100vw - 36px)));
      max-width: calc(100vw - 36px);
      --timeline-picker-row-h: 50px;
      gap: 6px;
      padding: 8px;
      border-radius: 16px;
      border: 1px solid var(--border);
      background: var(--bg-panel-strong);
      box-shadow: var(--shadow);
      z-index: 95;
    }
.timeline-ribbon-shell.picker-open .timeline-picker-panel {
      display: grid;
    }
.timeline-pick-row {
      display: grid;
      gap: 6px;
      position: relative;
    }
.timeline-pick-main {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 76px 76px;
      gap: 6px;
      align-items: stretch;
      min-height: var(--timeline-picker-row-h);
    }
.timeline-pick-item {
      width: 100%;
      min-width: 0;
      min-height: var(--timeline-picker-row-h);
      display: grid;
      grid-template-rows: minmax(0, auto) minmax(0, auto);
      gap: 3px;
      align-content: center;
      text-align: left;
      border-radius: 12px;
      padding: 8px 11px 9px;
      border: 1px solid transparent;
      background: rgba(86, 114, 205, 0.05);
    }
.timeline-pick-item:hover {
      border-color: rgba(86, 114, 205, 0.14);
      background: rgba(86, 114, 205, 0.08);
    }
.timeline-pick-item.active {
      border-color: rgba(86, 114, 205, 0.24);
      background: rgba(86, 114, 205, 0.12);
    }
.timeline-pick-name {
      font-size: 11px;
      font-weight: 700;
      line-height: 1.18;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
.timeline-pick-meta {
      font-size: 10px;
      color: var(--text-soft);
      line-height: 1.16;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
.timeline-export-btn {
      width: 76px;
      min-width: 76px;
      height: var(--timeline-picker-row-h);
      min-height: var(--timeline-picker-row-h);
      align-self: stretch;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      gap: 4px;
      padding: 5px 2px;
      border-radius: 12px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.52);
      color: var(--text-main);
      box-shadow: var(--shadow-soft);
    }
.timeline-export-btn.analysis {
      border-color: var(--border);
      background: rgba(255,255,255,0.52);
    }
.timeline-export-btn .timeline-export-icon {
      width: 16px;
      height: 16px;
      display: block;
      stroke: currentColor;
      flex: 0 0 auto;
    }
.timeline-export-btn .timeline-export-label {
      display: block;
      font-size: 9px;
      line-height: 1.1;
      letter-spacing: 0;
      white-space: nowrap;
      text-align: center;
      width: 100%;
      color: currentColor;
      flex: 0 0 auto;
    }
.timeline-export-btn:hover, .timeline-export-btn.active {
      border-color: rgba(86, 114, 205, 0.18);
      background: rgba(86, 114, 205, 0.08);
      box-shadow: var(--shadow-soft);
    }
.timeline-export-btn.analysis:hover, .timeline-export-btn.analysis.active {
      border-color: rgba(86, 114, 205, 0.18);
      background: rgba(86, 114, 205, 0.08);
      box-shadow: var(--shadow-soft);
    }
.timeline-export-menu {
      position: absolute;
      right: 0;
      top: calc(100% + 6px);
      display: none;
      gap: 6px;
      padding: 6px;
      border-radius: 12px;
      border: 1px solid var(--border);
      background: var(--bg-panel-strong);
      box-shadow: var(--shadow);
      z-index: 3;
      min-width: 0;
      justify-content: center;
      justify-items: stretch;
    }
.timeline-export-menu.timeline-data-menu {
      grid-template-columns: repeat(3, minmax(54px, 1fr));
    }
.timeline-export-menu.timeline-analysis-menu {
      grid-template-columns: repeat(2, minmax(54px, 1fr));
    }
.timeline-pick-row.timeline-export-open .timeline-export-menu.timeline-data-menu, .timeline-pick-row.analysis-export-open .timeline-export-menu.timeline-analysis-menu {
      display: grid;
    }
.timeline-export-option {
      width: 100%;
      min-height: 26px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.52);
      color: var(--text-main);
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.04em;
      padding: 0 10px;
      text-align: center;
    }
.timeline-import-item {
      width: 100%;
      height: var(--timeline-picker-row-h);
      min-height: var(--timeline-picker-row-h);
      margin-top: 2px;
      border-radius: 12px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.52);
      color: var(--text-main);
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.04em;
      padding: 9px 11px;
      display: grid;
      grid-template-rows: auto auto;
      gap: 2px;
      text-align: left;
    }
.record-toggle-btn.is-recording::before {
      content: "";
      width: 10px;
      height: 10px;
      display: block;
      border-radius: 2px;
      background: currentColor;
    }
.timeline-live-row, .timeline-mode-row, .timeline-select-row, .timeline-summary, .timeline-tool-row, .timeline-combo {
      display: none;
    }
.mode-switch-group {
      position: relative;
      flex: 1 1 auto;
      min-width: 0;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0;
      padding: 0;
      border-radius: 18px;
      border: 1px solid var(--border-strong);
      background: var(--bg-panel-strong);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
    }
.mode-switch-group::before {
      content: "";
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      width: calc(50%);
      border-radius: 14px;
      background: var(--accent);
      border: 1px solid rgba(255,255,255,0.14);
      box-shadow: 0 10px 20px rgba(86, 114, 205, 0.2);
      transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
      pointer-events: none;
    }
.mode-switch-group.parser-active::before {
      transform: translateX(100%);
    }
.mode-tabs.mode-switch-group {
      min-width: 160px;
      max-width: 200px;
    }
.mode-tabs.mode-switch-group::before {
      top: 0;
      bottom: 0;
      left: 0;
      right: auto;
      width: calc(50%);
      border-radius: 12px;
      background: var(--accent);
      transition: left 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    }
.mode-tabs.mode-switch-group.parser-active::before {
      left: calc(50%);
      transform: none;
    }
.send-mode-switch {
      min-height: 24px;
      width: 100%;
      padding: 0;
      border: none;
      background: none;
      color: inherit;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 5px;
      text-align: left;
      font-size: 12px;
      font-weight: 700;
      min-width: 0;
    }
.send-mode-switch::after {
      content: "▾";
      font-size: 11px;
      color: var(--text-soft);
      transition: transform 0.16s ease;
      flex: none;
    }
.send-mode-tile.is-open .send-mode-switch::after {
      transform: rotate(180deg);
    }
.send-mode-switch span {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
