/* ---- Timeline help modal ---- */
.help-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(8, 8, 18, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.help-modal-backdrop.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.help-modal {
  width: min(400px, 100%);
  max-height: min(72vh, 520px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}

.help-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}

.help-modal-header h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

.help-modal-close {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-toolbar);
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.help-modal-close:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

.help-modal-body {
  padding: 16px 18px 20px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-dim);
}

.help-modal-body p {
  margin-bottom: 12px;
}

.help-modal-list {
  margin: 0 0 0 2px;
  padding-left: 1.15em;
  color: var(--text-dim);
}

.help-modal-list li {
  margin-bottom: 0.7em;
  padding-left: 2px;
}

.help-modal-list li:last-child {
  margin-bottom: 0;
}

.help-modal-list li::marker {
  color: var(--text-muted);
}

.help-modal-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-dim);
}

.help-modal-foot code {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-toolbar);
  color: var(--text);
}

.timeline-no-data-banner {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  font-size: 10px;
  color: var(--text-dim);
  pointer-events: none;
  z-index: 1;
  line-height: 1.45;
  padding: 0 8px;
}

.timeline-no-data-banner .timeline-no-data-action {
  pointer-events: auto;
  margin: 0 2px;
  padding: 2px 8px;
  font-size: 10px;
  border-radius: 6px;
  border: 1px solid rgba(0, 184, 148, 0.35);
  background: rgba(0, 184, 148, 0.12);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.timeline-no-data-banner .timeline-no-data-action:hover {
  background: rgba(0, 184, 148, 0.22);
  border-color: rgba(0, 184, 148, 0.5);
}

.timeline-coach-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  font-size: var(--font-body);
  color: var(--text-dim);
  line-height: 1.45;
}

.timeline-coach-banner.visible {
  display: flex;
}

.timeline-coach-banner-text {
  flex: 1;
  min-width: 0;
}

.timeline-coach-dismiss {
  flex-shrink: 0;
  padding: 5px 12px;
  font-size: var(--font-label);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.timeline-coach-dismiss:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-strong);
}

.help-modal-section {
  margin-bottom: 16px;
}

.help-modal-section h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.help-modal-section:last-child {
  margin-bottom: 0;
}

/* ---- Warning Toast ---- */
.warning-toast {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #261818;
  border: 1px solid rgba(232, 93, 76, 0.55);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  z-index: 250;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-elevated);
}

.warning-toast.visible {
  display: block;
}

.warning-toast.toast-info {
  background: #16221f;
  border-color: var(--accent);
}

.warning-toast.toast-info .warning-toast-title {
  color: var(--accent);
}

.warning-toast.toast-info .warning-toast-close {
  border-color: rgba(0, 184, 148, 0.45);
  color: var(--accent);
}

.warning-toast.toast-info .warning-toast-close:hover {
  background: var(--accent);
  color: #0a0a12;
}

.warning-toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.warning-toast-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--danger);
}

.warning-toast-close {
  width: 24px;
  height: 24px;
  background: transparent;
  border: 1px solid rgba(231, 76, 60, 0.4);
  border-radius: 4px;
  color: var(--danger);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.warning-toast-close:hover {
  background: var(--danger);
  color: #fff;
}

.warning-toast-body {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.warning-toast.toast-download {
  background: linear-gradient(165deg, #152a26 0%, #131820 55%, #0f141c 100%);
  border: 1px solid rgba(30, 220, 180, 0.4);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.25) inset,
    0 16px 48px rgba(0, 0, 0, 0.5),
    0 0 32px rgba(20, 200, 160, 0.08);
}

.warning-toast.toast-download .warning-toast-header {
  justify-content: center;
  margin-bottom: 6px;
}

.warning-toast.toast-download .warning-toast-title {
  color: #b8f5e8;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.warning-toast.toast-download .warning-toast-close {
  display: none;
}

.warning-toast.toast-download .warning-toast-body {
  text-align: center;
  color: #c8c8d8;
  font-size: 14px;
  line-height: 1.55;
}

.download-dialog {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, 92%);
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  z-index: 140;
  padding: 14px;
}

.download-dialog.visible {
  display: block;
}

#goto-time-dialog {
  z-index: 150;
}

.goto-time-panel.download-dialog {
  width: min(300px, 92vw);
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(18, 201, 160, 0.25);
  background: linear-gradient(165deg, #1a2232 0%, var(--bg-toolbar) 100%);
  box-shadow:
    var(--shadow-modal),
    0 0 24px rgba(18, 201, 160, 0.08);
}

.goto-time-panel-header {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.goto-time-panel-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.goto-time-panel-fields--compact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 10px 14px 6px;
}

.goto-time-field--time-row {
  min-width: 0;
}

.goto-time-tz-label {
  font-weight: 400;
  color: var(--text-dim);
  font-size: 0.85em;
}

.goto-time-hm {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
}

.goto-time-hm input {
  width: 2.75em;
  min-width: 0;
  height: 34px;
  padding: 0 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  letter-spacing: 0.04em;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.goto-time-hm input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
  opacity: 0.65;
}

.goto-time-hm input:hover {
  border-color: var(--border-strong);
}

.goto-time-hm input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.goto-time-hm span {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dim);
  line-height: 1;
  user-select: none;
}

.goto-time-error {
  display: none;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #ffb4b4;
  background: rgba(220, 53, 69, 0.12);
  border: 1px solid rgba(220, 53, 69, 0.35);
}

.goto-time-error.visible {
  display: block;
}

.goto-time-digital {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border-subtle);
}

.goto-time-seg {
  font: inherit;
  font-size: 32px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  min-width: 2.4ch;
  padding: 4px 6px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}

.goto-time-seg:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.goto-time-seg--active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 1px var(--border-strong) inset;
}

.goto-time-seg-input {
  width: 2.6ch;
  font: inherit;
  font-size: 32px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  padding: 4px 2px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  box-shadow: var(--focus-ring);
}

.goto-time-colon {
  font-size: 28px;
  font-weight: 300;
  color: var(--text-dim);
  user-select: none;
  line-height: 1;
  margin: 0 2px;
}

.goto-time-hint {
  margin: 8px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
}

.goto-time-dial-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
  touch-action: none;
}

.goto-time-dial {
  width: min(220px, 72vw);
  height: auto;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.goto-time-dial-face {
  fill: rgba(0, 0, 0, 0.22);
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.goto-time-dial-tick {
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.goto-time-dial-tick--major {
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 2;
}

.goto-time-dial-num {
  fill: var(--text-dim);
  font-size: 11px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.goto-time-dial-hand {
  stroke: #a8b0c0;
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.goto-time-dial-dot {
  fill: #c0c8d4;
  pointer-events: none;
}

.goto-time-dial-hub {
  fill: #1a1a22;
  stroke: var(--border-strong);
  stroke-width: 1.5;
  pointer-events: none;
}

@media (max-width: 420px) {
  .goto-time-panel-fields {
    grid-template-columns: 1fr;
  }

  .goto-time-seg {
    font-size: 28px;
  }

  .goto-time-seg-input {
    font-size: 28px;
  }
}

.goto-time-field label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.goto-time-field input {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.goto-time-field input:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.goto-time-field input:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: var(--focus-ring);
}

.goto-time-panel-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 12px;
  margin-top: 0;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.12);
}

.goto-time-btn {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform 0.1s;
}

.goto-time-btn:active {
  transform: scale(0.98);
}

.goto-time-btn--ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
}

.goto-time-btn--ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.goto-time-btn--primary {
  border: 1px solid var(--accent);
  background: linear-gradient(180deg, var(--accent-hover) 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 0 12px var(--accent-glow);
}

.goto-time-btn--primary:hover {
  filter: brightness(1.06);
  border-color: var(--accent-hover);
}

.pb-icon-btn {
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--transition-ui), border-color var(--transition-ui), background var(--transition-ui), box-shadow var(--transition-ui), transform 0.1s;
}

.pb-icon-btn:not(.pb-icon-btn--labeled) {
  width: 32px;
  height: 32px;
}

.pb-icon-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.pb-icon-btn:hover:not(.pb-icon-btn--nav) {
  color: var(--text);
  border-color: var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
}

.pb-icon-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.download-dialog-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.download-dialog-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.download-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.download-field label {
  font-size: 11px;
  color: var(--text-dim);
}

.download-grid input {
  width: 100%;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  height: 32px;
  padding: 0 8px;
  font-family: inherit;
  font-size: 12px;
}

.download-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---- Storage info ---- */
.storage-info {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
  flex: 0 1 auto;
  min-width: 0;
}

.storage-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  height: var(--topbar-pill-h, 28px);
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#retention-details {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.bandwidth-badge {
  gap: 6px;
}

.bandwidth-badge .bandwidth-label {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 400;
}

.bandwidth-badge .bandwidth-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.storage-disk-chip {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 220px;
  height: var(--topbar-pill-h, 28px);
  box-sizing: border-box;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.storage-disk-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.storage-disk-bar-track {
  flex: 1;
  min-width: 28px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.storage-disk-bar {
  display: block;
  height: 100%;
  width: 100%;
}

.storage-disk-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5a6a7a 0%, #6a7a8a 100%);
  min-width: 0;
}

.storage-disk-figures {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.storage-disk-used {
  color: var(--text);
  font-weight: 600;
}

.storage-disk-sep {
  opacity: 0.5;
  margin: 0 1px;
}

.storage-disk-total {
  color: var(--text-dim);
}

.storage-disk-unit {
  margin-left: 2px;
  font-size: 10px;
  opacity: 0.85;
}
