:root {
  --row-height: 44px;
  --day-card-width: 185px;
  --wreck-name-width: 200px;
}

.dive-planner-panel {
  display: none;
  position: absolute;
  top: 74px;
  right: 20px;
  width: min(880px, 92vw);
  max-width: 95vw;
  min-width: 380px;
  height: min(600px, calc(100vh - 90px));
  height: min(600px, calc(100dvh - 90px));
  min-height: 280px;
  max-height: calc(100vh - 80px);
  max-height: calc(100dvh - 80px);
  resize: none;
  overflow: hidden;
  background: var(--bg-surface, #1e293b);
  color: var(--text-main, #f8fafc);
  flex-direction: column;
  border: 1px solid var(--border-subtle, #334155);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
  z-index: 1040;
}
.dive-planner-panel.active-page {
  display: flex;
}

[data-theme="light"] .dive-planner-panel {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

.dp-compare-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark, #0f172a);
  overflow: hidden;
}

[data-theme="light"] .dp-compare-section {
  background: #f8fafc;
}

#dp-compareArea {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
  position: relative;
}

/* === DIVE PLANNER 8-POINT WINDOW RESIZING HANDLES === */
.dp-resizer-edge,
.dp-resizer-corner {
  position: absolute;
  z-index: 60;
  touch-action: none;
  user-select: none;
}

/* Edges */
.dp-resizer-edge.dp-edge-t {
  top: -4px;
  left: 10px;
  right: 10px;
  height: 8px;
  cursor: ns-resize;
}
.dp-resizer-edge.dp-edge-b {
  bottom: -4px;
  left: 10px;
  right: 10px;
  height: 8px;
  cursor: ns-resize;
}
.dp-resizer-edge.dp-edge-l {
  left: -4px;
  top: 10px;
  bottom: 10px;
  width: 8px;
  cursor: ew-resize;
}
.dp-resizer-edge.dp-edge-r {
  right: -4px;
  top: 10px;
  bottom: 10px;
  width: 8px;
  cursor: ew-resize;
}

/* Corners */
.dp-resizer-corner.dp-corner-tl {
  top: -4px;
  left: -4px;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
}
.dp-resizer-corner.dp-corner-tr {
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  cursor: nesw-resize;
}
.dp-resizer-corner.dp-corner-bl {
  bottom: -4px;
  left: -4px;
  width: 14px;
  height: 14px;
  cursor: nesw-resize;
}
.dp-resizer-corner.dp-corner-br {
  bottom: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
}

/* Subtle corner grip styling on bottom-right corner */
.dp-resizer-corner.dp-corner-br::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 7px;
  height: 7px;
  border-right: 2px solid rgba(148, 163, 184, 0.5);
  border-bottom: 2px solid rgba(148, 163, 184, 0.5);
  border-radius: 1px;
  pointer-events: none;
}

body.resizing-panel {
  user-select: none !important;
}

/* === DIVE PLANNER ZOOM & FIT-TO-PANEL ENGINE === */
.dp-header-zoom-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dp-zoom-action-btn {
  padding: 3px 8px;
  font-size: 11px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
}

.dp-zoom-action-btn.active {
  background: var(--accent-cyan, #0ea5e9) !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
}

.dp-zoom-stepper {
  display: inline-flex;
  align-items: center;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 4px;
  height: 26px;
  user-select: none;
}

.dp-zoom-btn,
.dp-zoom-val-btn {
  transition: background 0.12s ease;
}

.dp-zoom-btn:hover {
  background: rgba(148, 163, 184, 0.25);
}

.dp-zoom-val-btn:hover {
  background: rgba(148, 163, 184, 0.2);
}

.dp-panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  cursor: move;
}

.dp-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
  cursor: pointer;
  flex-wrap: wrap;
}

.dp-header-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-right: 2px;
}

.dp-header-brand-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.dp-header-brand-icon svg {
  width: 18px;
  height: 18px;
}

.dp-header-brand-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(90deg, #0f172a, #0077b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .dp-header-brand-title {
  background: linear-gradient(90deg, #ffffff, #90e0ef);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dp-header-site-select {
  width: auto;
  max-width: 175px;
  height: 26px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
}

.dp-header-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.dp-close-btn {
  flex-shrink: 0;
  margin-left: auto;
}

.dp-outputs-dropdown {
  position: relative;
  display: inline-flex;
}

.dp-outputs-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 175px;
  background: var(--bg-surface, #1e293b);
  border: 1px solid var(--border-subtle, #334155);
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  padding: 4px;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dp-outputs-menu.hidden {
  display: none;
}

[data-theme="light"] .dp-outputs-menu {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.16);
}

.dp-outputs-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  background: transparent;
  color: var(--text-main, #f8fafc);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.dp-outputs-item:hover:not(:disabled) {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
}

[data-theme="light"] .dp-outputs-item {
  color: #0f172a;
}

[data-theme="light"] .dp-outputs-item:hover:not(:disabled) {
  background: #f1f5f9;
  color: #0284c7;
}

.dp-outputs-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dp-trip-range-select {
  display: none;
  width: auto;
  max-width: 160px;
  height: 24px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
}

@media (max-width: 768px) {
  .dp-trip-duration-pills {
    display: none !important;
  }
  .dp-trip-range-select {
    display: inline-block;
  }
  .dp-zoom-action-btn span {
    display: none;
  }
  .dp-header-controls {
    gap: 4px;
  }
}

.dp-table-container {
  overflow: auto;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  touch-action: pan-x pan-y pinch-zoom;
}

.dp-table-container > table {
  zoom: var(--dp-zoom-scale, 1);
  transform-origin: top left;
}

/* === TWO-STAGE FIT: STAGE 1 GAP & WHITESPACE COMPACTION === */
/* Squeeze empty padding, date column overhead, and pill bar gaps BEFORE reducing font scale */
.dive-planner-panel.is-fit-mode .dp-col-table {
  width: 100% !important;
  min-width: calc(92px + var(--dp-num-cols, 1) * 106px) !important;
  max-width: calc(92px + var(--dp-num-cols, 1) * 220px) !important;
  --dp-col-width: auto !important;
  --dp-col-min-width: 106px !important;
  --dp-col-max-width: 220px !important;
}

.dive-planner-panel.is-fit-mode .dp-col-date-cell {
  width: 92px !important;
  min-width: 92px !important;
  max-width: 92px !important;
  padding: 4px 5px !important;
}

.dive-planner-panel.is-fit-mode .dp-col-table th.dp-col-header {
  padding: 4px 3px !important;
}

.dive-planner-panel.is-fit-mode .dp-col-table td.dp-col-data-cell {
  padding: 3px 3px !important;
}

.dive-planner-panel.is-fit-mode .dp-cell-pill-stack {
  gap: 2.5px !important;
}

.dive-planner-panel.is-fit-mode .dp-row-table {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: calc(var(--dp-sticky-cols-width, 136px) + var(--dp-num-cols, 1) * 106px) !important;
  max-width: calc(var(--dp-sticky-cols-width, 136px) + var(--dp-num-cols, 1) * 220px) !important;
  --dp-row-wreck-width: 136px !important;
  --dp-row-shift-width: 90px !important;
}

.dive-planner-panel.is-fit-mode .dp-row-wreck-th,
.dive-planner-panel.is-fit-mode .dp-row-wreck-td {
  padding: 4px 6px !important;
}

.dive-planner-panel.is-fit-mode .dp-row-name {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  white-space: normal !important;
  word-break: break-word !important;
  line-height: 1.15 !important;
  font-size: 0.78rem !important;
}

.dive-planner-panel.is-fit-mode .dp-row-date-th {
  width: auto !important;
  min-width: 80px !important;
  max-width: 220px !important;
  padding: 4px 4px !important;
}

.dive-planner-panel.is-fit-mode .dp-row-data-cell {
  width: auto !important;
  min-width: 80px !important;
  max-width: 220px !important;
  padding: 3px 3px !important;
}

/* === HORIZONTAL SCROLL AFFORDANCE & FREEZE-PANE ELEVATION === */
.dp-table-container.is-scrolled-x .dp-col-table th:first-child,
.dp-table-container.is-scrolled-x .dp-col-table td:first-child,
.dp-table-container.is-scrolled-x .dp-row-table .dp-row-shift-th,
.dp-table-container.is-scrolled-x .dp-row-table .dp-row-shift-td,
.dp-table-container.is-scrolled-x .dp-row-table:not(:has(.dp-row-shift-th)) .dp-row-wreck-th,
.dp-table-container.is-scrolled-x .dp-row-table:not(:has(.dp-row-shift-td)) .dp-row-wreck-td {
  box-shadow: 5px 0 12px -2px rgba(0, 0, 0, 0.45) !important;
}

[data-theme="light"] .dp-table-container.is-scrolled-x .dp-col-table th:first-child,
[data-theme="light"] .dp-table-container.is-scrolled-x .dp-col-table td:first-child,
[data-theme="light"] .dp-table-container.is-scrolled-x .dp-row-table .dp-row-shift-th,
[data-theme="light"] .dp-table-container.is-scrolled-x .dp-row-table .dp-row-shift-td,
[data-theme="light"] .dp-table-container.is-scrolled-x .dp-row-table:not(:has(.dp-row-shift-th)) .dp-row-wreck-th,
[data-theme="light"] .dp-table-container.is-scrolled-x .dp-row-table:not(:has(.dp-row-shift-td)) .dp-row-wreck-td {
  box-shadow: 5px 0 12px -2px rgba(15, 23, 42, 0.18) !important;
}

.dp-scroll-fade-right {
  position: absolute;
  top: 0;
  right: 0;
  width: 34px;
  height: 100%;
  pointer-events: none;
  z-index: 28;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: linear-gradient(to left, rgba(15, 23, 42, 0.62) 0%, rgba(15, 23, 42, 0.22) 55%, transparent 100%);
}

[data-theme="light"] .dp-scroll-fade-right {
  background: linear-gradient(to left, rgba(15, 23, 42, 0.18) 0%, rgba(15, 23, 42, 0.06) 55%, transparent 100%);
}

.dp-scroll-fade-right.is-visible {
  opacity: 1;
}

.dp-scroll-affordance-pill {
  position: absolute;
  bottom: 14px;
  right: 16px;
  z-index: 32;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  color: #f8fafc;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  backdrop-filter: blur(6px);
  user-select: none;
}

[data-theme="light"] .dp-scroll-affordance-pill {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(2, 132, 199, 0.35);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.15);
  color: #0f172a;
}

.dp-scroll-status-label {
  padding: 0 4px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dive-planner-panel .dp-scroll-step-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(51, 65, 85, 0.65);
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}

[data-theme="light"] .dive-planner-panel .dp-scroll-step-btn {
  background: rgba(226, 232, 240, 0.85);
  border-color: rgba(100, 116, 139, 0.3);
}

.dive-planner-panel .dp-scroll-step-btn:hover:not(:disabled) {
  background: var(--accent-cyan, #0ea5e9);
  border-color: var(--accent-cyan, #0ea5e9);
  color: #ffffff;
}

.dive-planner-panel .dp-scroll-step-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* === ROW MODE WORKING WINDOW & PERIOD PAGING BAR === */
.dp-row-window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 6px 12px;
  background: var(--bg-surface, #1e293b);
  border-bottom: 1px solid var(--border-subtle, #334155);
  font-size: 11.5px;
  color: var(--text-main, #f8fafc);
  flex-shrink: 0;
}

[data-theme="light"] .dp-row-window-bar {
  background: #f1f5f9;
  border-bottom-color: #cbd5e1;
  color: #0f172a;
}

.dp-row-win-left,
.dp-row-win-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dp-row-win-label {
  font-weight: 700;
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-right: 2px;
}

.dp-row-win-seg {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-subtle, #334155);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

[data-theme="light"] .dp-row-win-seg {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.dive-planner-panel .dp-row-win-btn {
  padding: 3px 9px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted, #94a3b8);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

[data-theme="light"] .dive-planner-panel .dp-row-win-btn {
  color: #475569;
}

.dive-planner-panel .dp-row-win-btn:hover {
  color: var(--text-main, #f8fafc);
}

[data-theme="light"] .dive-planner-panel .dp-row-win-btn:hover {
  color: #0f172a;
}

.dive-planner-panel .dp-row-win-btn.active {
  background: var(--accent-cyan, #0ea5e9);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.dive-planner-panel .dp-row-page-btn,
.dive-planner-panel .dp-row-page-jump-btn {
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--border-subtle, #334155);
  background: rgba(30, 41, 59, 0.8);
  color: var(--text-main, #f8fafc);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: all 0.15s ease;
}

[data-theme="light"] .dive-planner-panel .dp-row-page-btn,
[data-theme="light"] .dive-planner-panel .dp-row-page-jump-btn {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #1e293b;
}

.dive-planner-panel .dp-row-page-btn:hover:not(:disabled),
.dive-planner-panel .dp-row-page-jump-btn:hover:not(.active) {
  border-color: var(--accent-cyan, #0ea5e9);
  color: var(--accent-cyan, #0ea5e9);
}

.dive-planner-panel .dp-row-page-jump-btn.active {
  background: rgba(14, 165, 233, 0.18);
  border-color: var(--accent-cyan, #0ea5e9);
  color: #38bdf8;
  font-weight: 700;
}

[data-theme="light"] .dive-planner-panel .dp-row-page-jump-btn.active {
  background: rgba(2, 132, 199, 0.12);
  border-color: #0284c7;
  color: #0284c7;
}

.dive-planner-panel .dp-row-page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.dp-row-range-summary {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  padding: 0 4px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

[data-theme="light"] .dp-row-range-summary {
  color: #475569;
}

.dive-planner-panel h2 { font-size:0.95rem; margin:10px 0 4px; color:var(--text-main); }
.dive-planner-panel button { padding:7px 10px; border-radius:7px; border:2px solid transparent; cursor:pointer; font-size:0.85rem; transition:all 0.2s; }
.dive-planner-panel button.secondary { background:var(--bg-surface); color:var(--text-main); border:2px solid var(--border-subtle); }
.dive-planner-panel button.secondary.active { border-color:#2563eb; background:rgba(37, 99, 235, 0.1); font-weight:600; color:#38bdf8; }

.dp-settings-bar { 
  display:flex; 
  gap:16px; 
  margin-bottom:12px; 
  flex-wrap:wrap; 
  background: var(--bg-surface);
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}
.dp-settings-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dp-settings-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}
.dp-settings-group select {
  padding: 6px 28px 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-card, var(--bg-surface));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='14' height='14' fill='%2394a3b8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px 14px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  color: var(--text-main);
  font-size: 0.85rem;
  cursor: pointer;
}
.dp-settings-group select:focus {
  border-color: var(--accent, #38bdf8);
  outline: none;
}
.dp-settings-group select option {
  background: var(--bg-surface, #1e293b);
  color: var(--text-main, #f8fafc);
}
[data-theme="light"] .dp-settings-group select {
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='14' height='14' fill='%2364748b'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}
[data-theme="light"] .dp-settings-group select option {
  background: #ffffff;
  color: #0f172a;
}

/* === SLACK PILL === */
.dp-slack-pill {
  width: 100%;
  border-radius: 999px;
  height: 36px;
  box-sizing: border-box;
  margin: 4px 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  padding: 0 16px;
  min-width: 110px;
}
.dp-slack-pill .time { font-size: 1rem; font-weight: 700; line-height: 1.1; }
.dp-slack-pill .val  { font-size: 0.8rem; opacity: 0.9; margin-top: 2px; line-height: 1.1; }

/* === DIVE WINDOW PILL === */
.dp-window-pill {
  width: 100%;
  border-radius: 999px;
  height: 36px;
  box-sizing: border-box;
  margin: 4px 0;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  border: none;
}
.dp-window-segment {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  padding: 4px 6px;
  height: 100%;
  flex: 1;
  min-width: 0;
}
.dp-window-segment.mid {
  border-left: 1px solid rgba(255,255,255,0.3);
  border-right: 1px solid rgba(255,255,255,0.3);
}
.dp-window-segment .time { font-size: 0.95rem; font-weight: 700; line-height: 1.2; }
.dp-window-segment .val { font-size: 0.8rem; opacity: 0.9; line-height: 1.2; }
.dp-window-segment.mid .time { font-size: 1.1rem; }

.dp-pill-3col {
  display: flex;
  width: 100%;
}
.dp-pill-2col {
  display: flex;
  width: 100%;
}
.dp-pill-1col {
  display: flex;
  width: 100%;
}
.dp-pill-1col .dp-window-segment {
  width: 100%;
  border-radius: 999px;
  border: none;
}
.dp-pill-2col .dp-window-segment.start { border-radius: 999px 0 0 999px; border-right: 1px solid rgba(255,255,255,0.3); }
.dp-pill-2col .dp-window-segment.end { border-radius: 0 999px 999px 0; }
.dp-pill-3col .dp-window-segment.start { border-radius: 999px 0 0 999px; }
.dp-pill-3col .dp-window-segment.mid { border-radius: 0; }
.dp-pill-3col .dp-window-segment.end { border-radius: 0 999px 999px 0; }

/* Window colours - Base Palettes */
.cm-3 .dp-win-ideal, .cm-4 .dp-win-ideal, .cm-3 .dp-slack-ideal, .cm-4 .dp-slack-ideal { background: #16a34a; color: white; border: none; }
.cm-3 .dp-win-good, .cm-4 .dp-win-good, .cm-3 .dp-slack-good, .cm-4 .dp-slack-good { background: #ca8a04; color: white; border: none; }
.cm-3 .dp-win-fair, .cm-4 .dp-win-fair, .cm-3 .dp-slack-fair, .cm-4 .dp-slack-fair { background: #ea580c; color: white; border: none; }
.cm-3 .dp-win-poor, .cm-4 .dp-win-poor, .cm-3 .dp-slack-poor, .cm-4 .dp-slack-poor { background: #dc2626; color: white; border: none; }
.cm-3 .dp-win-blocked, .cm-4 .dp-win-blocked, .cm-3 .dp-slack-blocked, .cm-4 .dp-slack-blocked { background: transparent; color: var(--text-muted); }

/* cm-4 Bold */
.cm-4 .dp-window-segment { font-weight: 700; }

/* cm-2 67% tint */
.cm-2 .dp-win-ideal, .cm-2 .dp-slack-ideal { background: rgba(22, 163, 74, 0.67); color: white; border: none; }
.cm-2 .dp-win-good, .cm-2 .dp-slack-good { background: rgba(202, 138, 4, 0.67); color: white; border: none; }
.cm-2 .dp-win-fair, .cm-2 .dp-slack-fair { background: rgba(234, 88, 12, 0.67); color: white; border: none; }
.cm-2 .dp-win-poor, .cm-2 .dp-slack-poor { background: rgba(220, 38, 38, 0.67); color: white; border: none; }
.cm-2 .dp-win-blocked, .cm-2 .dp-slack-blocked { background: transparent; color: var(--text-muted); }

/* cm-1 33% tint */
.cm-1 .dp-win-ideal, .cm-1 .dp-slack-ideal { background: rgba(22, 163, 74, 0.33); color: var(--text-main); border: none; }
.cm-1 .dp-win-good, .cm-1 .dp-slack-good { background: rgba(202, 138, 4, 0.33); color: var(--text-main); border: none; }
.cm-1 .dp-win-fair, .cm-1 .dp-slack-fair { background: rgba(234, 88, 12, 0.33); color: var(--text-main); border: none; }
.cm-1 .dp-win-poor, .cm-1 .dp-slack-poor { background: rgba(220, 38, 38, 0.33); color: var(--text-main); border: none; }
.cm-1 .dp-win-blocked, .cm-1 .dp-slack-blocked { background: transparent; color: var(--text-muted); }

/* cm-0 Text Only */
.cm-0 .dp-window-segment { background: transparent; }
.cm-0 .dp-win-ideal, .cm-0 .dp-slack-ideal { color: #16a34a; }
.cm-0 .dp-win-good, .cm-0 .dp-slack-good { color: #ca8a04; }
.cm-0 .dp-win-fair, .cm-0 .dp-slack-fair { color: #ea580c; }
.cm-0 .dp-win-poor, .cm-0 .dp-slack-poor { color: #dc2626; }
.cm-0 .dp-win-blocked, .cm-0 .dp-slack-blocked { color: var(--text-muted); }

/* Fallbacks for original classes in case they are used outside window-pill */
.dp-win-ideal   { background: #16a34a; color: white; }
.dp-win-good    { background: #ca8a04; color: white; }
.dp-win-fair    { background: #ea580c; color: white; }
.dp-win-poor    { background: #dc2626; color: white; }
.dp-win-blocked { background: transparent; color: var(--text-muted); }
.dp-slack-ideal   { background: #16a34a; color: white; }
.dp-slack-good    { background: #ca8a04; color: white; }
.dp-slack-fair    { background: #ea580c; color: white; }
.dp-slack-poor    { background: #dc2626; color: white; }
.dp-slack-blocked { background: transparent; color: var(--text-muted); }

/* === ROW MODE === */
.dp-compare-wreck-card {
  background: var(--bg-surface);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2); 
  margin-bottom: 12px;
  border: 1px solid var(--border-subtle);
}
.dp-compare-wreck-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}
.dp-compare-wreck-name { font-weight: 700; color: var(--text-main); font-size: 1.1rem; }
.dp-date-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.dp-date-label {
  width: 100px;
  flex-shrink: 0;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
  padding-top: 10px;
}
.dp-slack-set {
  flex: 1;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.dp-slack-set > * { flex: 1; min-width: 70px; max-width: 120px; }

/* === COL-A — Stacks Mode === */
.dp-col-a-container {
  background: var(--bg-surface);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  margin-bottom: 12px;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
}
.dp-col-a-grid {
  display: flex;
  gap: 16px;
  min-width: max-content;
}
.dp-wreck-stack-col {
  display: flex;
  flex-direction: column;
  width: var(--day-card-width);
}
.dp-wreck-stack-header {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
  padding: 8px 4px;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  margin-bottom: 8px;
}
.dp-remove-btn {
  position: absolute;
  top: 2px;
  right: 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 0 4px;
  cursor: pointer;
}
.dp-day-block {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border-subtle);
}
.dp-day-block:last-child { border-bottom: none; }
.dp-day-header {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 6px;
}

/* === COL-B — Shared Dates === */
.dp-col-b-container {
  background: var(--bg-surface);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
}
.dp-shared-dates-grid {
  display: grid;
  grid-template-columns: 110px repeat(var(--wreck-count), max-content);
  gap: 1px;
  background: var(--border-subtle);
}
.dp-grid-date-header, .dp-grid-wreck-header {
  background: var(--bg-surface);
  padding: 10px 8px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-main);
  text-align: center;
}
.dp-grid-wreck-header {
  border-bottom: 2px solid var(--border-subtle);
}
.dp-remove-col-btn {
  margin-left: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
}
.dp-grid-date-cell {
  background: var(--bg-surface);
  padding: 10px 8px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
}
.dp-grid-wreck-cell {
  background: var(--bg-surface);
  padding: 8px;
}
.dp-grid-pill-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dp-aggregated-cell {
  padding: 18px 10px;
  text-align: center;
  border-radius: 10px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
}

/* Base (cm-3 Full Colour, cm-4 Full Bold) */
.cm-3.dp-aggregated-cell.ideal, .cm-4.dp-aggregated-cell.ideal { background: #16a34a; color: white; border: none; }
.cm-3.dp-aggregated-cell.good, .cm-4.dp-aggregated-cell.good { background: #ca8a04; color: white; border: none; }
.cm-3.dp-aggregated-cell.fair, .cm-4.dp-aggregated-cell.fair { background: #ea580c; color: white; border: none; }
.cm-3.dp-aggregated-cell.poor, .cm-4.dp-aggregated-cell.poor { background: #dc2626; color: white; border: none; }
.cm-3.dp-aggregated-cell.blocked, .cm-4.dp-aggregated-cell.blocked { background: transparent; color: var(--text-muted); }

/* cm-4 Bold */
.cm-4.dp-aggregated-cell { font-weight: 700; }

/* cm-2 67% tint */
.cm-2.dp-aggregated-cell.ideal { background: rgba(22, 163, 74, 0.67); color: white; border: none; }
.cm-2.dp-aggregated-cell.good { background: rgba(202, 138, 4, 0.67); color: white; border: none; }
.cm-2.dp-aggregated-cell.fair { background: rgba(234, 88, 12, 0.67); color: white; border: none; }
.cm-2.dp-aggregated-cell.poor { background: rgba(220, 38, 38, 0.67); color: white; border: none; }
.cm-2.dp-aggregated-cell.blocked { background: transparent; color: var(--text-muted); }

/* cm-1 33% tint */
.cm-1.dp-aggregated-cell.ideal { background: rgba(22, 163, 74, 0.33); color: #4ade80; border: none; }
.cm-1.dp-aggregated-cell.good { background: rgba(202, 138, 4, 0.33); color: #fbbf24; border: none; }
.cm-1.dp-aggregated-cell.fair { background: rgba(234, 88, 12, 0.33); color: #fb923c; border: none; }
.cm-1.dp-aggregated-cell.poor { background: rgba(220, 38, 38, 0.33); color: #f87171; border: none; }
.cm-1.dp-aggregated-cell.blocked { background: rgba(107, 114, 128, 0.2); color: #9ca3af; border: none; }

/* cm-0 Text Only */
.cm-0.dp-aggregated-cell { background: transparent; padding: 18px 0; }
.cm-0.dp-aggregated-cell .dp-score-emoji { display: none; }
.cm-0.dp-aggregated-cell.ideal { color: #16a34a; }
.cm-0.dp-aggregated-cell.good { color: #ca8a04; }
.cm-0.dp-aggregated-cell.fair { color: #ea580c; }
.cm-0.dp-aggregated-cell.poor { color: #dc2626; }
.cm-0.dp-aggregated-cell.blocked { color: var(--text-muted); }

/* Fallbacks */
.dp-aggregated-cell.ideal    { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.dp-aggregated-cell.good     { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.dp-aggregated-cell.fair     { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
.dp-aggregated-cell.poor     { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.dp-aggregated-cell.blocked  { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }

.dp-score-emoji { font-size: 1.4rem; }
.dp-score-text { font-size: 0.9rem; font-weight: 600; }

/* === RARE SITES VIEW === */
.dp-rare-section {
  background: var(--bg-panel);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  border: 1px solid var(--border-subtle);
}
.dp-rare-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.dp-rarity-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}
.dp-rarity-badge.standard  { background: #334155; color: #e2e8f0; }
.dp-rarity-badge.occasional{ background: #1e3a8a; color: #bfdbfe; }
.dp-rarity-badge.rare      { background: #7f1d1d; color: #fecaca; }
.dp-rarity-badge.extreme   { background: #4c1d95; color: #ddd6fe; }

.dp-rare-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-style: italic;
}
.dp-best-windows-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dp-window-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border-radius: 8px;
  border-left: 3px solid;
}
.dp-window-card.ideal { border-color: #22c55e; }
.dp-window-card.good  { border-color: #f97316; }
.dp-window-date { font-weight: 600; min-width: 100px; color: var(--text-bright); }
.dp-window-score { font-size: 1.1rem; }
.dp-window-detail { font-size: 0.8rem; color: var(--text-muted); }

.dp-empty-note { text-align: center; color: var(--text-muted); padding: 40px; font-size: 0.9rem; }
.dp-hidden { display: none !important; }

/* === DIVE PLANNER CLOSE BUTTON ('X') === */
.dive-planner-panel #btn-close-planner {
  width: 28px;
  height: 28px;
  min-width: 28px;
  max-width: 28px;
  padding: 4px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  line-height: 1;
}
.dive-planner-panel #btn-close-planner:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-subtle);
}
.dive-planner-panel #btn-close-planner svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.5;
  display: block;
}

/* === DIVE PLANNER FILTER COMBO BOXES ALIGNMENT === */
#dp-calendar-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0;
  width: 100%;
  box-sizing: border-box;
}
#dp-calendar-settings .drawer-subcard {
  margin-bottom: 0;
  margin-top: 0;
}
#dp-calendar-settings .dp-settings-group {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}
#dp-calendar-settings .dp-settings-group label {
  width: 110px;
  min-width: 110px;
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
}
#dp-calendar-settings .dp-settings-group select {
  flex: 1;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 6px 30px 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-card, var(--bg-surface));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='14' height='14' fill='%2394a3b8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px 14px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  color: var(--text-main);
  font-size: 0.85rem;
  cursor: pointer;
  height: 34px;
}

#dp-calendar-settings .dp-settings-group select:focus {
  border-color: var(--accent, #38bdf8);
  outline: none;
}

#dp-calendar-settings .dp-settings-group select option {
  background: var(--bg-surface, #1e293b);
  color: var(--text-main, #f8fafc);
}

[data-theme="light"] #dp-calendar-settings .dp-settings-group select {
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='14' height='14' fill='%2364748b'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}

[data-theme="light"] #dp-calendar-settings .dp-settings-group select option {
  background: #ffffff;
  color: #0f172a;
}

/* Operating Parameters Subpanel (Shared across Slack Water & Dive Planner Settings) */
.op-subpanel,
#dp-calendar-settings .op-subpanel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
}

.op-subpanel .filter-group,
#dp-calendar-settings .op-subpanel .filter-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0;
}

.op-subpanel .filter-group label,
#dp-calendar-settings .op-subpanel .filter-group label {
  width: auto;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  text-align: left;
}

.op-subpanel .custom-select,
#dp-calendar-settings .op-subpanel .custom-select {
  width: 100%;
  box-sizing: border-box;
  height: 38px;
}

/* === WRECK COLUMN RESIZER & INTERACTIVE LINKS === */
.dp-col-header,
.dp-row-wreck-th,
.dp-row-date-th {
  position: relative;
}
.dp-col-resizer,
.dp-row-resizer,
.dp-row-date-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 25;
  border-right: 2px solid transparent;
  transition: background-color 0.15s, border-color 0.15s;
}
.dp-col-resizer:hover,
.dp-col-resizer.is-resizing,
.dp-row-resizer:hover,
.dp-row-resizer.is-resizing,
.dp-row-date-resizer:hover,
.dp-row-date-resizer.is-resizing {
  background-color: var(--accent-cyan, #0ea5e9);
  border-right-color: #0284c7;
  opacity: 0.9;
}
.dp-wreck-clickable {
  cursor: pointer;
  transition: color 0.15s ease;
}
.dp-wreck-clickable:hover {
  color: var(--accent-cyan, #0ea5e9);
  text-decoration: underline;
}

/* === COLUMN SHIFT CONTROLS & HEADER DRAG-AND-DROP === */
.dp-col-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  margin-bottom: 4px;
  flex-wrap: nowrap;
}

.dp-row-controls {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  vertical-align: middle;
  flex-shrink: 0;
}

.dp-row-shift-th,
.dp-row-shift-td {
  width: var(--dp-row-shift-width, 116px) !important;
  min-width: var(--dp-row-shift-width, 116px) !important;
  max-width: var(--dp-row-shift-width, 116px) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  text-align: center !important;
}

.dp-row-shift-td .dp-row-controls {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  width: 100% !important;
  flex-wrap: nowrap !important;
}

.dp-row-shift-td .dp-col-shift-btn {
  width: 22px !important;
  min-width: 22px !important;
  max-width: 22px !important;
  height: 18px !important;
  padding: 0 !important;
  font-size: 10px !important;
  line-height: 18px !important;
  text-align: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.dp-toggle-row-controls-btn {
  user-select: none;
}

.dp-col-btn {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--text-main, #f8fafc);
  border-radius: 3px;
  padding: 0 4px;
  font-size: 0.65rem;
  font-family: inherit;
  font-weight: bold;
  line-height: 16px;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  box-sizing: border-box;
}

.dp-col-btn:hover:not(:disabled) {
  background: var(--accent-cyan, #0ea5e9);
  color: #ffffff;
  border-color: #0284c7;
}

.dp-col-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  pointer-events: none;
}

/* Desktop Header Drag and Drop Styles */
th.dp-col-header {
  cursor: grab;
  transition: border 0.12s ease, opacity 0.15s ease;
}

th.dp-col-header.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

th.dp-col-header.drop-target-left {
  border-left: 3px solid var(--accent-cyan, #0ea5e9);
}

th.dp-col-header.drop-target-right {
  border-right: 3px solid var(--accent-cyan, #0ea5e9);
}

.dp-col-resizer,
.dp-col-btn {
  cursor: pointer;
}

.dp-wreck-clickable {
  cursor: pointer;
}

[data-theme="light"] .dp-col-btn {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.2);
  color: #1e293b;
}

[data-theme="light"] .dp-col-btn:hover:not(:disabled) {
  background: #0284c7;
  color: #ffffff;
  border-color: #0369a1;
}

[data-theme="light"] .dp-col-step-badge {
  background: rgba(2, 132, 199, 0.12);
  color: #0369a1;
  border-color: rgba(2, 132, 199, 0.28);
}

[data-theme="light"] .dp-col-step-badge:hover {
  background: rgba(2, 132, 199, 0.22);
}

/* === RESPONSIVE PILL SUBCELLS & MOBILE PINCH-ZOOM === */
#dp-compareArea,
.dp-table-container {
  touch-action: pan-x pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
}

.dp-col-table {
  table-layout: fixed;
}

.dp-col-header-inner,
.dp-pill-1col,
.dp-pill-3col {
  container-type: inline-size;
  display: flex;
  width: 100%;
  box-sizing: border-box;
}

.dp-col-name {
  font-size: clamp(0.62rem, 10.5cqw, 0.92rem);
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dp-pill-seg {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
  padding: clamp(2px, 2.5cqw, 4px) clamp(1px, 2.5cqw, 4px);
}

.dp-seg-t1 {
  font-size: clamp(0.54rem, 10.2cqw, 0.95rem);
  line-height: 1.2;
  white-space: nowrap;
}

.dp-seg-t2 {
  font-size: clamp(0.48rem, 8.6cqw, 0.8rem);
  opacity: 0.9;
  line-height: 1.2;
  white-space: nowrap;
}

/* === UNIFORM PLANNER OUTPUT BUTTONS === */
.dive-planner-panel .btn-planner-output {
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-subtle, #334155);
  color: var(--text-main, #f8fafc);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dive-planner-panel .btn-planner-output:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan, #38bdf8);
  color: #ffffff;
}

.dive-planner-panel .btn-planner-output:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* === PRINT / PDF HEADER ("UkSeas - Slack Times Calendar") === */
.dp-print-header {
  display: none;
  margin: 0 0 12px 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

/* === DIRECT IN-PAGE PDF EXPORT LIGHT MODE OVERRIDES === */
#dp-compareWrapper.pdf-export-light {
  background: #ffffff;
  color: #0f172a;
  padding: 16px;
  overflow: visible;
  width: max-content !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

#dp-compareWrapper.pdf-export-light .dp-print-header {
  display: block;
}

#dp-compareWrapper.pdf-export-light #dp-compareArea,
#dp-compareWrapper.pdf-export-light .dp-table-container,
#dp-compareWrapper.pdf-export-light .calendar-screen {
  background: #ffffff;
  color: #0f172a;
  overflow: visible;
  width: max-content !important;
  max-width: 100% !important;
}

#dp-compareWrapper.pdf-export-light table {
  width: max-content !important;
  max-width: 100% !important;
}

#dp-compareWrapper.pdf-export-light table.dp-col-table th.dp-col-header,
#dp-compareWrapper.pdf-export-light table.dp-col-table td:not([style*="sticky"]) {
  width: 240px !important;
  max-width: 260px !important;
  min-width: 160px !important;
}

#dp-compareWrapper.pdf-export-light table th,
#dp-compareWrapper.pdf-export-light table td {
  border-color: #cbd5e1;
}

#dp-compareWrapper.pdf-export-light table thead,
#dp-compareWrapper.pdf-export-light table th,
#dp-compareWrapper.pdf-export-light table td[style*="sticky"] {
  background: #f1f5f9;
  color: #0f172a;
}

#dp-compareWrapper.pdf-export-light .no-print,
#dp-compareWrapper.pdf-export-light .dp-col-resizer,
#dp-compareWrapper.pdf-export-light .dp-col-controls,
#dp-compareWrapper.pdf-export-light .dp-row-resizer,
#dp-compareWrapper.pdf-export-light .dp-row-controls,
#dp-compareWrapper.pdf-export-light .dp-row-shift-th,
#dp-compareWrapper.pdf-export-light .dp-row-shift-td,
#dp-compareWrapper.pdf-export-light .dp-toggle-row-controls-btn {
  display: none !important;
}

#dp-compareWrapper.pdf-export-light .dp-pill-seg[data-contrast="dark"],
body.printing-dive-planner .dp-pill-seg[data-contrast="dark"] {
  color: #0f172a !important;
  text-shadow: none !important;
}

#dp-compareWrapper.pdf-export-light .dp-pill-seg[data-contrast="light"],
body.printing-dive-planner .dp-pill-seg[data-contrast="light"] {
  color: #ffffff !important;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.7) !important;
}

#dp-compareWrapper.pdf-export-light .dp-pill-seg[data-mode0-light="true"],
body.printing-dive-planner .dp-pill-seg[data-mode0-light="true"] {
  color: #334155 !important;
  font-weight: 700 !important;
}

/* === DIRECT IN-PAGE PRINT RULES FOR DIVE PLANNER === */
@media print {
  body.printing-dive-planner {
    background: #ffffff;
    color: #000000;
    overflow: visible;
    height: auto;
  }

  body.printing-dive-planner * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
  }

  body.printing-dive-planner #app-container > *:not(#dive-planner-panel),
  body.printing-dive-planner .app-header,
  body.printing-dive-planner #sub-header-planner,
  body.printing-dive-planner .sub-header-planner,
  body.printing-dive-planner #map-viewport,
  body.printing-dive-planner #map,
  body.printing-dive-planner .map-container,
  body.printing-dive-planner #search-drawer,
  body.printing-dive-planner #wreck-detail-panel,
  body.printing-dive-planner #forecasts-panel,
  body.printing-dive-planner #planner-filters-modal,
  body.printing-dive-planner .no-print,
  body.printing-dive-planner .dp-col-resizer,
  body.printing-dive-planner .dp-col-controls,
  body.printing-dive-planner .dp-row-resizer,
  body.printing-dive-planner .dp-row-date-resizer,
  body.printing-dive-planner .dp-row-controls,
  body.printing-dive-planner .dp-row-shift-th,
  body.printing-dive-planner .dp-row-shift-td,
  body.printing-dive-planner .dp-toggle-row-controls-btn {
    display: none !important;
  }

  body.printing-dive-planner .dp-print-header {
    display: block;
    color: #0f172a;
    margin: 0 0 12px 0;
  }

  body.printing-dive-planner #app-container,
  body.printing-dive-planner .app-main,
  body.printing-dive-planner #dive-planner-panel,
  body.printing-dive-planner .detail-panel-body,
  body.printing-dive-planner #dp-compareWrapper,
  body.printing-dive-planner #dp-compareArea,
  body.printing-dive-planner .dp-table-container {
    position: static;
    width: max-content !important;
    max-width: 100% !important;
    height: auto;
    max-height: none;
    overflow: visible;
    background: #ffffff;
    color: #0f172a;
    box-shadow: none;
    border: none;
    margin: 0;
    padding: 0;
  }

  body.printing-dive-planner #dp-compareArea table {
    width: max-content !important;
    max-width: 100% !important;
  }

  body.printing-dive-planner table.dp-col-table th.dp-col-header,
  body.printing-dive-planner table.dp-col-table td:not([style*="sticky"]) {
    width: 240px !important;
    max-width: 260px !important;
    min-width: 160px !important;
  }

  body.printing-dive-planner table.dp-row-table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
  }

  body.printing-dive-planner table.dp-row-table th.dp-row-wreck-th,
  body.printing-dive-planner table.dp-row-table td.dp-row-wreck-td {
    width: 150px !important;
    min-width: 130px !important;
    max-width: 170px !important;
  }

  body.printing-dive-planner table.dp-row-table th.dp-row-date-th,
  body.printing-dive-planner table.dp-row-table td.dp-row-data-cell {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  body.printing-dive-planner #dp-compareArea table th,
  body.printing-dive-planner #dp-compareArea table td {
    border-color: #cbd5e1;
  }

  body.printing-dive-planner #dp-compareArea table thead,
  body.printing-dive-planner #dp-compareArea table th,
  body.printing-dive-planner #dp-compareArea table td[style*="sticky"] {
    position: static;
    background: #f1f5f9;
    color: #0f172a;
  }
}

@keyframes dp-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .dive-planner-panel {
    top: 58px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    height: calc(100vh - 58px) !important;
    height: calc(100dvh - 58px) !important;
    max-height: calc(100vh - 58px) !important;
    max-height: calc(100dvh - 58px) !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    resize: none !important;
  }
}

/* === ONSCREEN CALENDAR (MONTHLY & 12-MONTH ANNUAL OVERVIEW) === */
.month-grid-wrapper {
  container-type: inline-size;
  padding: 6px 8px 10px 8px;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.month-grid-wrapper .studio-paper-sheet {
  zoom: var(--dp-zoom-scale, 1);
  transform-origin: top left;
  min-width: 0;
  max-width: 100%;
}

/* Responsive Month / Annual Header: wraps cleanly onto two lines when panel shrinks */
.month-grid-wrapper .preview-sheet-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 8px 12px;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.month-grid-wrapper .preview-header-left {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 100%;
}

.month-grid-wrapper .preview-sheet-title {
  font-size: 13px;
  line-height: 1.25;
}

.month-grid-wrapper .preview-sheet-subtitle {
  font-size: 10.5px;
  line-height: 1.35;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

.month-grid-wrapper .preview-header-right {
  flex: 0 1 auto;
  text-align: right;
  white-space: normal;
}

.month-grid-wrapper .preview-header-notice {
  font-size: 10px;
  line-height: 1.3;
}

@container (max-width: 720px) {
  .month-grid-wrapper .preview-header-left {
    flex-basis: 100%;
  }
  .month-grid-wrapper .preview-header-right {
    flex-basis: 100%;
    text-align: left;
    padding-top: 2px;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
  }
}

/* Container-query responsive pill wrapper inside Monthly Calendar cells */
.pill-month-cqw {
  container-type: inline-size;
  display: flex;
  width: 100%;
  box-sizing: border-box;
  border-radius: 4px;
  overflow: hidden;
  gap: 1px;
  margin: 1.5px 0;
}

/* Full Year Toggle Button next to Month Dropdown */
.dive-planner-panel .dp-cal-year-toggle.active {
  background: var(--accent-cyan, #0ea5e9) !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 1px 4px rgba(14, 165, 233, 0.35);
}

/* 12-Month Annual Traffic-Light Calendar Sheet */
.studio-paper-sheet.sheet-annual-overview {
  background: #ffffff;
  color: #0f172a;
  padding: 12px 16px 14px 16px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.month-grid-wrapper .preview-sheet-footer {
  flex-wrap: wrap;
  white-space: normal;
  gap: 4px 12px;
  max-width: 100%;
  min-width: 0;
}

.dp-annual-year-heading {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  margin: 6px 2px 12px 2px;
  line-height: 1.1;
}

.dp-annual-months-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 22px;
  width: 100%;
  box-sizing: border-box;
}

@container (max-width: 580px) {
  .dp-annual-months-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 14px;
  }
}

@container (max-width: 430px) {
  .studio-paper-sheet.sheet-annual-overview {
    padding: 10px 10px 12px 10px;
  }
  .dp-annual-months-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .dp-annual-dow-row,
  .dp-annual-days-grid {
    gap: 1px;
  }
}

.dp-annual-month-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dive-planner-panel .dp-annual-month-title,
.dp-annual-month-title {
  appearance: none;
  border: none;
  background: transparent;
  padding: 2px 6px;
  margin: 0 auto 6px auto;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  text-align: center;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.14s ease, color 0.14s ease;
}

.dive-planner-panel .dp-annual-month-title:hover,
.dp-annual-month-title:hover {
  background: #e0f2fe;
  color: #0369a1;
}

.dp-annual-dow-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1.5px;
  margin-bottom: 4px;
  text-align: center;
}

.dp-annual-dow-row > span {
  font-size: 10.5px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.4;
  user-select: none;
}

.dp-annual-days-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1.5px;
}

.dive-planner-panel .dp-annual-day,
.dp-annual-day {
  appearance: none;
  border: none;
  margin: 0;
  padding: 0;
  height: 26px;
  width: 100%;
  min-width: 0;
  border-radius: 3px;
  background: transparent;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  line-height: 1;
  box-sizing: border-box;
  transition: transform 0.1s ease, filter 0.12s ease, background 0.12s ease;
}

.dp-annual-segs {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  pointer-events: none;
  z-index: 0;
}

.dp-annual-seg {
  display: block;
  width: 100%;
  height: 100%;
}

.dp-annual-day-stack {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1;
}

.dp-annual-day-num {
  position: relative;
  z-index: 1;
  line-height: 1;
}

.dp-annual-day-time {
  font-size: 8.5px;
  font-weight: 600;
  line-height: 1;
  opacity: 0.92;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.has-annual-times .dp-annual-day {
  height: 31px;
}

.has-annual-times .dp-annual-day.with-time .dp-annual-day-num {
  font-size: 10.5px;
}

/* Auto mode: hide micro-times on narrow containers (< 680px); WYSIWYG mode omits .is-responsive-times so users can zoom */
@container (max-width: 680px) {
  .annual-overview-wrapper.is-responsive-times .dp-annual-day {
    height: 26px;
  }
  .annual-overview-wrapper.is-responsive-times .dp-annual-day.with-time .dp-annual-day-num {
    font-size: 11.5px;
  }
  .annual-overview-wrapper.is-responsive-times .dp-annual-day-time {
    display: none;
  }
}

/* Planner Studio Paper Sheet Overrides for 12-Month Calendar Grid */
.studio-paper-sheet.studio-annual-grid-sheet {
  justify-content: space-between;
  padding: 9px 14px 9px 14px;
  overflow: hidden;
}

.studio-paper-sheet.studio-annual-grid-sheet.size-a4.orient-landscape {
  height: 608px;
}

.studio-paper-sheet.studio-annual-grid-sheet.size-a4.orient-portrait {
  height: 860px;
}

.studio-paper-sheet.studio-annual-grid-sheet.size-a3.orient-landscape {
  height: 764px;
}

.studio-paper-sheet.studio-annual-grid-sheet.size-a3.orient-portrait {
  height: 1080px;
}

.studio-paper-sheet.studio-annual-grid-sheet.size-a2.orient-landscape {
  height: 877px;
}

.studio-paper-sheet.studio-annual-grid-sheet.size-a2.orient-portrait {
  height: 1240px;
}

@media (max-width: 1040px) {
  .studio-paper-sheet.studio-annual-grid-sheet.orient-landscape {
    height: 481px !important;
    min-height: 481px !important;
  }
  .studio-paper-sheet.studio-annual-grid-sheet.orient-portrait {
    height: 920px !important;
    min-height: 920px !important;
  }
}

.studio-annual-grid-sheet .preview-sheet-header {
  padding: 5px 12px;
  margin-bottom: 4px;
}

.studio-annual-grid-sheet .dp-annual-legend-bar {
  padding: 3px 10px;
  margin: 0 0 6px 0;
  font-size: 10px;
  flex: 0 0 auto;
}

.studio-annual-grid-sheet .dp-annual-months-grid {
  flex: 1 1 0;
  min-height: 0;
}

.studio-annual-grid-sheet.orient-landscape .dp-annual-months-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 8px 14px;
}

.studio-annual-grid-sheet.orient-portrait .dp-annual-months-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 10px 14px;
}

.studio-annual-grid-sheet .dp-annual-month-card {
  min-height: 0;
}

.studio-annual-grid-sheet .dp-annual-month-title {
  font-size: 11px;
  line-height: 1.15;
  padding: 0;
  margin: 0 auto 2px auto;
  flex: 0 0 auto;
  pointer-events: none;
}

.studio-annual-grid-sheet .dp-annual-dow-row {
  margin-bottom: 2px;
  flex: 0 0 auto;
}

.studio-annual-grid-sheet .dp-annual-dow-row > span {
  font-size: 8.5px;
  line-height: 1.15;
}

.studio-annual-grid-sheet .dp-annual-days-grid {
  flex: 1 1 0;
  min-height: 0;
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 1.5px;
}

.studio-annual-grid-sheet .dp-annual-day,
.studio-annual-grid-sheet.has-annual-times .dp-annual-day {
  height: 100%;
  min-height: 0;
  font-size: 9px;
  pointer-events: none;
}

.studio-annual-grid-sheet.has-annual-times .dp-annual-day.with-time .dp-annual-day-num {
  font-size: 8px;
}

.studio-annual-grid-sheet .dp-annual-day-time {
  font-size: 6.4px;
}

.studio-annual-grid-sheet.size-a3 .dp-annual-month-title,
.studio-annual-grid-sheet.size-a2 .dp-annual-month-title {
  font-size: 13px;
}

.studio-annual-grid-sheet.size-a3 .dp-annual-day,
.studio-annual-grid-sheet.size-a2 .dp-annual-day,
.studio-annual-grid-sheet.size-a3.has-annual-times .dp-annual-day,
.studio-annual-grid-sheet.size-a2.has-annual-times .dp-annual-day {
  height: 100%;
  font-size: 10.5px;
}

.studio-annual-grid-sheet.size-a3.has-annual-times .dp-annual-day.with-time .dp-annual-day-num,
.studio-annual-grid-sheet.size-a2.has-annual-times .dp-annual-day.with-time .dp-annual-day-num {
  font-size: 9.5px;
}

.studio-annual-grid-sheet.size-a3 .dp-annual-day-time,
.studio-annual-grid-sheet.size-a2 .dp-annual-day-time {
  font-size: 7.8px;
}

.dp-annual-underline-3 {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 1.5px;
  height: 2.5px;
  border-radius: 1.5px;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  pointer-events: none;
  z-index: 1;
}

.dp-annual-uline-seg {
  display: block;
  width: 100%;
  height: 100%;
}

.dive-planner-panel .dp-annual-day.is-empty,
.dp-annual-day.is-empty {
  cursor: default;
  pointer-events: none;
}

.dive-planner-panel .dp-annual-day:not(.is-empty):hover,
.dp-annual-day:not(.is-empty):hover {
  filter: brightness(0.93);
  transform: scale(1.06);
  z-index: 2;
}

.dive-planner-panel .dp-annual-day.no-slack:not(.is-empty):hover,
.dp-annual-day.no-slack:not(.is-empty):hover {
  background: #f1f5f9;
  color: #0f172a;
}

.dive-planner-panel .dp-annual-day.is-today:not(.is-colored):not(.is-text-only),
.dp-annual-day.is-today:not(.is-colored):not(.is-text-only) {
  color: #dc2626;
  font-weight: 800;
}

.dive-planner-panel .dp-annual-day.is-today.is-colored,
.dive-planner-panel .dp-annual-day.is-today.is-text-only,
.dp-annual-day.is-today.is-colored,
.dp-annual-day.is-today.is-text-only {
  outline: 2px solid #0f172a;
  outline-offset: -2px;
}

.dp-annual-day.is-holiday:not(.is-text-only.is-split-3):not(.has-asymmetry-cue),
.dp-annual-day.is-holiday:not(.is-text-only.is-split-3):not(.has-asymmetry-cue) .dp-annual-day-num {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

.dp-annual-day.is-holiday.is-text-only.is-split-3 .dp-annual-day-num,
.dp-annual-day.is-holiday.has-asymmetry-cue .dp-annual-day-num {
  text-decoration: overline;
  text-decoration-thickness: 1.5px;
}

/* Aggregated Display Mode Buttons & Compact Month Dropdown */
.dive-planner-panel .dp-cal-agg-btn.active,
.dp-cal-agg-btn.active {
  background: var(--accent-cyan, #0ea5e9) !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 1px 4px rgba(14, 165, 233, 0.35);
}

.dp-cal-nav-sep {
  width: 1px;
  height: 18px;
  background: rgba(148, 163, 184, 0.3);
  margin: 0 3px;
  display: inline-block;
  flex-shrink: 0;
}

.dp-cal-times-group {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.3));
  background: rgba(15, 23, 42, 0.25);
}

[data-theme="light"] .dp-cal-times-group {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.dive-planner-panel .dp-cal-times-btn,
.dp-cal-times-btn {
  height: 24px;
  padding: 0 7px;
  font-size: 10.5px;
  font-weight: 600;
  border: none !important;
  border-right: 1px solid rgba(148, 163, 184, 0.22) !important;
  border-radius: 0 !important;
  background: transparent;
}

.dive-planner-panel .dp-cal-times-btn:last-child,
.dp-cal-times-btn:last-child {
  border-right: none !important;
}

.dive-planner-panel .dp-cal-times-btn.active,
.dp-cal-times-btn.active {
  background: var(--accent-cyan, #0ea5e9) !important;
  color: #ffffff !important;
}

.dp-agg-help-subhead {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.72;
  margin-bottom: 4px;
}

.dive-planner-panel .dp-cal-agg-help-btn,
.dp-cal-agg-help-btn {
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  cursor: pointer;
}

.dive-planner-panel .dp-cal-agg-help-btn.active,
.dp-cal-agg-help-btn.active {
  background: var(--accent-cyan, #0ea5e9) !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 1px 5px rgba(14, 165, 233, 0.4);
}

.dp-cal-agg-help-popup.hidden {
  display: none !important;
}

.dp-cal-agg-help-popup {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: min(460px, 100%);
  max-height: min(74vh, 540px);
  overflow-y: auto;
  z-index: 45;
  background: var(--bg-surface, #0f172a);
  color: var(--text-primary, #f8fafc);
  border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.3));
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 14px 32px rgba(2, 6, 23, 0.45);
  box-sizing: border-box;
  text-align: left;
}

[data-theme="light"] .dp-cal-agg-help-popup {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.dp-agg-help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.dp-agg-help-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.dp-agg-help-close {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.7;
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
}

.dp-agg-help-close:hover {
  opacity: 1;
  background: rgba(148, 163, 184, 0.18);
}

.dp-agg-help-intro {
  margin: 0 0 8px 0;
  font-size: 11.5px;
  line-height: 1.4;
  opacity: 0.85;
}

.dp-agg-help-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dp-agg-help-item {
  appearance: none;
  width: 100%;
  text-align: left;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 6px;
  padding: 7px 9px;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.dp-agg-help-item:hover {
  background: rgba(14, 165, 233, 0.10);
  border-color: rgba(14, 165, 233, 0.45);
}

.dp-agg-help-item.is-active {
  background: rgba(14, 165, 233, 0.14);
  border-color: #0ea5e9;
}

.dp-agg-help-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}

.dp-agg-help-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: #38bdf8;
}

[data-theme="light"] .dp-agg-help-badge {
  color: #0284c7;
}

.dp-agg-help-active-pill {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #0ea5e9;
  color: #ffffff;
  padding: 1px 6px;
  border-radius: 999px;
}

.dp-agg-help-desc {
  font-size: 11.5px;
  line-height: 1.4;
  opacity: 0.92;
}

.dp-agg-help-footer {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 11px;
  line-height: 1.35;
  opacity: 0.8;
}

.dive-planner-panel .dp-cal-month-select,
.dp-cal-month-select {
  width: 108px !important;
  min-width: 96px;
  max-width: 112px;
  flex: 0 0 auto;
}

/* Annual Legend Bar & Per-Month Good/Okay Summary */
.dp-annual-legend-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 6px 10px;
  margin: 6px 0 8px 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
}

.dp-annual-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.2;
}

.dp-annual-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2.5px;
  display: inline-block;
  flex-shrink: 0;
}

.dp-annual-swatch.is-poor-swatch {
  border: 1px solid #cbd5e1;
  box-sizing: border-box;
}

.dp-annual-cue-sample {
  width: 18px;
  height: 4px;
  border-radius: 1.5px;
  overflow: hidden;
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex-shrink: 0;
}

/* Hybrid Asymmetry 2-Part Bottom Micro-Cue */
.dp-annual-cue-2 {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 1.5px;
  height: 2.5px;
  border-radius: 1.5px;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  pointer-events: none;
  z-index: 1;
}

.dp-annual-cue-seg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Scoring Weights & Day Inspector Styles (Used in Unified Thresholds HUD) */

.dp-weights-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}

.dp-weights-summary::-webkit-details-marker {
  display: none;
}

.dp-weights-rows {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
}

.dp-weight-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.dp-weight-row input[type="range"] {
  width: 100%;
  cursor: pointer;
}

.dp-weight-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan, #38bdf8);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dp-day-inspector {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.25));
  background: rgba(15, 23, 42, 0.22);
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
}

[data-theme="light"] .dp-day-inspector {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}

.dp-inspector-heading {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}


/* === MONTH AGENDA VIEW (MOBILE / TOUCH ADAPTATION) === */
.month-agenda-wrapper {
  display: none;
  width: 100%;
  padding: 8px 6px;
  box-sizing: border-box;
}

.month-grid-wrapper.is-agenda-view .preview-grid-wrapper {
  display: none !important;
}

.month-grid-wrapper.is-agenda-view .month-agenda-wrapper {
  display: block !important;
}

/* Responsive Auto-Agenda on small mobile viewports when not forced into grid */
@media (max-width: 480px) {
  .month-grid-wrapper:not(.is-grid-view) .preview-grid-wrapper {
    display: none !important;
  }
  .month-grid-wrapper:not(.is-grid-view) .month-agenda-wrapper {
    display: block !important;
  }
}

.month-agenda-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.dp-agenda-card {
  background: var(--surface-card, rgba(30, 41, 59, 0.45));
  border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.22));
  border-radius: var(--radius-md, 8px);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
  box-sizing: border-box;
}

[data-theme="light"] .dp-agenda-card {
  background: #ffffff;
  border-color: #cbd5e1;
}

.dp-agenda-card:hover {
  border-color: var(--accent, #38bdf8);
}

.dp-agenda-card:active {
  transform: scale(0.995);
}

.dp-agenda-card.is-today {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.dp-agenda-card.is-holiday {
  background: rgba(254, 243, 199, 0.1);
}

[data-theme="light"] .dp-agenda-card.is-holiday {
  background: #fffbeb;
}

.dp-agenda-card.no-slacks {
  opacity: 0.75;
}

.dp-agenda-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dp-agenda-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
}

[data-theme="light"] .dp-agenda-date-badge {
  color: #0f172a;
}

.dp-agenda-dow {
  color: var(--text-dim, #94a3b8);
  font-size: 11.5px;
  text-transform: uppercase;
}

.dp-agenda-today-tag {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.dp-agenda-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dp-agenda-slacks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.dp-agenda-slack-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--surface-sunken, rgba(15, 23, 42, 0.25));
  border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.15));
  border-radius: var(--radius-sm, 6px);
  padding: 6px 10px;
}

[data-theme="light"] .dp-agenda-slack-row {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.dp-agenda-slack-pill-col {
  flex: 0 1 auto;
  min-width: 130px;
}

.dp-agenda-slack-meta {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

[data-theme="light"] .dp-agenda-slack-meta {
  color: #475569;
}

.dp-agenda-multi-site-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  width: 100%;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.12));
}

.dp-agenda-multi-site-row:last-child {
  border-bottom: none;
}

.dp-agenda-multi-site-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 180px;
  min-width: 140px;
}

.dp-agenda-site-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="light"] .dp-agenda-site-title {
  color: #0f172a;
}

.dp-agenda-multi-site-slacks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 300px;
}

.dp-agenda-slack-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  background: var(--surface-sunken, rgba(15, 23, 42, 0.25));
  border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.15));
  border-radius: var(--radius-sm, 6px);
  padding: 4px 8px;
}

[data-theme="light"] .dp-agenda-slack-item {
  background: #f8fafc;
  border-color: #e2e8f0;
}

/* ============================================================================
   Circular "UKSEAS / PREVIEW" Watermark Seal (Free / Guest Tier)
   ============================================================================ */
body.is-pro-tier .ukseas-preview-seal {
  display: none !important;
}

.ukseas-preview-seal {
  pointer-events: none;
  user-select: none;
}

.ukseas-preview-seal--planner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8;
  color: #0f172a;
  opacity: 0.10;
}

[data-theme="dark"] .month-grid-wrapper .is-agenda-view .ukseas-preview-seal--planner {
  color: #94a3b8;
  opacity: 0.09;
}

.ukseas-preview-seal--planner .ukseas-preview-seal-svg {
  width: min(240px, 52%);
  height: auto;
  flex-shrink: 0;
}

.ukseas-preview-seal--detail {
  position: sticky;
  top: 165px;
  height: 0;
  margin-bottom: -16px;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  color: #94a3b8;
  opacity: 0.085;
}

[data-theme="light"] .ukseas-preview-seal--detail {
  color: #0f172a;
  opacity: 0.065;
}

.ukseas-preview-seal--detail .ukseas-preview-seal-svg,
.ukseas-preview-seal--briefing .ukseas-preview-seal-svg {
  width: 200px;
  height: 200px;
  flex-shrink: 0;
}

.ukseas-preview-seal--briefing {
  position: sticky;
  top: 155px;
  height: 0;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  color: #0f172a;
  opacity: 0.065;
}

.ukseas-preview-seal--curve {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  color: #94a3b8;
  opacity: 0.08;
}

[data-theme="light"] .ukseas-preview-seal--curve {
  color: #0f172a;
  opacity: 0.065;
}

.ukseas-preview-seal--curve .ukseas-preview-seal-svg {
  width: 210px;
  height: 210px;
  flex-shrink: 0;
}

.ukseas-preview-seal--table {
  position: sticky;
  top: 145px;
  left: 0;
  height: 0;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  color: #0f172a;
  opacity: 0.09;
}

[data-theme="dark"] .ukseas-preview-seal--table {
  color: #94a3b8;
  opacity: 0.095;
}

.ukseas-preview-seal--table .ukseas-preview-seal-svg {
  width: 210px;
  height: 210px;
  flex-shrink: 0;
}
