:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2937;
  background: #f5f7fb;
  --hour-height: 60px;
  --time-axis-width: 76px;
  --day-width: 200px;
  --event-area-width: 140px;
  --header-height: 54px;
  --all-day-height: 30px;
}

* { box-sizing: border-box; }

body { margin: 0; min-height: 100vh; }

.calendar-flow-cloud-status {
  border: 1px solid #d1d5db;
  border-radius: 999px;
  color: #6b7280;
  display: inline-flex;
  font-size: 12px;
  line-height: 1;
  padding: 5px 8px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-flow-cloud-status[data-state="loading"],
.calendar-flow-cloud-status[data-state="saving"] {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.calendar-flow-cloud-status[data-state="saved"] {
  border-color: #86efac;
  color: #15803d;
}

.calendar-flow-cloud-status[data-state="failed"],
.calendar-flow-cloud-status[data-state="blocked"] {
  border-color: #fca5a5;
  color: #b91c1c;
}

button, input { font: inherit; }

button {
  border: 0;
  border-radius: 9px;
  padding: 10px 14px;
  cursor: pointer;
  background: #111827;
  color: white;
}

button:disabled { opacity: .45; cursor: not-allowed; }

button.secondary {
  background: white;
  color: #111827;
  border: 1px solid #d1d5db;
}

button.danger { color: #b91c1c; }

.full { width: 100%; }

.app-account-menu-v316 {
  margin-left: auto;
  position: relative;
}

.app-account-menu-v316 > button {
  border: 0;
  background: transparent;
  border-radius: 5px;
  color: inherit;
  font: inherit;
  padding: 4px 8px;
  white-space: nowrap;
}

.app-account-menu-v316 > button:hover,
.app-account-menu-v316 > button[aria-expanded="true"] {
  background: #e7eaf0;
}

.account-menu-popover-v316 {
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  z-index: 13000;
  width: min(320px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
  padding: 12px;
}

.account-menu-popover-v316 h2 {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.25;
  color: #111827;
}

.account-menu-section-v316 {
  display: grid;
  gap: 3px;
  padding: 9px 0;
  border-top: 1px solid #eef2f7;
}

.account-menu-label-v316 {
  color: #6b7280;
  font-size: 11px;
  line-height: 1.2;
}

.account-menu-email-v316 {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #111827;
  font-size: 13px;
  line-height: 1.35;
}

.account-menu-state-v316 {
  color: #4b5563;
  font-size: 12px;
  line-height: 1.25;
}

.account-menu-actions-v316 {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}

.account-menu-settings-link-v316 {
  display: inline-flex;
  align-items: center;
  color: #1d4ed8;
  font-size: 12px;
  text-decoration: none;
}

.account-menu-settings-link-v316:focus,
.account-menu-settings-link-v316:hover {
  text-decoration: underline;
}

.layout {
  height: calc(100vh - 30px);
  display: grid;
  grid-template-columns: 310px 1fr;
}

.sidebar {
  overflow: auto;
  padding: 14px;
  border-right: 1px solid #e5e7eb;
  background: #f9fafb;
}

.panel {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.panel h2 { margin: 0 0 12px; font-size: 14px; }

label {
  display: block;
  font-size: 12px;
  color: #4b5563;
  margin-bottom: 10px;
}

input[type="text"],
input[type="date"],
input[type="number"],
input:not([type]) {
  margin-top: 4px;
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 9px 10px;
  background: white;
}

input[type="range"] {
  width: 100%;
  margin-top: 8px;
}

.hint, .muted { color: #6b7280; font-size: 12px; line-height: 1.45; }

.calendar-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 7px 0;
  border-bottom: 1px solid #f3f4f6;
}

.calendar-item:last-child { border-bottom: 0; }
.calendar-item input { width: auto; margin-top: 2px; }
.calendar-name { font-size: 13px; line-height: 1.35; }

.workspace-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.workspace-toolbar {
  height: 44px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 12px;
  color: #6b7280;
}

.workspace {
  position: relative;
  flex: 1;
  overflow: auto;
  background: white;
}

.calendar-canvas {
  position: relative;
  min-width: calc(var(--time-axis-width) + var(--day-width));
  min-height: calc(var(--header-height) + var(--all-day-height) + 24 * var(--hour-height));
  background: white;
}

.header-corner {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 8;
  width: var(--time-axis-width);
  height: var(--header-height);
  background: white;
  border-right: 1px solid #dfe4ec;
  border-bottom: 1px solid #dfe4ec;
}

.days-header {
  position: sticky;
  top: 0;
  left: var(--time-axis-width);
  z-index: 7;
  height: var(--header-height);
  margin-left: var(--time-axis-width);
  display: grid;
  background: white;
  border-bottom: 1px solid #dfe4ec;
}

.day-header-cell {
  min-width: var(--day-width);
  border-right: 1px solid #dfe4ec;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  color: #374151;
  font-size: 12px;
}

.day-header-cell strong {
  font-size: 16px;
  font-weight: 650;
}

.all-day-label {
  position: sticky;
  left: 0;
  z-index: 6;
  width: var(--time-axis-width);
  height: var(--all-day-height);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 10px 8px 0 0;
  color: #6b7280;
  font-size: 11px;
  background: white;
  border-right: 1px solid #dfe4ec;
  border-bottom: 1px solid #dfe4ec;
}

.all-day-area {
  position: absolute;
  top: var(--header-height);
  left: var(--time-axis-width);
  height: var(--all-day-height);
  display: grid;
  border-bottom: 1px solid #dfe4ec;
  background: #fbfcfe;
}

.all-day-column {
  position: relative;
  min-width: var(--day-width);
  border-right: 1px solid #dfe4ec;
  overflow: hidden;
  padding: 4px;
}

.time-axis {
  position: absolute;
  top: calc(var(--header-height) + var(--all-day-height));
  left: 0;
  width: var(--time-axis-width);
  height: calc(24 * var(--hour-height));
  background: white;
  border-right: 1px solid #dfe4ec;
}

.time-label {
  position: absolute;
  right: 8px;
  transform: translateY(-7px);
  color: #6b7280;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.time-grid {
  position: absolute;
  top: calc(var(--header-height) + var(--all-day-height));
  left: var(--time-axis-width);
  height: calc(24 * var(--hour-height));
  display: grid;
  background-image:
    repeating-linear-gradient(
      to bottom,
      #dfe4ec 0,
      #dfe4ec 1px,
      transparent 1px,
      transparent var(--hour-height)
    );
}

.day-column {
  position: relative;
  min-width: var(--day-width);
  border-right: 1px solid #dfe4ec;
}

.day-column::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(var(--hour-height) / 2 - 1px),
      #f0f2f6 calc(var(--hour-height) / 2 - 1px),
      #f0f2f6 calc(var(--hour-height) / 2)
    );
  pointer-events: none;
}

.event-card {
  position: absolute;
  border: 1px solid rgba(0,0,0,.08);
  border-left: 4px solid var(--calendar-color, #6b7280);
  border-radius: 6px;
  background: color-mix(in srgb, var(--calendar-color, #6b7280) 16%, white);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(17,24,39,.08);
  z-index: 4;
}

.timed-event {
  min-height: 20px;
  padding: 4px 18px 4px 6px;
}

.all-day-event {
  position: relative;
  left: auto !important;
  top: auto !important;
  width: 100% !important;
  min-height: 24px;
  margin-bottom: 3px;
  padding: 3px 18px 3px 6px;
}

.event-title {
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-time {
  margin-top: 2px;
  font-size: 10px;
  color: #4b5563;
  white-space: nowrap;
}

.connector {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 999px;
  border: 2px solid #111827;
  background: white;
  cursor: crosshair;
  z-index: 6;
}

.event-card.link-target {
  outline: 2px solid #111827;
  outline-offset: 1px;
}

.link-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: visible;
}

.link-path {
  fill: none;
  stroke: #111827;
  stroke-width: 2;
}

.link-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 16;
  pointer-events: stroke;
  cursor: pointer;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 270px 1fr; }
}

@media (max-width: 760px) {
  .layout {
    height: auto;
    min-height: calc(100vh - 30px);
  }
}


.workspace-toolbar {
  gap: 12px;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 5px;
}

.toolbar-left {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

button.small {
  padding: 6px 10px;
  font-size: 12px;
}

.toolbar-date-control,
.toolbar-scale-control {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  margin: 0;
  white-space: nowrap;
}

.toolbar-scale-control {
  font-size: 0;
  gap: 0;
}

.toolbar-scale-control select {
  font-size: 12px;
}

.toolbar-date-control input,
.toolbar-range-select-v327,
.toolbar-scale-control select {
  height: 28px;
  margin: 0;
  min-width: 0;
  padding: 3px 7px;
}

.toolbar-date-control input {
  width: 124px;
}

.toolbar-range-select-v327 {
  width: 70px;
}

.calendar-flow-range-source-v327 {
  display: none;
}

.toolbar-compact-command-v327 {
  min-width: 30px;
  padding-left: 7px !important;
  padding-right: 7px !important;
}

.toolbar-divider-v327 {
  align-self: stretch;
  border-left: 1px solid #e5e7eb;
  margin: 6px 1px;
}

.calendar-flow-hidden-controls-v327,
.calendar-flow-live-region-v327 {
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.event-card.editable {
  cursor: grab;
}

.event-card.dragging {
  opacity: .72;
  cursor: grabbing;
}

.event-card.locked {
  cursor: default;
}

.lock-icon {
  position: absolute;
  right: 18px;
  top: 3px;
  font-size: 10px;
  z-index: 7;
}

.resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  cursor: ns-resize;
  z-index: 7;
}

.event-card.locked .resize-handle {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(17,24,39,.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: white;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(17,24,39,.28);
  padding: 18px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
}

.modal textarea,
.modal select,
.modal input[type="text"],
.modal input[type="date"],
.modal input[type="datetime-local"] {
  width: 100%;
  margin-top: 4px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 9px 10px;
  background: white;
  font: inherit;
}

.inline-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-label input {
  width: auto;
  margin: 0;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.modal-actions-right {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.lock-notice {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.45;
}

/* v2.5: 終日欄の自動伸縮 */
.all-day-area { overflow: hidden; }

.all-day-column {
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}

.all-day-column::-webkit-scrollbar { width: 6px; }

.all-day-column::-webkit-scrollbar-thumb {
  background: rgba(107, 114, 128, .35);
  border-radius: 999px;
}

.all-day-column::-webkit-scrollbar-track { background: transparent; }


/* v2.6: 日付ヘッダーと終日欄を1つのstickyグリッドとして配置。
   v2.5では headerCorner / daysHeader / allDayLabel が通常フローを占有しつつ、
   allDayAreaだけabsoluteだったため、終日予定の先頭行が日付ヘッダーの下に
   隠れ、左上に不要な白い矩形が発生していた。 */
.calendar-sticky-header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  height: calc(var(--header-height) + var(--all-day-height));
  display: grid;
  grid-template-columns: var(--time-axis-width) 1fr;
  grid-template-rows: var(--header-height) var(--all-day-height);
  background: white;
}

.header-corner {
  position: relative;
  top: auto;
  left: auto;
  z-index: auto;
  grid-column: 1;
  grid-row: 1;
  width: auto;
  height: auto;
  margin: 0;
  background: white;
}

.days-header {
  position: relative;
  top: auto;
  left: auto;
  z-index: auto;
  grid-column: 2;
  grid-row: 1;
  height: auto;
  margin-left: 0;
  background: white;
}

.all-day-label {
  position: relative;
  top: auto;
  left: auto;
  z-index: auto;
  grid-column: 1;
  grid-row: 2;
  width: auto;
  height: auto;
  margin: 0;
  padding: 8px 8px 0 0;
  background: #fbfcfe;
}

.all-day-area {
  position: relative;
  top: auto;
  left: auto;
  z-index: auto;
  grid-column: 2;
  grid-row: 2;
  height: auto;
  align-self: stretch;
  background: #fbfcfe;
}

/* 先頭予定が上端で欠けないよう、必要高さの計算と同じ余白を維持する。 */
.all-day-column {
  padding-top: 4px;
  padding-bottom: 4px;
}


/* =========================================================
   Calendar Flow v2.7
   Definitive all-day/header layout override.
   ========================================================= */

:root {
  --all-day-height: 30px;
}

/* Header + all-day area are one sticky two-row grid. */
.calendar-sticky-header {
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 20 !important;
  display: grid !important;
  grid-template-columns: var(--time-axis-width) 1fr !important;
  grid-template-rows: var(--header-height) var(--all-day-height) !important;
  width: 100% !important;
  height: calc(var(--header-height) + var(--all-day-height)) !important;
  background: #fff !important;
  overflow: visible !important;
}

/* Remove legacy independent sticky/absolute positioning. */
.header-corner {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  z-index: auto !important;
  background: #fff !important;
}

.days-header {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  grid-column: 2 !important;
  grid-row: 1 !important;
  width: auto;
  height: var(--header-height) !important;
  margin: 0 !important;
  z-index: auto !important;
  background: #fff !important;
}

.all-day-label {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  grid-column: 1 !important;
  grid-row: 2 !important;
  width: auto !important;
  height: var(--all-day-height) !important;
  margin: 0 !important;
  padding: 8px 8px 0 0 !important;
  z-index: auto !important;
  background: #fbfcfe !important;
  border-right: 1px solid var(--grid-line) !important;
  border-bottom: 1px solid var(--grid-line) !important;
  box-sizing: border-box !important;
}

.all-day-area {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  grid-column: 2 !important;
  grid-row: 2 !important;
  width: auto;
  height: var(--all-day-height) !important;
  margin: 0 !important;
  z-index: auto !important;
  align-self: stretch !important;
  background: #fbfcfe !important;
  overflow: hidden !important;
}

/* The first all-day item must start inside the visible row, not under header. */
.all-day-column {
  position: relative !important;
  height: 100% !important;
  min-height: 0 !important;
  padding: 4px 4px !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

/* Preserve per-column scrolling enabled by JS for 6+ all-day events. */
.all-day-column[style*="overflow-y: auto"] {
  overflow-y: auto !important;
}


/* =========================================================
   Calendar Flow v2.8
   関連線をカレンダーUI全体の最前面へ
   ========================================================= */
.link-layer {
  position: absolute !important;
  inset: 0 !important;
  z-index: 9999 !important;
  pointer-events: none !important;
  overflow: visible !important;
}

.link-path {
  z-index: 10000;
}

.link-hit {
  z-index: 10001;
  pointer-events: stroke !important;
  cursor: pointer !important;
}

/* SVGレイヤー全体を最前面に置くため、矢印ヘッドも同じ前面レイヤーで表示される */
.link-layer path,
.link-layer line,
.link-layer polyline {
  vector-effect: non-scaling-stroke;
}


/* =========================================================
   Calendar Flow v2.9
   Layer order:
   calendar/header/all-day/time grid < arrows < event boxes
   ========================================================= */

/* Arrow layer is above calendar structure. */
.link-layer {
  position: absolute !important;
  inset: 0 !important;
  z-index: 9999 !important;
  pointer-events: none !important;
  overflow: visible !important;
}

.link-hit {
  pointer-events: stroke !important;
  cursor: pointer !important;
}

/* Event boxes must remain above arrows. */
.event-card {
  position: relative;
  z-index: 10010 !important;
}

/* Connector handles are part of the event UI and stay topmost. */
.event-card .connector {
  position: absolute;
  z-index: 10011 !important;
}

/* Sticky header container itself must not create a layer above the arrows.
   Its background cells remain below the SVG; event cards inside all-day
   columns are explicitly raised above the SVG by .event-card. */
.calendar-sticky-header {
  z-index: 20 !important;
}


/* =========================================================
   Calendar Flow v2.10
   Global stacking order:
   1 calendar structure
   2 event boxes
   3 arrow layer
   4 modal
   ========================================================= */

/* 1: calendar structure */
.calendar-sticky-header {
  z-index: 10 !important;
}

/* 2: event boxes */
.event-card {
  position: relative !important;
  z-index: 100 !important;
}
.event-card .connector {
  z-index: 101 !important;
}

/* 3: arrows */
.link-layer {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1000 !important;
  pointer-events: none !important;
  overflow: visible !important;
}
.link-hit {
  pointer-events: stroke !important;
  cursor: pointer !important;
}

/* 4: edit/create modal.
   The modal root itself must establish the top-level stacking context;
   raising only .modal-card is insufficient when SVG has a high z-index. */
.modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10000 !important;
}
.modal-backdrop {
  z-index: 0 !important;
}
.modal-card {
  position: relative !important;
  z-index: 1 !important;
}


/* =========================================================
   Calendar Flow v2.11
   Correct global stacking order.

   DOM:
   #eventModal.modal-backdrop   <- modal root
      .modal                    <- white dialog panel

   v2.10 incorrectly treated .modal as the modal root and set
   .modal-backdrop to z-index:0. That allowed the SVG arrow layer
   to render above the edit dialog.
   ========================================================= */

/* 1. Calendar structure: backmost */
.calendar-sticky-header,
.days-header,
.header-corner,
.all-day-label,
.all-day-area,
.time-axis,
.time-grid {
  z-index: 10 !important;
}

/* 2. Event boxes */
.event-card {
  z-index: 100 !important;
}
.event-card .connector,
.event-card .lock-icon,
.event-card .resize-handle {
  z-index: 110 !important;
}

/* 3. Arrow layer */
.link-layer {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1000 !important;
  pointer-events: none !important;
  overflow: visible !important;
}
.link-hit {
  pointer-events: stroke !important;
  cursor: pointer !important;
}

/* 4. Modal root: frontmost */
.modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10000 !important;
  background: rgba(17,24,39,.42) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px !important;
}

/* Preserve hidden behavior despite display:flex !important above */
.modal-backdrop[hidden] {
  display: none !important;
}

/* Dialog panel itself is NOT the root stacking layer. */
.modal {
  position: relative !important;
  inset: auto !important;
  z-index: 1 !important;
  width: min(560px, 100%) !important;
  max-height: calc(100vh - 48px) !important;
  overflow: auto !important;
  background: white !important;
  border-radius: 14px !important;
  box-shadow: 0 24px 60px rgba(17,24,39,.28) !important;
  padding: 18px !important;
}

/* v2.10 referenced a non-existent .modal-card; neutralize if ever introduced. */
.modal-card {
  position: relative !important;
  z-index: 1 !important;
}


/* v2.16: snapped event dragging */
.event-card.dragging {
  z-index: 500 !important;
  pointer-events: none;
  will-change: transform;
  transition: none !important;
}


/* =========================================================
   Calendar Flow v2.19
   Time-axis alignment + sticky date header
   ========================================================= */

/*
 * Timed events must be positioned absolutely inside each day column.
 * A legacy global stacking override changed .event-card to
 * position:relative!important, so each timed box still occupied normal
 * document flow and its "top" offset was added after previous boxes.
 * That made the box's UI position disagree with its displayed event time.
 */
.timed-event {
  position: absolute !important;
}

/* All-day events intentionally remain in normal flow. */
.all-day-event {
  position: relative !important;
}

/*
 * Keep the date header/all-day header fixed at the top of the scrollable
 * calendar while the time grid scrolls vertically.
 */
.calendar-sticky-header {
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 2000 !important;
  background: #fff !important;
}

/* Keep header cells opaque/readable while events and relation lines move below. */
.header-corner,
.days-header,
.day-header-cell,
.all-day-label,
.all-day-area {
  background-clip: padding-box;
}

.days-header,
.header-corner {
  background: #fff !important;
}


/* =========================================================
   Calendar Flow v2.20
   Google Calendar-style fixed header + timed-body scrolling
   ========================================================= */

/* The outer workspace itself no longer scrolls. */
.workspace {
  overflow: hidden !important;
  min-height: 0;
}

/* Fill the available workspace below the toolbar. */
.calendar-canvas {
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  background: #fff;
}

/* Fixed header viewport: date header + all-day row never scroll vertically. */
.calendar-header-viewport {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--header-height) + var(--all-day-height));
  overflow: hidden;
  z-index: 2000;
  background: #fff;
  border-bottom: 1px solid #dfe4ec;
}

/*
 * This is now ordinary header content inside a non-scrolling viewport.
 * Horizontal position is synchronized from JS with the timed body scroll.
 */
.calendar-sticky-header {
  position: relative !important;
  top: 0 !important;
  left: 0 !important;
  height: calc(var(--header-height) + var(--all-day-height)) !important;
  transform: translateX(0);
  will-change: transform;
}

/* ONLY this region scrolls vertically (and horizontally when necessary). */
.calendar-body-viewport {
  position: absolute;
  top: calc(var(--header-height) + var(--all-day-height));
  left: 0;
  right: 0;
  bottom: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: #fff;
}

/* 24-hour body coordinate system. */
.calendar-body-canvas {
  position: relative;
  min-width: calc(var(--time-axis-width) + var(--day-width));
  min-height: calc(24 * var(--hour-height));
  background: #fff;
}

/* Time axis and event grid start at 00:00 inside the scrolling body. */
.time-axis {
  top: 0 !important;
}

.time-grid {
  top: 0 !important;
}

/* Relationship lines use the same body coordinate system. */
.link-layer {
  top: 0 !important;
  left: 0 !important;
}

/* Toolbar remains outside the scrolling body and therefore fixed. */
.workspace-toolbar {
  flex: 0 0 44px;
  position: relative;
  z-index: 3000;
}


/* =========================================================
   Calendar Flow v2.21
   ========================================================= */

.sidebar select {
  width: 100%;
}

.period-label {
  flex: 0 1 210px;
  min-width: 120px;
  max-width: 210px;
  font-weight: 600;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-relations {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #dfe4ec;
  border-radius: 8px;
  background: #f8fafc;
}

.link-relations h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.relation-group + .relation-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #dfe4ec;
}

.relation-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.relation-list {
  display: grid;
  gap: 5px;
  margin-bottom: 7px;
}

.relation-item {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}

.relation-item span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.relation-empty {
  padding: 5px 0;
  color: #9ca3af;
  font-size: 12px;
}

.relation-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.relation-add-row input[type="date"] {
  flex: 1;
}

.link-selection-mode .event-card {
  cursor: crosshair !important;
  outline: 2px solid transparent;
}

.link-selection-mode .event-card:hover {
  outline-color: #2563eb;
  filter: brightness(0.98);
}

.link-selection-mode .connector,
.link-selection-mode .resize-handle {
  pointer-events: none !important;
}

.settings-modal {
  width: min(560px, calc(100vw - 32px));
}

#timeZoneSelect {
  max-height: 280px;
}

#dateFrom[readonly] {
  background: #f8fafc;
  color: #475569;
}

@media (max-width: 1100px) {
  .period-label {
    min-width: 0;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}


/* =========================================================
   Calendar Flow v2.22
   ========================================================= */

/*
 * Link SVG is now a viewport-wide overlay, outside the scrolling time body.
 * This lets a line connect timed events and fixed all-day events without
 * disappearing behind the fixed header.
 */
.calendar-link-overlay {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 2600 !important;
  overflow: visible !important;
  pointer-events: none !important;
}

.calendar-link-overlay .link-path {
  pointer-events: none;
}

.calendar-link-overlay .link-hit {
  pointer-events: stroke;
}

/* Fixed header stays above the grid, but arrows are intentionally above it. */
.calendar-header-viewport {
  z-index: 2000 !important;
}

.calendar-sticky-header,
.days-header,
.header-corner,
.all-day-label,
.all-day-area {
  z-index: 2000 !important;
}

/* Event boxes remain below the relationship arrows. */
.event-card {
  z-index: 100 !important;
}

/* Toolbar must remain operable above the arrow overlay. */
.workspace-toolbar {
  z-index: 3000 !important;
}

.selection-cancel-btn {
  border-color: #b91c1c !important;
  color: #b91c1c !important;
  background: #fff !important;
}

.selection-cancel-btn:hover {
  background: #fef2f2 !important;
}


/* =========================================================
   Calendar Flow v2.23
   Current time / past shading / today emphasis
   ========================================================= */

.past-shade-layer,
.current-time-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.past-shade-layer {
  z-index: 15;
}

.current-time-layer {
  z-index: 170;
}

.past-shade {
  position: absolute;
  background: rgba(148, 163, 184, 0.14);
  pointer-events: none;
}

/* Events remain fully readable above the past-time wash. */
.timed-event {
  z-index: 100 !important;
}

.current-time-line {
  position: absolute;
  height: 2px;
  background: #d93025;
  transform: translateY(-1px);
  pointer-events: none;
  z-index: 171;
}

.current-time-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #d93025;
}

.today-header-cell strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  border-radius: 999px;
  background: #1a73e8;
  color: white;
  font-size: 18px;
  line-height: 1;
}

.today-header-cell span {
  color: #1a73e8;
  font-weight: 700;
}


/* =========================================================
   Calendar Flow v2.24
   Link z-order / hover connector / configurable arrow style
   ========================================================= */

:root {
  --link-color: #111827;
  --link-width: 2px;
}

/*
 * Required stacking order:
 *   date header text > arrows > all-day event boxes > grid
 *
 * The link overlay sits above the all-day area but below day-header content.
 */
.calendar-link-overlay {
  z-index: 2300 !important;
}

.calendar-header-viewport {
  z-index: 2000 !important;
}

/* Keep only the date header cells above arrows. */
.days-header,
.day-header-cell,
.header-corner {
  position: relative !important;
  z-index: 2400 !important;
}

/* All-day area + all-day event boxes remain below arrows. */
.all-day-label,
.all-day-area {
  position: relative !important;
  z-index: 2100 !important;
}

.all-day-event {
  z-index: 2150 !important;
}

/* Connector dots are hidden until the pointer is over the event box. */
.event-card .connector {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 120ms ease;
}

.event-card:hover .connector {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.event-card.locked:hover .connector {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Link selection mode must not expose draggable connector dots. */
.link-selection-mode .event-card:hover .connector {
  opacity: 0 !important;
  pointer-events: none !important;
}

.link-path {
  stroke: var(--link-color);
  stroke-width: var(--link-width);
}

#linkColorInput {
  width: 64px;
  min-height: 36px;
  padding: 2px;
}


/* =========================================================
   Calendar Flow v2.25
   Declined-event visibility / header stacking / live time
   ========================================================= */

.settings-checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.settings-checkbox-row input[type="checkbox"] {
  width: auto;
  margin: 0;
}

/* Every visible date header is above the link overlay. */
.days-header {
  position: relative !important;
  z-index: 2400 !important;
}

.calendar-date-header {
  position: relative !important;
  z-index: 2410 !important;
  background: var(--surface, #fff);
}

.calendar-date-header.today-header-cell {
  z-index: 2420 !important;
}

/* Required order: date headers > links > all-day events > grid */
.calendar-link-overlay {
  z-index: 2300 !important;
}

.all-day-area,
.all-day-label {
  z-index: 2100 !important;
}

.all-day-event {
  z-index: 2150 !important;
}


/* =========================================================
   Calendar Flow v2.26
   Precise stacking + creation defaults
   ========================================================= */

/*
 * Do not make the fixed header a single stacking context.
 * This allows date headers, connector handles, link lines and all-day boxes
 * to interleave in the required global order.
 */
.calendar-header-viewport {
  z-index: auto !important;
  overflow-x: hidden !important;
}

.calendar-sticky-header {
  transform: none !important;
}

/* Required order:
   date header > connector handle > arrow line > all-day event > time grid
*/
.days-header,
.calendar-date-header,
.day-header-cell,
.header-corner {
  position: relative !important;
  z-index: 2500 !important;
}

.calendar-link-overlay {
  z-index: 2300 !important;
}

.all-day-label,
.all-day-area {
  z-index: auto !important;
}

.all-day-event {
  z-index: auto !important;
}

.event-card .connector {
  position: absolute !important;
  z-index: 2450 !important;
}

/* A connector must be able to rise above the link overlay without lifting
   the whole all-day event box above the line. */
.event-card {
  isolation: visible !important;
}

.time-grid {
  z-index: 1 !important;
}


/* =========================================================
   Calendar Flow v2.28
   Declined-event fix / connector z-order without drag regression
   ========================================================= */

/*
 * Required visual order:
 *   date header > connector dot > arrow line > all-day event > time grid
 */
.days-header,
.calendar-date-header,
.day-header-cell,
.header-corner {
  position: relative !important;
  z-index: 2500 !important;
}

.connector-hover-overlay {
  position: fixed;
  width: 12px;
  height: 12px;
  border: 2px solid var(--link-color, #111827);
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  z-index: 2450;
  pointer-events: none;
  box-sizing: border-box;
}

.connector-hover-overlay[hidden] {
  display: none !important;
}

/* Keep the original connector as the actual pointer/drag target but make only
   the body-level overlay visible. */
.event-card .connector {
  opacity: 0 !important;
}

.calendar-link-overlay {
  z-index: 2300 !important;
}

.all-day-event {
  z-index: auto !important;
}

.time-grid {
  z-index: 1 !important;
}


/* =========================================================
   Calendar Flow v2.29
   Reliable timed-event dragging
   ========================================================= */

.timed-event.event-card.editable {
  cursor: grab !important;
  touch-action: none;
  user-select: none;
}

.timed-event.event-card.dragging {
  cursor: grabbing !important;
  will-change: transform;
}

/* Calendar Flow v2.30: initialization-order regression fix. */


/* Calendar Flow v2.32
   Hovered direct relation: both arrowhead and the entire connecting line are Black. */
.calendar-link-overlay path.relation-highlighted {
  stroke: #000000 !important;
}


/* Calendar Flow v2.33:
   hover highlight propagates through all reachable connected relations
   in both source and destination directions. */


/* =========================================================
   Calendar Flow v2.34
   Task status + event modal top actions
   ========================================================= */

.event-modal-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.event-modal-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.event-modal-header h2 {
  margin: 0;
  text-align: center;
}

.event-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}

.event-status-label {
  font-weight: 600;
}

.event-status-buttons {
  display: inline-flex;
  gap: 6px;
}

.status-toggle {
  min-width: 64px;
  padding: 6px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  cursor: pointer;
}

.status-toggle.active {
  border-color: #111827;
  background: #111827;
  color: #fff;
}


/* =========================================================
   Calendar Flow v2.35
   X-only auto-save / status below Flow Link
   ========================================================= */

.event-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.event-modal-header h2 {
  flex: 1;
  margin: 0;
  text-align: left;
}

.event-status-label {
  font-weight: 400 !important;
}

.event-status-row {
  margin-top: 14px;
  margin-bottom: 16px;
}


/* =========================================================
   Calendar Flow v2.38
   DRAKON-style orthogonal routing
   ========================================================= */

.settings-unit {
  display: inline-block;
  margin-top: 4px;
  margin-left: 4px;
  color: #6b7280;
  font-size: 11px;
}


.calendar-link-overlay .orthogonal-link {
  fill: none;
  stroke-linejoin: miter;
  stroke-linecap: square;
}


/* v2.39 link z-order */
.calendar-link-overlay {
  z-index: 3 !important;
}

.timed-event,
.all-day-event {
  z-index: 4 !important;
}

.relation-foreground-overlay {
  position: absolute;
  inset: 0;
  z-index: 6 !important;
  overflow: visible;
  pointer-events: none !important;
}

.relation-foreground-overlay .link-hit {
  pointer-events: none !important;
}


/* v2.40: normal links behind event cards; hovered direct links in front. */
.calendar-link-overlay:not(.relation-foreground-overlay) {
  z-index: 3 !important;
}

.timed-event,
.all-day-event {
  z-index: 4 !important;
}

.relation-foreground-overlay {
  z-index: 6 !important;
  pointer-events: none !important;
}


/* =========================================================
   Calendar Flow v2.41
   Link stacking model
   ========================================================= */

/*
  Normal state:
    time grid / all-day grid
      -> gray link SVG
      -> event boxes

  Hover state:
    event boxes
      -> foreground SVG containing only directly-related black links

  Explicit isolation on the canvas makes these z-index values comparable.
*/
.calendar-canvas {
  isolation: isolate;
}

.calendar-link-overlay:not(.relation-foreground-overlay) {
  z-index: 2 !important;
}

.day-column,
.all-day-column {
  z-index: 1;
}

.timed-event,
.all-day-event,
.event-card {
  z-index: 4 !important;
}

.relation-foreground-overlay {
  z-index: 8 !important;
  pointer-events: none !important;
}

.relation-foreground-overlay .link-path {
  pointer-events: none !important;
}


/* =========================================================
   Calendar Flow v2.42
   Correct normal-link stacking
   ========================================================= */

/*
  Important:
  day columns must NOT create their own stacking context.
  Otherwise an event-card z-index cannot rise above the normal link SVG.
*/
.day-column,
.all-day-column {
  z-index: auto !important;
}

/* Gray links: above the calendar grid, below event boxes. */
.calendar-link-overlay:not(.relation-foreground-overlay) {
  z-index: 2 !important;
}

/* Event boxes can now participate in the canvas stacking context directly. */
.timed-event,
.all-day-event,
.event-card {
  position: absolute;
  z-index: 4 !important;
}

/* All-day boxes keep their layout positioning behavior. */
.all-day-event {
  position: relative !important;
}

/* Only hovered direct links are promoted above boxes. */
.relation-foreground-overlay {
  z-index: 8 !important;
  pointer-events: none !important;
}


/* =========================================================
   Calendar Flow v2.43
   Definitive normal-link / event-card stacking fix
   ========================================================= */

/*
  v2.42 removed the day-column stacking context, but .time-grid itself
  still had z-index:1, so every timed event remained trapped inside that
  stacking context beneath the normal link SVG (z-index:2).

  Remove the time-grid stacking context as well. Event cards can then
  participate directly in the calendar-canvas stacking order.
*/
.time-grid {
  z-index: auto !important;
}

/* Normal gray relationship lines */
.calendar-link-overlay:not(.relation-foreground-overlay) {
  z-index: 2 !important;
}

/* Event cards must cover normal gray lines wherever they overlap. */
.timed-event,
.all-day-event,
.event-card {
  z-index: 4 !important;
}

/* Hovered direct links alone are promoted over event cards. */
.relation-foreground-overlay {
  z-index: 8 !important;
  pointer-events: none !important;
}


/* =========================================================
   Calendar Flow v2.52 — DRAKON branches + strict participant lock
   ========================================================= */
.timed-event.event-card {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
  min-height: 1px !important;
}
.timed-event .flow-shape-body {
  position: absolute !important;
  display: block !important;
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  box-sizing: border-box !important;
  background: color-mix(in srgb, var(--calendar-color) 16%, white) !important;
  border: 1px solid color-mix(in srgb, var(--calendar-color) 72%, #111827) !important;
  border-left: 4px solid var(--calendar-color) !important;
  border-radius: 4px;
  overflow: hidden !important;
  z-index: 3 !important;
  padding: 3px 6px;
}
.timed-event .duration-stem {
  display: block !important;
  position: absolute !important;
  top: 42px !important;
  bottom: 0 !important;
  left: 50% !important;
  width: 2px !important;
  transform: translateX(-50%);
  background: var(--calendar-color) !important;
  z-index: 1 !important;
  pointer-events: none !important;
}
.timed-event .duration-end {
  display: block !important;
  position: absolute !important;
  bottom: -3px !important;
  left: 50% !important;
  width: 7px !important;
  height: 7px !important;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--calendar-color) !important;
  z-index: 2 !important;
  pointer-events: none !important;
}
/* When an event is shorter than the fixed Shape, do not draw a reversed stem. */
.timed-event[style*="height: 18px"] .duration-stem { display: none !important; }

.all-day-event.event-card {
  background: transparent !important;
  border: 0 !important;
  overflow: visible !important;
}
.all-day-event .flow-shape-body {
  position: absolute !important;
  inset: 0 !important;
  box-sizing: border-box !important;
  background: color-mix(in srgb, var(--calendar-color) 16%, white) !important;
  border: 1px solid color-mix(in srgb, var(--calendar-color) 72%, #111827) !important;
  border-left: 4px solid var(--calendar-color) !important;
  overflow: hidden !important;
  padding: 2px 6px;
}
.flow-shape-question .flow-shape-body {
  border-left: 1px solid color-mix(in srgb, var(--calendar-color) 72%, #111827) !important;
  border-radius: 0 !important;
  clip-path: polygon(9% 0, 91% 0, 100% 50%, 91% 100%, 9% 100%, 0 50%);
  padding-left: 10% !important;
  padding-right: 10% !important;
}
.flow-shape-choice .flow-shape-body {
  border-left: 1px solid color-mix(in srgb, var(--calendar-color) 72%, #111827) !important;
  border-radius: 0 !important;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  padding-left: 22% !important;
  padding-right: 22% !important;
  text-align: center;
}
.flow-shape-insertion .flow-shape-body {
  border-left: 5px double var(--calendar-color) !important;
  border-right: 5px double var(--calendar-color) !important;
}
.flow-shape-simple-input .flow-shape-body {
  border-left: 1px solid color-mix(in srgb, var(--calendar-color) 72%, #111827) !important;
  border-radius: 0 !important;
  clip-path: polygon(7% 0, 100% 0, 93% 100%, 0 100%);
  padding-left: 8% !important;
  padding-right: 8% !important;
}
.flow-shape-pause .flow-shape-body {
  border-radius: 18px !important;
  border-left: 1px solid color-mix(in srgb, var(--calendar-color) 72%, #111827) !important;
  text-align: center;
}
.flow-shape-end .flow-shape-body {
  border-radius: 999px !important;
  border-left: 1px solid color-mix(in srgb, var(--calendar-color) 72%, #111827) !important;
  text-align: center;
}
.flow-shape-body .connector {
  right: -1px !important;
  top: 50% !important;
}
.relation-branch-select { width: 68px; padding: 3px 4px; font-size: 12px; }
.decision-branch-label {
  font: 600 12px/1 system-ui, sans-serif;
  paint-order: stroke;
  stroke: white;
  stroke-width: 3px;
  stroke-linejoin: round;
  pointer-events: none;
}


/* v2.52: relation metadata controls */
.relation-case-input {
  width: 92px;
  min-width: 72px;
  padding: 3px 5px;
  font-size: 12px;
}
.event-card.locked .resize-handle {
  display: none !important;
}
.event-status-buttons button:disabled,
.relation-item button:disabled,
.relation-item select:disabled,
.relation-item input:disabled {
  cursor: default;
  opacity: .6;
}


/* =========================================================
   Calendar Flow v2.53 — automatic Flow Lanes
   ========================================================= */
.day-column { position: relative; }
.flow-lane-divider-v253 {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px dashed rgba(100, 116, 139, 0.22);
  pointer-events: none;
  z-index: 0;
}
.timed-event.event-card { z-index: 4 !important; }
/* Routing area is no longer used. Each date grows by adding fixed-width lanes. */

/* v2.55: explicit Question Yes/No destination slots */
.question-destination-v255 { align-items: center; }
.question-branch-label-v255 { min-width: 2.5rem; }
.question-destination-label-v255 { flex: 1 1 auto; min-width: 0; }
.question-select-target-v255 { flex: 1 1 auto; }


/* =========================================================
   Calendar Flow v2.56 — foreground branch labels + sticky time axis
   ========================================================= */
/* Keep the hour column visible while Flow Lanes/date columns scroll horizontally.
   It still moves normally with vertical scrolling because no vertical sticky inset
   is specified. */
.calendar-body-viewport .time-axis {
  position: sticky !important;
  left: 0 !important;
  top: auto !important;
  z-index: 12 !important;
  background: #fff !important;
  box-shadow: 1px 0 0 #dfe4ec;
}

/* Yes / No / Case labels are rendered in the foreground relation SVG. */
.relation-foreground-overlay .decision-branch-label {
  font: 700 13px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  paint-order: stroke fill;
  stroke: #fff;
  stroke-width: 5px;
  stroke-linejoin: round;
  pointer-events: none;
}


/* =========================================================
   Calendar Flow v2.58
   Viewport continuation area for every cross-date Flow Link.
   ========================================================= */
:root { --continuation-height: 0px; }

.calendar-body-canvas {
  min-height: calc(var(--continuation-height) + 24 * var(--hour-height)) !important;
}

.continuation-area {
  position: absolute;
  top: 0;
  left: var(--time-axis-width);
  right: 0;
  height: var(--continuation-height);
  background: #fbfcfe;
  border-bottom: 1px solid #dfe4ec;
  box-sizing: border-box;
  z-index: 3;
  pointer-events: none;
}

.continuation-area[hidden] { display: none !important; }

.continuation-track-guide {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  border-top: 1px dashed rgba(107, 114, 128, 0.12);
}

.calendar-body-viewport .time-axis,
.time-grid {
  top: var(--continuation-height) !important;
}

.past-shade-layer,
.current-time-layer {
  top: 0 !important;
}


/* =========================================================
   Calendar Flow v2.59 — day-boundary / jump connectors
   ========================================================= */
.continuation-area { display: none !important; }
.jump-connector-dot { pointer-events: none; }
.jump-connector-label {
  font: 600 11px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  paint-order: stroke fill;
  stroke: #fff;
  stroke-width: 4px;
  stroke-linejoin: round;
  pointer-events: none;
}
.long-link-date-label-v314 {
  pointer-events: none;
  fill: #374151;
  font: 600 11px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}

/* v2.60 — each Flow Lane reserves a narrow, normally invisible routing track
   on its right. Cross-date vertical lines stay inside these tracks. */
.flow-lane-routing-track-v260 {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
}


/* =========================================================
   Calendar Flow v2.67 — configurable calendar grid surface
   ========================================================= */
.calendar-body-viewport,
.calendar-body-canvas,
.time-grid {
  background-color: var(--calendar-grid-bg, #ffffff) !important;
}

/* Calendar Flow v2.70 — manual lane controls and editable routing */
.lane-aware-header-v270{display:flex!important;flex-direction:column;align-items:stretch!important;padding:0!important;overflow:visible!important}
.date-title-v270{display:flex;gap:6px;justify-content:center;align-items:center;min-height:24px}
.lane-header-row-v270{display:flex;min-height:24px;border-top:1px solid rgba(100,116,139,.16)}
.lane-header-v270{position:relative;box-sizing:border-box;flex:0 0 auto;display:flex;align-items:center;justify-content:center;gap:5px;border-right:0;font-size:10px;font-weight:500}
.lane-header-boundary-v326{border-right:1px dashed rgba(100,116,139,.22)}
.lane-menu-btn-v270{border:0;background:transparent;color:#334155;padding:0 3px;cursor:pointer;font-size:14px;line-height:18px}
.lane-popover-v270{position:fixed;z-index:10000;display:flex;flex-direction:column;min-width:132px;background:#fff;border:1px solid #cbd5e1;border-radius:6px;box-shadow:0 5px 18px rgba(15,23,42,.18);padding:4px}
.lane-popover-v270 button{border:0;background:#fff;color:#1e293b;text-align:left;padding:6px 8px;border-radius:4px;cursor:pointer;font-size:11px}.lane-popover-v270 button:hover{background:#f1f5f9;color:#0f172a}
.route-handle-v270{fill:#fff;stroke:#475569;stroke-width:1.5;pointer-events:all;cursor:move;opacity:.72}.route-handle-v270:hover{opacity:1;stroke-width:2}

/* Calendar Flow v2.72 — fixed routing zones + selected-link edge handles */
.flow-lane-divider-v253::before,
.flow-lane-divider-v253::after { content:""; position:absolute; top:0; bottom:0; width:24px; pointer-events:none; }
.route-handle-selected-v272 { opacity:1; fill:#fff; stroke:#334155; stroke-width:1.6; }

/* Calendar Flow v2.74 — keep Lane operation menu readable regardless of inherited button theme */
.lane-popover-v270, .lane-popover-v270 button { color:#1e293b !important; }
.lane-popover-v270 button:hover { color:#0f172a !important; }


/* Calendar Flow v2.76 — unclipped Lane menu */
.lane-popover-v270 { max-height: calc(100vh - 16px); overflow-y: auto; }

/* Calendar Flow v2.77 — Lane 2+ drag/drop targeting uses rendered lane centers. */

/* Calendar Flow v2.78 — make each day grid item fill the full multi-lane grid track. */
.time-grid > .day-column {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* =========================================================
   Calendar Flow v2.81 — all-day sizing, time scale, zoom
   ========================================================= */
:root { --time-grid-step: 60px; }

/* The all-day label belongs to the same fixed left column as the time axis. */
.all-day-label {
  position: sticky !important;
  left: 0 !important;
  z-index: 30 !important;
  align-self: stretch !important;
}
.header-corner {
  position: sticky !important;
  left: 0 !important;
  z-index: 31 !important;
}

/* All-day row height is calculated as an integer multiple of the 24px event box. */
.all-day-event {
  height: 24px !important;
  min-height: 24px !important;
  max-height: 24px !important;
  box-sizing: border-box !important;
}

/* One visible horizontal row = selected time-grid interval. */
.time-grid {
  background-image: repeating-linear-gradient(
    to bottom,
    #dfe4ec 0,
    #dfe4ec 1px,
    transparent 1px,
    transparent var(--time-grid-step)
  ) !important;
}
.time-grid > .day-column::before {
  background-image: none !important;
}

/* Short events must never draw a fixed 42px shape beyond their real duration. */
.timed-event .flow-shape-body {
  height: var(--shape-body-height, 42px) !important;
  min-height: 0 !important;
  max-height: var(--shape-body-height, 42px) !important;
}
.timed-event .duration-stem {
  top: var(--shape-body-height, 42px) !important;
}

.toolbar-scale-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: #475569;
  font-size: 11px;
  white-space: nowrap;
}
.toolbar-scale-control select {
  width: auto;
  min-width: 68px;
  margin: 0;
  padding: 5px 7px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #334155;
}


/* =========================================================
   Calendar Flow v2.83 — toolbar time grid + exact short-event height
   ========================================================= */
.timed-event.event-card {
  min-height: 1px !important;
  overflow: visible;
}
.timed-event .flow-shape-body {
  overflow: hidden !important;
}
.timed-event .event-title,
.timed-event .event-time {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 0;
}
.compact-event-v283 .flow-shape-body {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
.compact-event-v283 .event-title,
.compact-event-v283 .event-time {
  line-height: 1.05 !important;
}
.event-hover-card-v283 {
  position: fixed;
  z-index: 10000;
  max-width: 320px;
  min-width: 160px;
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .18);
  color: #0f172a;
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
  white-space: normal;
}
.event-hover-card-v283[hidden] { display: none !important; }
.event-hover-title-v283 { font-weight: 700; overflow-wrap: anywhere; }
.event-hover-time-v283 { margin-top: 2px; color: #475569; }
.event-hover-description-v283 {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #e2e8f0;
  color: #334155;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.event-hover-card-v283.has-diagram-preview-v317 {
  width: min(520px, calc(100vw - 16px));
  max-width: calc(100vw - 16px);
}
.event-hover-diagrams-v317 {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}
.event-hover-diagram-tabs-v317 {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.event-hover-diagram-tab-v317 {
  flex: 0 1 auto;
  max-width: 150px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  padding: 5px 8px;
  font-size: 11px;
  line-height: 1.2;
}
.event-hover-diagram-tab-v317[aria-selected="true"] {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}
.event-hover-diagram-name-v317 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
}
.event-hover-diagram-canvas-v317 {
  width: 100%;
  height: 220px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  padding: 8px;
}
.event-hover-diagram-stage-v317 {
  min-width: 100%;
}
.event-hover-diagram-stage-v317 > svg,
.event-hover-diagram-stage-v317 .vega-embed,
.event-hover-diagram-stage-v317 .vega-embed > div {
  max-width: 100%;
}
.event-hover-diagram-stage-v317 > svg {
  height: auto;
  display: block;
}
.event-hover-diagram-status-v317,
.event-hover-diagram-error-v317 {
  padding: 10px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.event-hover-diagram-status-v317 { background: #f8fafc; color: #475569; }
.event-hover-diagram-error-v317 { background: #fef2f2; color: #991b1b; }

/* =========================================================
   Calendar Flow v2.84 — unified fixed header row geometry
   ========================================================= */
:root {
  --date-title-height-v284: 26px;
  --lane-header-height-v284: 28px;
  --header-height: calc(var(--date-title-height-v284) + var(--lane-header-height-v284));
}

/* One geometry owns the entire fixed header. */
.calendar-header-viewport {
  box-sizing: border-box !important;
  border-bottom: 0 !important;
}
.calendar-sticky-header {
  box-sizing: border-box !important;
  grid-template-columns: var(--time-axis-width) minmax(0, 1fr) !important;
  grid-template-rows: var(--header-height) var(--all-day-height) !important;
}

/* Fixed left rail: exactly the same width in header, all-day row and body. */
.header-corner,
.all-day-label {
  width: var(--time-axis-width) !important;
  min-width: var(--time-axis-width) !important;
  max-width: var(--time-axis-width) !important;
  box-sizing: border-box !important;
  position: sticky !important;
  left: 0 !important;
  background: #fff !important;
}
.header-corner {
  height: var(--header-height) !important;
  z-index: 2600 !important;
  border-right: 1px solid #dfe4ec !important;
  border-bottom: 1px solid #dfe4ec !important;
}
/* Match the date-title/lane-header separator across the left rail. */
.header-corner::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: var(--date-title-height-v284);
  border-top: 1px solid #dfe4ec;
  pointer-events: none;
}

.days-header {
  height: var(--header-height) !important;
  box-sizing: border-box !important;
  border-bottom: 1px solid #dfe4ec !important;
  align-items: stretch !important;
}
.day-header-cell.lane-aware-header-v270 {
  height: var(--header-height) !important;
  min-height: var(--header-height) !important;
  box-sizing: border-box !important;
  border-bottom: 0 !important;
}
.date-title-v270 {
  height: var(--date-title-height-v284) !important;
  min-height: var(--date-title-height-v284) !important;
  max-height: var(--date-title-height-v284) !important;
  box-sizing: border-box !important;
  flex: 0 0 var(--date-title-height-v284) !important;
}
.lane-header-row-v270 {
  height: var(--lane-header-height-v284) !important;
  min-height: var(--lane-header-height-v284) !important;
  max-height: var(--lane-header-height-v284) !important;
  box-sizing: border-box !important;
  flex: 0 0 var(--lane-header-height-v284) !important;
  border-top: 1px solid #dfe4ec !important;
  align-items: stretch !important;
}
.lane-header-v270 {
  height: 100% !important;
  min-height: 0 !important;
}

/* All-day left label and event area share one exact row height and bottom Y. */
.all-day-label {
  height: var(--all-day-height) !important;
  min-height: var(--all-day-height) !important;
  z-index: 2550 !important;
  padding: 6px 8px 0 0 !important;
  align-items: flex-start !important;
  justify-content: flex-end !important;
  border-right: 1px solid #dfe4ec !important;
  border-bottom: 1px solid #dfe4ec !important;
  background: #fbfcfe !important;
}
.all-day-area {
  height: var(--all-day-height) !important;
  min-height: var(--all-day-height) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  border-bottom: 1px solid #dfe4ec !important;
  background: #fbfcfe !important;
}
.all-day-column {
  height: var(--all-day-height) !important;
  min-height: var(--all-day-height) !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 3px !important;
  padding: 4px !important;
  overflow: hidden !important;
}
.all-day-event {
  position: relative !important;
  flex: 0 0 24px !important;
  height: 24px !important;
  min-height: 24px !important;
  max-height: 24px !important;
  margin: 0 !important;
  top: auto !important;
  left: auto !important;
  box-sizing: border-box !important;
}

/* Horizontal fixed rail only: the time labels must still travel vertically
   with the same Y-coordinate system as the grid. */
.calendar-body-viewport .time-axis {
  position: sticky !important;
  left: 0 !important;
  top: auto !important;
  z-index: 12 !important;
  width: var(--time-axis-width) !important;
  min-width: var(--time-axis-width) !important;
  max-width: var(--time-axis-width) !important;
  box-sizing: border-box !important;
  background: #fff !important;
}


/* Calendar Flow v2.86 — subtle event focus */
.event-card.event-focus-v286 .flow-shape-body {
  outline: 2px solid rgba(15, 23, 42, 0.42) !important;
  outline-offset: 2px;
}


/* =========================================================
   Calendar Flow v2.89 — sidebar toggle + rich hover content
   ========================================================= */
.layout.sidebar-hidden-v289 {
  grid-template-columns: minmax(0, 1fr) !important;
}
.layout.sidebar-hidden-v289 > .sidebar[hidden] {
  display: none !important;
}
.event-hover-description-v283 {
  white-space: normal !important;
}
.event-hover-description-v283 p,
.event-hover-description-v283 div,
.event-hover-description-v283 ul,
.event-hover-description-v283 ol,
.event-hover-description-v283 blockquote,
.event-hover-description-v283 pre {
  margin: 0 0 6px;
}
.event-hover-description-v283 ul,
.event-hover-description-v283 ol {
  padding-left: 20px;
}
.event-hover-description-v283 li {
  margin: 2px 0;
}
.event-hover-description-v283 a {
  color: inherit;
  text-decoration: underline;
}
.event-hover-description-v283 > :last-child {
  margin-bottom: 0;
}


/* v2.92: plain hover popups never participate in pointer hit testing. */
.event-hover-card-v283 { pointer-events: none !important; }
.event-hover-card-v283.has-diagram-preview-v317 { pointer-events: auto !important; }
.event-hover-card-v283[hidden] { display: none !important; }


/* =========================================================
   Calendar Flow v2.93 — marquee multi-select / copy-paste
   ========================================================= */
.marquee-rect-v293 {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  box-sizing: border-box;
  border: 1px solid rgba(15, 23, 42, 0.65);
  background: rgba(148, 163, 184, 0.14);
}
.marquee-rect-v293[hidden] { display: none !important; }
body.marquee-active-v293 { user-select: none !important; cursor: crosshair; }
.event-card.marquee-selected-v293 .flow-shape-body {
  outline: 2px solid rgba(15, 23, 42, 0.72) !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.20);
}

/* =========================================================
   Calendar Flow v2.94 — multi delete / multi drag / loading mark
   ========================================================= */
.multi-operation-loading-v294 {
  position: fixed;
  z-index: 12000;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -14px;
  border-radius: 50%;
  border: 3px solid rgba(148, 163, 184, 0.45);
  border-top-color: rgba(15, 23, 42, 0.85);
  box-sizing: border-box;
  pointer-events: none;
  animation: calendar-flow-spin-v294 0.75s linear infinite;
  background: rgba(255, 255, 255, 0.82);
}
.multi-operation-loading-v294[hidden] { display: none !important; }
@keyframes calendar-flow-spin-v294 { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .multi-operation-loading-v294 { animation-duration: 1.8s; }
}
body.multi-drag-active-v294 { user-select: none !important; }

/* =========================================================
   Calendar Flow v2.96 — Diagram Stock / DSL editor
   ========================================================= */
.layout {
  grid-template-columns: 310px minmax(0, 1fr) var(--diagram-pane-width-v296, 360px);
}
.layout.diagram-pane-hidden-v296 {
  grid-template-columns: 310px minmax(0, 1fr) 0;
}
.layout.sidebar-hidden-v289 {
  grid-template-columns: minmax(0, 1fr) var(--diagram-pane-width-v296, 360px);
}
.layout.sidebar-hidden-v289.diagram-pane-hidden-v296 {
  grid-template-columns: minmax(0, 1fr) 0;
}
.diagram-pane-v296 {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-left: 1px solid #e5e7eb;
  background: #f8fafc;
}
.diagram-pane-v296[hidden],
.layout.diagram-pane-hidden-v296 > .diagram-pane-v296 {
  display: none !important;
}
.diagram-pane-resizer-v296 {
  position: absolute;
  z-index: 5;
  left: 0;
  top: 0;
  bottom: 0;
  width: 7px;
  transform: translateX(-3px);
  cursor: ew-resize;
}
.diagram-pane-resizer-v296:hover,
body.diagram-pane-resizing-v296 .diagram-pane-resizer-v296 {
  background: rgba(59, 130, 246, .12);
}
.diagram-pane-inner-v296 {
  height: 100%;
  overflow: auto;
  padding: 12px 12px 16px 14px;
}
.diagram-pane-header-v296 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.diagram-pane-header-v296 h2 {
  margin: 0;
  font-size: 15px;
}
.diagram-search-v296,
#eventDiagramSearchInput {
  width: 100%;
  margin: 0 0 9px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 9px;
  background: #fff;
}
.diagram-table-head-v296,
.diagram-row-v296 {
  display: grid;
  grid-template-columns: minmax(84px, .8fr) minmax(120px, 1.2fr);
  gap: 10px;
  align-items: center;
}
.diagram-table-head-v296 {
  margin-top: 10px;
  padding: 7px 8px;
  color: #64748b;
  border-bottom: 1px solid #cbd5e1;
  font-size: 11px;
  font-weight: 700;
}
.diagram-list-v296 {
  min-height: 48px;
}
.diagram-row-v296 {
  width: 100%;
  appearance: none;
  border: 0;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 0;
  background: transparent;
  color: #111827;
  padding: 9px 8px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.diagram-row-v296:hover { background: #f1f5f9; }
.diagram-row-v296.active-v296 {
  background: #dbeafe;
  box-shadow: inset 3px 0 0 #3b82f6;
}
.diagram-row-v296 span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.diagram-empty-v296 {
  padding: 16px 8px;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}
.diagram-editor-backdrop-v296 { z-index: 1300; }
.diagram-editor-modal-v296 {
  width: min(1180px, calc(100vw - 72px));
  height: min(760px, calc(100vh - 72px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(17,24,39,.28);
  padding: 18px;
}
.diagram-meta-grid-v296 {
  display: grid;
  grid-template-columns: 1fr 1.5fr 180px;
  gap: 12px;
}
.diagram-meta-grid-v296 label { margin-bottom: 8px; }
.diagram-meta-grid-v296 select,
.diagram-meta-grid-v296 input {
  width: 100%;
  margin-top: 4px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 9px 10px;
  background: white;
}
.diagram-editor-split-v296 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  flex: 1;
}
.diagram-editor-side-v296 {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.diagram-editor-side-title-v296 {
  padding: 7px 10px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}
#diagramSourceInput {
  flex: 1;
  min-height: 0;
  resize: none;
  border: 0;
  border-radius: 0;
  outline: none;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
  tab-size: 2;
}
.diagram-preview-v296 {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  background: #fff;
}
.diagram-preview-v296 > svg,
.diagram-preview-v296 .vega-embed,
.diagram-preview-v296 .vega-embed > div {
  max-width: 100%;
}
.diagram-preview-status-v296,
.diagram-preview-error-v296 {
  padding: 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.diagram-preview-status-v296 { background: #f8fafc; color: #475569; }
.diagram-preview-error-v296 { background: #fef2f2; color: #991b1b; }
.event-diagrams-section-v296 {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
}
.event-diagrams-heading-v296 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.event-diagram-choices-v296 {
  max-height: 190px;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}
.event-diagram-choice-v296 {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 8px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}
.event-diagram-choice-v296:last-child { border-bottom: 0; }
.event-diagram-choice-v296 input { width: auto; margin: 0; }
.event-diagram-choice-label-v296 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event-diagram-edit-v296 { white-space: nowrap; }
.event-hover-diagram-indicator-v296 {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid #e2e8f0;
  color: #475569;
  font-size: 14px;
  line-height: 1;
}
@media (max-width: 980px) {
  .diagram-editor-modal-v296 { width: calc(100vw - 24px); height: calc(100vh - 24px); }
  .diagram-editor-split-v296 { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .diagram-meta-grid-v296 { grid-template-columns: 1fr; }
}

/* v2.96 must override the v2.89 sidebar rule that used !important. */
.layout.sidebar-hidden-v289 {
  grid-template-columns: minmax(0, 1fr) var(--diagram-pane-width-v296, 360px) !important;
}
.layout.sidebar-hidden-v289.diagram-pane-hidden-v296 {
  grid-template-columns: minmax(0, 1fr) 0 !important;
}


/* =========================================================
   Calendar Flow v2.97 — Event Diagram Preview mode
   ========================================================= */
.event-diagram-actions-v297 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.event-diagram-preview-v297 { white-space: nowrap; }
.diagram-editor-modal-v296.diagram-preview-mode-v297 .diagram-meta-grid-v296,
.diagram-editor-modal-v296.diagram-preview-mode-v297 .diagram-editor-side-v296:first-child,
.diagram-editor-modal-v296.diagram-preview-mode-v297 #diagramDeleteBtn,
.diagram-editor-modal-v296.diagram-preview-mode-v297 #diagramSaveBtn {
  display: none !important;
}
.diagram-editor-modal-v296.diagram-preview-mode-v297 .diagram-editor-split-v296 {
  grid-template-columns: 1fr;
  min-height: 0;
}
.diagram-editor-modal-v296.diagram-preview-mode-v297 .diagram-editor-side-v296:last-child { min-height: 0; }
.diagram-editor-modal-v296.diagram-preview-mode-v297 .diagram-preview-v296 {
  min-height: 0;
  height: 100%;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}


/* =========================================================
   Calendar Flow v2.98 — Preview-only Diagram view
   ========================================================= */
#diagramEditorModal .diagram-editor-modal-v296.diagram-preview-mode-v297 .diagram-editor-split-v296 {
  display: block !important;
  min-height: 0;
}
#diagramEditorModal .diagram-editor-modal-v296.diagram-preview-mode-v297 .diagram-editor-side-v296:first-child {
  display: none !important;
}
#diagramEditorModal .diagram-editor-modal-v296.diagram-preview-mode-v297 .diagram-editor-side-v296:last-child {
  display: flex !important;
  height: 100%;
  min-height: 0;
}
#diagramEditorModal .diagram-editor-modal-v296.diagram-preview-mode-v297 .diagram-preview-v296 {
  flex: 1 1 auto;
  width: 100%;
}


/* =========================================================
   Calendar Flow v2.99 — strict preview-only mode
   ========================================================= */
#diagramEditorModal.diagram-preview-mode-v297 .diagram-meta-grid-v296,
#diagramEditorModal.diagram-preview-mode-v297 .diagram-editor-side-v296:first-child,
#diagramEditorModal.diagram-preview-mode-v297 #diagramDeleteBtn,
#diagramEditorModal.diagram-preview-mode-v297 #diagramSaveBtn {
  display: none !important;
}
#diagramEditorModal.diagram-preview-mode-v297 .diagram-editor-split-v296 {
  display: block !important;
  min-height: 0;
  height: 100%;
}
#diagramEditorModal.diagram-preview-mode-v297 .diagram-editor-side-v296:last-child {
  display: flex !important;
  width: 100%;
  height: 100%;
  min-height: 0;
}
#diagramEditorModal.diagram-preview-mode-v297 .diagram-preview-v296 {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: 100%;
  overflow: auto;
}

/* v3.04 Diagram Editor resizing / preview maximize */
.diagram-editor-modal-v296 { position: relative; box-sizing: border-box; }
.diagram-editor-split-v296 {
  grid-template-columns: minmax(220px, var(--diagram-editor-left, 50%)) 8px minmax(220px, 1fr);
  gap: 6px;
}
.diagram-editor-divider-v304 {
  min-width: 8px; cursor: col-resize; border-radius: 6px; position: relative; touch-action: none;
}
.diagram-editor-divider-v304::after {
  content: ""; position: absolute; left: 3px; top: 10px; bottom: 10px; width: 2px;
  border-radius: 2px; background: #cbd5e1;
}
.diagram-editor-divider-v304:hover::after,
.diagram-editor-divider-v304.is-dragging-v304::after { background: #64748b; }
.diagram-preview-title-v304 { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.diagram-preview-max-btn-v304 {
  width: 26px; height: 24px; padding: 0; border: 0; border-radius: 5px; background: transparent;
  color:#475569; cursor:pointer; font-size:16px; line-height:1;
}
.diagram-preview-max-btn-v304:hover { background:#e2e8f0; }
.diagram-editor-modal-v296.diagram-preview-maximized-v304 .diagram-meta-grid-v296,
.diagram-editor-modal-v296.diagram-preview-maximized-v304 .diagram-editor-side-v296:first-child,
.diagram-editor-modal-v296.diagram-preview-maximized-v304 .diagram-editor-divider-v304,
.diagram-editor-modal-v296.diagram-preview-maximized-v304 .modal-actions { display:none !important; }
.diagram-editor-modal-v296.diagram-preview-maximized-v304 .diagram-editor-split-v296 {
  grid-template-columns: minmax(0,1fr) !important; gap:0; flex:1;
}
.diagram-editor-modal-v296.diagram-preview-maximized-v304 .diagram-preview-side-v304 { display:flex !important; }
.diagram-editor-modal-v296.diagram-preview-maximized-v304 .diagram-preview-max-btn-v304 { background:#e2e8f0; }
.diagram-resize-handle-v304 { position:absolute; z-index:20; touch-action:none; }
.diagram-resize-handle-v304.n { top:-4px; left:12px; right:12px; height:8px; cursor:n-resize; }
.diagram-resize-handle-v304.s { bottom:-4px; left:12px; right:12px; height:8px; cursor:s-resize; }
.diagram-resize-handle-v304.e { right:-4px; top:12px; bottom:12px; width:8px; cursor:e-resize; }
.diagram-resize-handle-v304.w { left:-4px; top:12px; bottom:12px; width:8px; cursor:w-resize; }
.diagram-resize-handle-v304.ne,.diagram-resize-handle-v304.nw,.diagram-resize-handle-v304.se,.diagram-resize-handle-v304.sw { width:14px; height:14px; }
.diagram-resize-handle-v304.ne { right:-5px; top:-5px; cursor:ne-resize; }
.diagram-resize-handle-v304.nw { left:-5px; top:-5px; cursor:nw-resize; }
.diagram-resize-handle-v304.se { right:-5px; bottom:-5px; cursor:se-resize; }
.diagram-resize-handle-v304.sw { left:-5px; bottom:-5px; cursor:sw-resize; }
@media (max-width: 760px) {
  .diagram-editor-split-v296 { grid-template-columns:1fr; grid-template-rows:1fr 1fr; gap:6px; }
  .diagram-editor-divider-v304 { display:none; }
  .diagram-resize-handle-v304 { display:none; }
}

/* v3.05 — app menu + Time Tracking */
.app-menubar-v305{height:30px;display:flex;align-items:center;gap:2px;padding:0 10px;border-bottom:1px solid #d8dde6;background:#f7f8fa;position:sticky;top:0;z-index:5000;font-size:13px;user-select:none}.app-menu-brand-v305{font-weight:700;margin-right:8px}.app-menu-v305{position:relative}.app-menu-v305>button{border:0;background:transparent;color:inherit;padding:4px 8px;border-radius:5px;font:inherit}.app-menu-v305>button:hover,.app-menu-v305.is-open-v305>button{background:#e7eaf0}.app-menu-pop-v305{display:none;position:absolute;top:26px;left:0;min-width:190px;padding:5px;background:#fff;border:1px solid #ccd2dc;border-radius:8px;box-shadow:0 10px 28px rgba(0,0,0,.16);z-index:5100}.app-menu-v305.is-open-v305 .app-menu-pop-v305{display:grid}.app-menu-pop-v305 button{border:0;background:transparent;color:#20242b;text-align:left;padding:7px 10px;border-radius:5px;font:inherit}.app-menu-pop-v305 button:hover{background:#eef2f7}.app-menu-pop-v305 hr{border:0;border-top:1px solid #e2e5ea;width:100%;margin:4px 0}.toolbar-icon-v305{min-width:32px!important;font-size:16px!important;padding-left:7px!important;padding-right:7px!important}.settings-section-v305{margin-top:18px;padding-top:14px;border-top:1px solid #ddd}.settings-section-v305 h3{margin:0 0 10px}.activity-settings-head-v305{display:flex;justify-content:space-between;align-items:center;margin:8px 0}.activity-type-list-v305{border:1px solid #d8dde6;border-radius:8px;max-height:260px;overflow:auto}.activity-row-v305{display:grid;grid-template-columns:1fr auto;gap:8px;padding:8px 10px;border-bottom:1px solid #edf0f4;cursor:pointer}.activity-row-v305:last-child{border-bottom:0}.activity-row-v305:hover{background:#f7f9fb}.activity-row-v305.is-disabled-v305{opacity:.48}.activity-row-v305 small{display:block;color:#68707d;margin-top:2px}.tracking-modal-v305{width:min(1100px,calc(100vw - 40px));height:min(820px,calc(100vh - 40px));overflow:auto}.tracking-presets-v305,.tracking-range-v305{display:flex;gap:8px;align-items:end;flex-wrap:wrap;margin:10px 0}.tracking-range-v305 label{margin:0}.tracking-summary-grid-v305{display:grid;grid-template-columns:minmax(220px,1fr) 2fr;gap:20px;margin-top:18px}.tracking-total-v305{font-size:28px;font-weight:700;margin:8px 0 14px}.tracking-table-v305{width:100%;border-collapse:collapse}.tracking-table-v305 th,.tracking-table-v305 td{padding:8px 9px;border-bottom:1px solid #e5e8ed;text-align:left}.tracking-table-v305 th.num,.tracking-table-v305 td.num{text-align:right}.tracking-activity-link-v305{border:0;background:transparent;padding:0;color:#2457a7;text-decoration:underline;cursor:pointer;font:inherit}.tracking-bars-v305{display:grid;gap:8px}.tracking-bar-row-v305{display:grid;grid-template-columns:120px 1fr 72px;gap:8px;align-items:center}.tracking-bar-v305{height:14px;background:#e9edf3;border-radius:7px;overflow:hidden}.tracking-bar-v305>i{display:block;height:100%;background:currentColor;opacity:.55;border-radius:7px}.tracking-trend-wrap-v305{margin-top:24px}.tracking-trend-scroll-v305{overflow:auto}.tracking-trend-v305{width:100%;border-collapse:collapse;font-size:12px}.tracking-trend-v305 th,.tracking-trend-v305 td{padding:6px;border-bottom:1px solid #edf0f4;text-align:right;white-space:nowrap}.tracking-trend-v305 th:first-child,.tracking-trend-v305 td:first-child{text-align:left;position:sticky;left:0;background:#fff}.tracking-drill-v305{margin-top:24px}.tracking-event-row-v305{display:grid;grid-template-columns:110px 1fr 90px;gap:10px;padding:8px;border-bottom:1px solid #edf0f4;cursor:pointer}.tracking-event-row-v305:hover{background:#f4f7fb}.activity-edit-modal-v305{width:min(520px,calc(100vw - 32px))}@media(max-width:760px){.app-menubar-v305{overflow-x:auto}.tracking-summary-grid-v305{grid-template-columns:1fr}.tracking-bar-row-v305{grid-template-columns:90px 1fr 64px}}

/* v3.06 language switch */
.language-switch-v306{margin-left:auto;display:flex;align-items:center;gap:3px;padding:0 10px;font-size:12px}.language-switch-v306 button{border:0;background:transparent;padding:3px 5px;color:var(--muted,#666);cursor:pointer;font-weight:600}.language-switch-v306 button.is-active-v306{color:var(--text,#111);text-decoration:underline;text-underline-offset:3px}.language-switch-v306 span{opacity:.35}


/* v3.07 — keep language control at the far-right of the application menu */
.app-menubar-v305 .language-switch-v306{margin-left:auto;flex:0 0 auto;display:flex!important;visibility:visible!important;align-items:center;gap:3px;padding:0 8px;position:relative;z-index:5200}
.app-menubar-v305 .language-switch-v306 button{display:inline-block!important;visibility:visible!important;min-width:25px}

/* v3.11 */
.tracking-unclassified-v311{margin:0 0 12px 0;}

/* v3.27 compact shell */
.workspace-toolbar .toolbar-scale-control {
  font-size: 0 !important;
  gap: 0 !important;
}
.workspace-toolbar .toolbar-scale-control select {
  font-size: 12px !important;
}
.workspace-toolbar .period-label {
  display: none !important;
}
