/* Stage110_9 split stylesheet: view switch, cards, popover, and overlay components (from rail-signal-calendar-v82.css lines 1812-2543) */

/* --- style block 02 --- */
    .view-switch {
      display: inline-flex;
      align-items: center;
      padding: 4px;
      border-radius: 999px;
      background: rgba(241, 243, 244, 0.96);
      border: 1px solid rgba(218, 220, 224, 0.95);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
      gap: 4px;
    }

    .view-switch-btn {
      min-width: 52px;
      min-height: 36px;
      border: none;
      border-radius: 999px;
      padding: 0 14px;
      background: transparent;
      color: var(--muted);
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
    }

    .view-switch-btn:hover {
      background: rgba(26, 115, 232, 0.08);
      color: var(--primary);
    }

    .view-switch-btn.active {
      background: linear-gradient(180deg, var(--primary), var(--primary-strong));
      color: #fff;
      box-shadow: 0 10px 20px rgba(26, 115, 232, 0.24);
    }

    .calendar-frame.is-week-view {
      overflow: hidden;
    }

    .calendar-frame.is-week-view > .weekdays {
      display: none !important;
    }

    .calendar-frame.is-week-view #calendarGrid {
      display: block;
    }

    .week-view {
      --time-gutter: 72px;
      --slot-height: 24px;
      --slots-per-day: 48;
      --day-height: calc(var(--slot-height) * var(--slots-per-day));
      background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248, 250, 252, 0.96));
    }

    .week-view-head {
      display: grid;
      grid-template-columns: var(--time-gutter) repeat(7, minmax(0, 1fr));
      border-bottom: 1px solid var(--line-strong);
      background: rgba(255,255,255,0.92);
      position: sticky;
      top: 0;
      z-index: 5;
      backdrop-filter: blur(14px);
    }

    .week-head-spacer {
      border-right: 1px solid var(--line);
      background: linear-gradient(180deg, rgba(250,251,255,0.98), rgba(246,248,252,0.96));
    }

    .week-head-day {
      min-height: 70px;
      padding: 10px 10px 9px;
      border-right: 1px solid var(--line);
      background: rgba(255,255,255,0.92);
      display: flex;
      flex-direction: column;
      gap: 3px;
      align-items: flex-start;
      justify-content: center;
      text-align: left;
      cursor: pointer;
      transition: background 0.16s ease, box-shadow 0.16s ease;
      position: relative;
    }

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

    .week-head-day:hover {
      background: #f8fbff;
    }

    .week-head-day.selected {
      background: linear-gradient(180deg, rgba(232,240,254,0.96), rgba(246,250,255,0.98));
      box-shadow: inset 0 -2px 0 rgba(26, 115, 232, 0.4);
    }

    .week-head-day.today {
      background: linear-gradient(180deg, rgba(232,240,254,0.82), rgba(255,255,255,0.98));
    }

    .week-head-day.weekend-day {
      background: linear-gradient(180deg, rgba(253,248,248,0.95), rgba(255,255,255,0.98));
    }

    .week-head-day.outside-day {
      background: linear-gradient(180deg, rgba(243,246,251,0.92), rgba(248,250,253,0.96));
    }

    .week-head-weekday {
      font-size: 11px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--muted-2);
      font-weight: 700;
    }

    .week-head-date-row {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
    }

    .week-head-date {
      font-size: 26px;
      line-height: 1;
      font-weight: 650;
      letter-spacing: -0.04em;
      color: var(--text);
    }

    .week-head-date.weekend,
    .week-head-date.holiday {
      color: var(--holiday);
    }

    .week-head-badge {
      min-width: 26px;
      height: 26px;
      padding: 0 9px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(180deg, var(--primary), var(--primary-strong));
      color: #fff;
      font-size: 13px;
      font-weight: 700;
      box-shadow: 0 8px 18px rgba(26, 115, 232, 0.25);
    }

    .week-head-holiday {
      font-size: 12px;
      color: var(--holiday);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 100%;
    }

    .week-all-day-wrap {
      display: grid;
      grid-template-columns: var(--time-gutter) 1fr;
      border-bottom: 1px solid var(--line-strong);
      background: rgba(255,255,255,0.98);
    }

    .week-all-day-label {
      border-right: 1px solid var(--line);
      padding: 12px 10px;
      font-size: 12px;
      font-weight: 700;
      color: var(--muted-2);
      text-align: right;
      background: linear-gradient(180deg, rgba(250,251,255,0.98), rgba(246,248,252,0.96));
    }

    .week-all-day-track {
      position: relative;
      min-height: calc(var(--all-day-lanes, 1) * 28px + 16px);
      background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(251,252,255,0.98));
    }

    .week-all-day-grid {
      position: absolute;
      inset: 0;
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
      pointer-events: none;
    }

    .week-all-day-cell {
      border-right: 1px solid var(--line);
    }

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

    .week-all-day-bars {
      position: absolute;
      inset: 0;
    }

    .week-all-day-bar {
      position: absolute;
      height: 22px;
      border: none;
      border-radius: 11px;
      padding: 0 10px;
      font-size: 12px;
      font-weight: 600;
      line-height: 22px;
      box-shadow: var(--shadow);
      cursor: pointer;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      text-align: left;
      transition: transform 0.14s ease, box-shadow 0.14s ease;
    }

    .week-all-day-bar:hover {
      transform: translateY(-1px);
      box-shadow: var(--shadow-soft);
    }

    .week-all-day-bar.cont-left {
      border-top-left-radius: 6px;
      border-bottom-left-radius: 6px;
    }

    .week-all-day-bar.cont-right {
      border-top-right-radius: 6px;
      border-bottom-right-radius: 6px;
    }

    .week-scroll {
      max-height: min(1100px, calc(100vh - 250px));
      overflow: auto;
      background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
    }

    .week-time-board {
      display: grid;
      grid-template-columns: var(--time-gutter) repeat(7, minmax(0, 1fr));
      align-items: start;
      min-width: 100%;
    }

    .week-time-gutter {
      position: relative;
      height: var(--day-height);
      border-right: 1px solid var(--line);
      background:
        linear-gradient(180deg, rgba(250,251,255,0.98), rgba(246,248,252,0.96));
    }

    .week-time-label {
      position: absolute;
      right: 10px;
      transform: translateY(-50%);
      font-size: 11px;
      font-weight: 600;
      color: var(--muted-2);
      letter-spacing: 0.01em;
    }

    .week-day-column {
      position: relative;
      height: var(--day-height);
      border-right: 1px solid var(--line);
      background:
        repeating-linear-gradient(
          to bottom,
          rgba(255,255,255,0) 0,
          rgba(255,255,255,0) calc(var(--slot-height) - 1px),
          rgba(217, 220, 224, 0.35) calc(var(--slot-height) - 1px),
          rgba(217, 220, 224, 0.35) var(--slot-height)
        ),
        repeating-linear-gradient(
          to bottom,
          rgba(255,255,255,0) 0,
          rgba(255,255,255,0) calc(var(--slot-height) * 2 - 1px),
          rgba(221, 227, 234, 0.95) calc(var(--slot-height) * 2 - 1px),
          rgba(221, 227, 234, 0.95) calc(var(--slot-height) * 2)
        ),
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.94));
      transition: background 0.16s ease, box-shadow 0.16s ease;
    }

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

    .week-day-column.selected-day {
      background:
        repeating-linear-gradient(
          to bottom,
          rgba(255,255,255,0) 0,
          rgba(255,255,255,0) calc(var(--slot-height) - 1px),
          rgba(217, 220, 224, 0.35) calc(var(--slot-height) - 1px),
          rgba(217, 220, 224, 0.35) var(--slot-height)
        ),
        repeating-linear-gradient(
          to bottom,
          rgba(255,255,255,0) 0,
          rgba(255,255,255,0) calc(var(--slot-height) * 2 - 1px),
          rgba(221, 227, 234, 0.95) calc(var(--slot-height) * 2 - 1px),
          rgba(221, 227, 234, 0.95) calc(var(--slot-height) * 2)
        ),
        linear-gradient(180deg, rgba(232,240,254,0.26), rgba(248,251,255,0.98));
    }

    .week-day-column.today-day {
      box-shadow: inset 0 0 0 1px rgba(26, 115, 232, 0.13);
    }

    .week-day-column.weekend-day {
      background:
        repeating-linear-gradient(
          to bottom,
          rgba(255,255,255,0) 0,
          rgba(255,255,255,0) calc(var(--slot-height) - 1px),
          rgba(217, 220, 224, 0.32) calc(var(--slot-height) - 1px),
          rgba(217, 220, 224, 0.32) var(--slot-height)
        ),
        repeating-linear-gradient(
          to bottom,
          rgba(255,255,255,0) 0,
          rgba(255,255,255,0) calc(var(--slot-height) * 2 - 1px),
          rgba(221, 227, 234, 0.94) calc(var(--slot-height) * 2 - 1px),
          rgba(221, 227, 234, 0.94) calc(var(--slot-height) * 2)
        ),
        linear-gradient(180deg, rgba(253,248,248,0.7), rgba(255,255,255,0.98));
    }

    .week-slot {
      height: var(--slot-height);
      position: relative;
      cursor: crosshair;
    }

    .week-slot::after {
      content: "";
      position: absolute;
      inset: 0;
      transition: background 0.12s ease;
    }

    .week-slot:hover::after {
      background: rgba(26, 115, 232, 0.04);
    }

    .week-time-preview {
      position: absolute;
      left: 6px;
      right: 6px;
      border-radius: 12px;
      background: rgba(26, 115, 232, 0.14);
      border: 1px dashed rgba(26, 115, 232, 0.42);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.36);
      pointer-events: none;
      display: none;
      z-index: 1;
    }

    .week-event {
      position: absolute;
      border: none;
      border-radius: 14px;
      padding: 6px 8px;
      box-shadow: 0 14px 24px rgba(15, 23, 42, 0.13);
      cursor: pointer;
      overflow: hidden;
      text-align: left;
      transition: transform 0.14s ease, box-shadow 0.14s ease;
      z-index: 3;
    }

    .week-event:hover {
      transform: translateY(-1px);
      box-shadow: 0 18px 30px rgba(15, 23, 42, 0.18);
    }

    .week-event.compact {
      padding-top: 4px;
      padding-bottom: 4px;
    }

    .week-event-time {
      font-size: 11px;
      line-height: 1.2;
      font-weight: 700;
      opacity: 0.88;
    }

    .week-event-title {
      margin-top: 3px;
      font-size: 12px;
      font-weight: 650;
      line-height: 1.35;
      overflow: hidden;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 3;
    }

    .week-now-line {
      position: absolute;
      left: 0;
      right: 0;
      height: 2px;
      background: #ea4335;
      box-shadow: 0 0 0 1px rgba(234, 67, 53, 0.12);
      z-index: 4;
      pointer-events: none;
    }

    .week-now-line::before {
      content: "";
      position: absolute;
      left: -6px;
      top: 50%;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: #ea4335;
      transform: translateY(-50%);
      box-shadow: 0 0 0 2px rgba(234, 67, 53, 0.14);
    }

    .week-view-empty {
      padding: 18px 18px 24px;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.6;
      background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(249,251,254,0.98));
      border-top: 1px solid var(--line);
    }

    .event-popover {
      position: fixed;
      z-index: 1600;
      width: min(320px, calc(100vw - 28px));
      border-radius: 18px;
      border: 1px solid rgba(226, 229, 234, 0.95);
      background: rgba(255,255,255,0.94);
      backdrop-filter: blur(18px);
      box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
      padding: 14px 14px 13px;
      display: none;
      color: var(--text);
    }

    .event-popover.show {
      display: block;
    }

    .event-popover-head {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      margin-bottom: 10px;
    }

    .event-popover-head > div:last-child {
      min-width: 0;
      flex: 1 1 auto;
    }

    .event-popover-dot {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      flex: none;
      margin-top: 5px;
      box-shadow: 0 0 0 3px rgba(255,255,255,0.96), 0 0 0 4px rgba(15,23,42,0.05);
    }

    .event-popover-title {
      font-size: 15px;
      font-weight: 700;
      line-height: 1.35;
      letter-spacing: -0.015em;
    }

    .event-popover-time-line {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      margin-top: 6px;
    }

    .event-popover-source-line {
      display: flex;
      align-items: center;
      min-width: 0;
      margin-top: 6px;
    }

    .event-popover-meta-line {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      min-width: 0;
      margin-top: 6px;
    }

    .event-popover-meta-left,
    .event-popover-meta-right {
      min-width: 0;
      display: inline-flex;
      align-items: center;
    }

    .event-popover-meta-left {
      flex: 0 1 auto;
      max-width: min(56%, 220px);
    }

    .event-popover-meta-right {
      flex: 1 1 auto;
      justify-content: flex-end;
    }

    .event-popover-source-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      min-width: 0;
      max-width: 100%;
      min-height: 20px;
      padding: 0 7px;
      border-radius: 999px;
      background: rgba(15, 23, 42, 0.045);
      border: 1px solid rgba(148, 163, 184, 0.18);
      color: var(--muted);
      font-size: 10px;
      font-weight: 700;
      line-height: 1.2;
      letter-spacing: -0.01em;
      vertical-align: middle;
    }

    .event-popover-source-badge.readonly {
      background: rgba(148, 163, 184, 0.08);
      border-color: rgba(148, 163, 184, 0.22);
      color: color-mix(in srgb, var(--muted) 90%, #64748b 10%);
    }

    .event-popover-source-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      flex: none;
    }

    .event-popover-source-label {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .event-popover-time,
    .event-popover-location,
    .event-popover-desc {
      font-size: 13px;
      line-height: 1.55;
      color: var(--muted);
      margin-top: 6px;
    }

    .event-popover-time-line .event-popover-time {
      margin-top: 0;
    }

    .event-popover-time-line .event-popover-source-badge {
      flex: 0 1 auto;
      max-width: min(62%, 220px);
    }

    .event-popover-meta-line .event-popover-location {
      margin-top: 0;
      min-width: 0;
      flex: 1 1 auto;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      text-align: right;
      line-height: 1.28;
    }

    .event-input-basis-badge.is-popover {
      display: inline-flex;
      align-items: center;
      min-height: 22px;
      padding: 0 8px;
      border-radius: 999px;
      background: rgba(255, 247, 237, 0.96);
      border: 1px solid rgba(253, 186, 116, 0.72);
      color: #c2410c;
      font-size: 10px;
      font-weight: 800;
      line-height: 1.2;
      letter-spacing: -0.01em;
      white-space: nowrap;
    }

    .event-popover-desc {
      color: var(--text);
      white-space: pre-wrap;
      max-height: 140px;
      overflow: auto;
      padding-top: 2px;
    }

    .event-popover-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 10px;
    }

    .event-popover-tag {
      display: inline-flex;
      align-items: center;
      min-height: 24px;
      padding: 0 10px;
      border-radius: 999px;
      background: rgba(232,240,254,0.9);
      color: var(--primary);
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.01em;
    }

    .week-summary-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      min-height: 30px;
      padding: 0 12px;
      border-radius: 999px;
      border: 1px solid rgba(218,220,224,0.95);
      background: rgba(255,255,255,0.85);
      font-size: 12px;
      font-weight: 600;
      color: var(--muted);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
    }

    .week-summary-chip strong {
      color: var(--text);
      font-weight: 700;
    }

    @media (max-width: 1460px) {
      .view-switch {
        order: 3;
      }

      .week-view {
        --time-gutter: 64px;
        --slot-height: 22px;
      }
    }

    @media (max-width: 980px) {
      .week-view {
        --time-gutter: 54px;
        --slot-height: 20px;
      }

      .week-head-date {
        font-size: 22px;
      }

      .week-head-day {
        min-height: 64px;
        padding-inline: 8px;
      }

      .view-switch {
        width: 100%;
        justify-content: center;
      }
    }

    .color-field {
      display: none !important;
    }

    .day-count {
      display: none !important;
    }

    .event-card {
      padding-right: 74px;
    }

    .event-actions {
      position: absolute;
      top: 12px;
      right: 10px;
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-top: 0;
      align-items: flex-end;
    }

    .event-actions .ghost-btn,
    .event-actions .danger-btn {
      min-height: auto;
      padding: 6px 10px;
      font-size: 12px;
      border-radius: 999px;
      box-shadow: none;
    }

  

