/* Stage110_9 split stylesheet: density, chip, popover, and event-form polish (from rail-signal-calendar-v82.css lines 3152-3854) */

/* --- style block 05 --- */
    .event-card {
      padding: 10px 72px 10px 12px !important;
      margin-bottom: 8px !important;
      border-radius: 14px !important;
    }

    .event-time {
      font-size: 11px !important;
      margin-bottom: 3px !important;
      line-height: 1.25 !important;
    }

    .event-name {
      margin-bottom: 4px !important;
      line-height: 1.32 !important;
      padding-right: 2px;
    }

    .event-desc {
      font-size: 12px !important;
      line-height: 1.4 !important;
      margin-bottom: 5px !important;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .event-meta {
      display: flex !important;
      align-items: center !important;
      justify-content: space-between !important;
      gap: 8px !important;
      min-height: 20px;
      margin-bottom: 0 !important;
      font-size: 12px !important;
      line-height: 1.3 !important;
    }

    .event-meta-left {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      min-width: 0;
      flex: 1 1 auto;
    }

    .event-meta-location {
      color: var(--muted);
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .calendar-source-inline {
      margin-top: 0 !important;
      display: inline-flex;
      align-items: center;
      min-width: 0;
      flex: 0 0 auto;
    }

    .calendar-source-badge {
      padding: 3px 8px !important;
      font-size: 11px !important;
      line-height: 1.2 !important;
    }

    .event-actions {
      top: 10px !important;
      right: 8px !important;
      gap: 4px !important;
    }

    .event-actions .ghost-btn,
    .event-actions .danger-btn {
      padding: 4px 9px !important;
      font-size: 11px !important;
      min-height: auto !important;
    }

    .event-recurring-note,
    .helper {
      margin-bottom: 4px !important;
      font-size: 11px !important;
      line-height: 1.35 !important;
    }

    .agenda-summary {
      padding-bottom: 12px !important;
      margin-bottom: 12px !important;
    }
  

/* --- style block 06 --- */
    .day {
      overflow: hidden;
    }

    .day-body {
      overflow: hidden;
    }

    .event-chip {
      display: grid;
      grid-template-columns: 8px auto minmax(0, 1fr);
      align-items: center;
      column-gap: 6px;
      width: 100%;
      min-width: 0;
      max-width: 100%;
      overflow: hidden;
      box-sizing: border-box;
    }

    .event-dot {
      margin-top: 0;
    }

    .event-chip-time {
      min-width: 0;
      max-width: 40%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .event-chip-title {
      display: block;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .week-view {
      --week-scrollbar-width: 0px;
    }

    .week-view-head,
    .week-all-day-wrap {
      box-sizing: border-box;
      padding-right: var(--week-scrollbar-width);
      position: relative;
    }

    .week-view-head::after,
    .week-all-day-wrap::after {
      content: '';
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      width: var(--week-scrollbar-width);
      background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.98));
      pointer-events: none;
    }

    .week-head-day {
      -webkit-appearance: none;
      appearance: none;
      border: none;
      border-right: 1px solid var(--line);
      border-radius: 0;
      box-shadow: none;
      margin: 0;
    }

    .week-head-day:last-child {
      border-right: none;
    }

    .week-head-day.selected {
      box-shadow: inset 0 -2px 0 rgba(26, 115, 232, 0.4);
    }

    .week-head-day:focus-visible {
      outline: none;
      box-shadow: inset 0 0 0 2px rgba(26, 115, 232, 0.22);
    }

    .week-scroll {
      overflow-x: hidden;
      overflow-y: auto;
      scrollbar-gutter: stable;
    }
  

/* --- style block 07 --- */
    .week-time-board {
      padding-top: 8px;
      box-sizing: border-box;
    }
  

/* --- style block 08 --- */
    .day-body {
      min-width: 0;
      overflow: hidden;
    }

    .day-body .event-chip {
      display: flex !important;
      align-items: center;
      gap: 6px;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      overflow: hidden;
      box-sizing: border-box;
    }

    .day-body .event-chip-time {
      flex: 0 0 auto !important;
      min-width: auto !important;
      max-width: none !important;
      overflow: visible !important;
      text-overflow: clip !important;
      white-space: nowrap !important;
    }

    .day-body .event-chip-title {
      display: block !important;
      flex: 1 1 auto !important;
      min-width: 0 !important;
      max-width: 100% !important;
      overflow: hidden !important;
      text-overflow: ellipsis !important;
      white-space: nowrap !important;
    }

    .week-view-head {
      border-bottom: 1px solid var(--line-strong);
      box-shadow: none;
    }

    .week-view-head::after,
    .week-all-day-wrap::after {
      background: rgba(255,255,255,0.92) !important;
    }

    .week-head-day,
    .week-head-day:hover,
    .week-head-day:active,
    .week-head-day:focus,
    .week-head-day:focus-visible {
      -webkit-appearance: none !important;
      appearance: none !important;
      outline: none !important;
      border: 0 !important;
      border-right: 1px solid var(--line) !important;
      border-radius: 0 !important;
      box-shadow: none !important;
      background-clip: padding-box;
    }

    .week-head-day:last-child,
    .week-head-day:last-child:hover,
    .week-head-day:last-child:active,
    .week-head-day:last-child:focus,
    .week-head-day:last-child:focus-visible {
      border-right: none !important;
    }

    .week-head-day.selected {
      box-shadow: inset 0 -2px 0 rgba(26, 115, 232, 0.35) !important;
    }
  

/* --- style block 09 --- */
    @media (max-width: 860px) {
      body.mobile-ui .week-time-board,
      body.mobile-ui .week-view-head,
      body.mobile-ui .week-all-day-grid {
        min-width: 0 !important;
      }

      body.mobile-ui .week-time-gutter,
      body.mobile-ui .week-day-column {
        height: var(--day-height) !important;
        min-height: var(--day-height) !important;
      }

      body.mobile-ui .week-day-column,
      body.mobile-ui .week-head-day,
      body.mobile-ui .week-all-day-cell {
        min-width: 0 !important;
      }

      body.mobile-ui .week-day-column {
        overflow: hidden !important;
        background-clip: padding-box !important;
      }

      body.mobile-ui .week-scroll {
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px) !important;
      }

      body.mobile-ui .week-day-column .week-event {
        max-width: calc(100% - 2px) !important;
        box-sizing: border-box !important;
      }
    }
  

/* --- style block 10 --- */
    .mobile-layout-account {
      display: none;
      min-width: 0;
      margin-left: auto;
    }

    .viewer-user-chip .viewer-user-name {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .viewer-user-chip.mobile-compact {
      padding: 6px 10px;
      gap: 8px;
      font-size: 12px;
      line-height: 1;
    }

    .viewer-user-chip.mobile-compact .viewer-user-name {
      max-width: 11.5em;
    }

    .viewer-user-chip.mobile-compact button {
      white-space: nowrap;
    }

    @media (max-width: 860px) {
      body.mobile-ui .header-account {
        display: none;
      }

      body.mobile-ui .mobile-layout-switch {
        align-items: center;
        gap: 6px;
      }

      body.mobile-ui .mobile-layout-btn {
        flex: 0 0 auto;
        min-width: 56px;
        min-height: 34px;
        padding: 0 10px;
        border-radius: 10px;
        font-size: 12px;
      }

      body.mobile-ui .mobile-layout-account {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex: 1 1 auto;
        min-width: 0;
      }

      body.mobile-ui .mobile-layout-account .viewer-user-chip {
        display: inline-flex;
        align-items: center;
        max-width: 100%;
        margin-left: auto;
        background: rgba(255, 255, 255, 0.96);
        border: 1px solid rgba(26, 115, 232, 0.14);
        color: #174ea6;
      }

      body.mobile-ui .mobile-layout-account .viewer-role-badge {
        padding: 2px 6px;
        font-size: 10px;
      }
    }
  

/* --- style block 11 --- */
    .event-popover {
      display: none;
      opacity: 0;
      pointer-events: none;
    }
    .event-popover.show {
      display: block !important;
      opacity: 1 !important;
      pointer-events: auto !important;
    }
    .event-card {
      padding: 12px 14px !important;
      gap: 4px !important;
    }
    .event-time {
      margin-bottom: 2px !important;
      line-height: 1.2 !important;
    }
    .event-name {
      line-height: 1.25 !important;
      margin-bottom: 0 !important;
    }
    .event-desc {
      margin-top: 4px !important;
      line-height: 1.35 !important;
    }
    .event-meta {
      margin-top: 4px !important;
      min-height: 0 !important;
    }
    .calendar-source-inline {
      margin-top: 0 !important;
    }
    .event-chip.selected-interaction,
    .event-card.selected-interaction,
    .event-bar.selected-interaction,
    .week-all-day-bar.selected-interaction,
    .week-event.selected-interaction {
      box-shadow: 0 0 0 2px rgba(26,115,232,0.30), 0 12px 24px rgba(15, 23, 42, 0.10) !important;
      border-color: rgba(26,115,232,0.42) !important;
      transform: translateY(-1px);
    }
    .event-card.selected-interaction {
      background: rgba(26,115,232,0.03);
    }
    .end-time-undefined-option {
      margin-top: 8px;
      font-size: 13px;
      color: var(--muted);
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }
    .viewer-context-menu {
      position: fixed;
      z-index: 10050;
      min-width: 180px;
      background: #fff;
      border: 1px solid rgba(207, 214, 226, 0.9);
      border-radius: 16px;
      box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
      padding: 8px;
      display: none;
    }
    .viewer-context-menu.show {
      display: block;
    }
    .viewer-context-menu button {
      width: 100%;
      appearance: none;
      border: 0;
      background: transparent;
      text-align: left;
      padding: 10px 12px;
      border-radius: 12px;
      font-size: 14px;
      color: var(--text);
      cursor: pointer;
    }
    .viewer-context-menu button:hover {
      background: rgba(26,115,232,0.08);
    }
    .viewer-context-menu button.danger {
      color: #d93025;
    }
  

/* --- style block 12 --- */
    .month-meta { display:none !important; }
    #eventList .event-card {
      padding: 8px 10px !important;
      gap: 4px !important;
    }
    #eventList .event-card .event-time,
    #eventList .event-card .event-name,
    #eventList .event-card .event-desc,
    #eventList .event-card .event-meta,
    #eventList .event-card .event-actions {
      margin-top: 0 !important;
      margin-bottom: 0 !important;
    }
    #eventList .event-card .event-actions {
      padding-top: 2px !important;
    }
    .selected-interaction {
      box-shadow: 0 0 0 2px rgba(26,115,232,0.22) inset;
    }
  

/* --- style block 13 --- */
    #newEventBtn,
    #quickAddBtn {
      display: none !important;
    }

    .time-row {
      display: flex !important;
      flex-direction: column !important;
      align-items: stretch !important;
      gap: 8px !important;
    }

    .time-field-head {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .time-field-label {
      margin: 0;
      flex: 1 1 auto;
      cursor: pointer;
    }

    .time-field-body {
      width: 100%;
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
      position: relative;
    }

    .time-native-proxy {
      position: absolute !important;
      width: 1px !important;
      height: 1px !important;
      margin: 0 !important;
      padding: 0 !important;
      border: 0 !important;
      opacity: 0 !important;
      pointer-events: none !important;
      clip: rect(0 0 0 0) !important;
      clip-path: inset(50%) !important;
      overflow: hidden !important;
      white-space: nowrap !important;
    }

    .time-proxy-shell {
      position: relative;
      width: 100%;
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .time-text-proxy {
      flex: 1 1 auto;
      min-width: 0;
      min-height: 46px;
      border: 1px solid var(--panel-border);
      border-radius: 14px;
      padding: 0 14px;
      background: rgba(255,255,255,0.98);
      outline: none;
      transition: border-color 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
      font: inherit;
      color: inherit;
      letter-spacing: 0.01em;
    }

    .time-text-proxy:focus {
      border-color: #b8cdf8;
      box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
    }

    .time-text-proxy:disabled {
      opacity: 0.55;
      cursor: not-allowed;
      background: rgba(241,243,244,0.72);
    }

    .time-picker-toggle {
      flex: 0 0 auto;
      min-width: 68px;
      min-height: 46px;
      border-radius: 14px;
      border: 1px solid var(--panel-border);
      background: rgba(255,255,255,0.98);
      color: inherit;
      font: inherit;
      padding: 0 14px;
      cursor: pointer;
      transition: border-color 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
    }

    .time-picker-toggle:hover,
    .time-picker-toggle:focus {
      border-color: #b8cdf8;
      box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
      outline: none;
    }

    .time-picker-toggle:disabled {
      opacity: 0.55;
      cursor: not-allowed;
      background: rgba(241,243,244,0.72);
      box-shadow: none;
    }

    .time-picker-popover {
      position: absolute;
      top: calc(100% + 8px);
      left: 0;
      z-index: 120;
      width: min(100%, 300px);
      min-width: 260px;
      padding: 12px;
      border-radius: 18px;
      border: 1px solid rgba(207,215,223,0.95);
      background: rgba(255,255,255,0.98);
      box-shadow: 0 18px 40px rgba(15,23,42,0.16);
      display: none;
    }

    .time-picker-popover.open {
      display: block;
    }

    .time-picker-panel {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 12px;
    }

    .time-picker-column {
      min-width: 0;
    }

    .time-picker-colhead {
      margin: 0 0 8px 0;
      font-size: 12px;
      font-weight: 700;
      color: var(--muted);
    }

    .time-picker-options {
      max-height: 228px;
      overflow: auto;
      display: grid;
      gap: 6px;
      padding-right: 2px;
    }

    .time-picker-option {
      width: 100%;
      min-height: 34px;
      border: 1px solid rgba(220,226,232,0.95);
      border-radius: 12px;
      background: rgba(248,250,252,0.96);
      color: inherit;
      font: inherit;
      cursor: pointer;
      transition: border-color 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease;
    }

    .time-picker-option:hover,
    .time-picker-option:focus {
      border-color: #b8cdf8;
      background: rgba(240,246,255,0.98);
      outline: none;
    }

    .time-picker-option.active {
      border-color: #a9c3f3;
      background: rgba(232,241,255,0.98);
      box-shadow: inset 0 0 0 1px rgba(26, 115, 232, 0.08);
      font-weight: 700;
    }

    .end-time-undefined-option {
      margin-top: 0 !important;
      font-size: 13px;
      color: var(--muted);
      display: inline-flex;
      align-items: center;
      gap: 8px;
      white-space: nowrap;
      flex: 0 0 auto;
      justify-content: flex-end;
    }

    .week-all-day-grid {
      pointer-events: auto !important;
    }

    .week-all-day-bars {
      pointer-events: none;
    }

    .week-all-day-bar {
      pointer-events: auto;
    }

    .week-all-day-cell {
      cursor: pointer;
    }
  

