/* Stage110_9 split stylesheet: mobile layout, toolbar, swipe, and compact agenda styling (from rail-signal-calendar-v82.css lines 3855-4550) */

/* --- style block 14 --- */
    .mobile-layout-switch {
      display: none;
      align-items: center;
      gap: 6px;
      margin: 0 0 12px;
      padding: 4px;
      border-radius: 16px;
      background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,249,252,0.96));
      border: 1px solid rgba(226, 229, 234, 0.95);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.76);
    }

    .mobile-layout-btn {
      flex: 1 1 0;
      min-height: 38px;
      padding: 0 12px;
      border: 1px solid transparent;
      border-radius: 12px;
      background: transparent;
      color: #5f6c84;
      font-size: 13px;
      font-weight: 700;
      letter-spacing: -0.02em;
      cursor: pointer;
      transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
    }

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

    .mobile-layout-btn.active {
      background: rgba(26, 115, 232, 0.12);
      color: var(--primary);
      border-color: rgba(26, 115, 232, 0.16);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
    }

    .mobile-layout-btn:focus-visible {
      outline: none;
      box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.18);
    }

    @media (max-width: 860px) {
      body.mobile-ui {
        -webkit-text-size-adjust: 100%;
      }

      body.mobile-ui .mobile-layout-switch {
        display: flex;
      }

      body.mobile-ui .header {
        padding: 14px;
      }

      body.mobile-ui .app-title-row {
        gap: 10px;
      }

      body.mobile-ui .app-brand h1 {
        font-size: 24px;
      }

      body.mobile-ui .header-side {
        width: 100%;
        justify-content: space-between;
      }

      body.mobile-ui .layout {
        grid-template-columns: 1fr;
      }

      body.mobile-ui .rail-panel,
      body.mobile-ui .side-panel,
      body.mobile-ui .calendar-main-panel {
        position: static;
        top: auto;
        min-width: 0;
      }

      body.mobile-layout-calendar .layout > .rail-panel {
        display: none !important;
      }

      body.mobile-layout-calendar .layout > .calendar-main-panel,
      body.mobile-layout-calendar .layout > .side-panel {
        display: block !important;
      }

      body.mobile-layout-rail .layout > .calendar-main-panel,
      body.mobile-layout-rail .layout > .side-panel {
        display: none !important;
      }

      body.mobile-layout-side .layout > .calendar-main-panel,
      body.mobile-layout-side .layout > .rail-panel {
        display: none !important;
      }

      body.mobile-ui .toolbar {
        padding: 10px;
        gap: 10px;
      }

      body.mobile-ui .toolbar-left,
      body.mobile-ui .toolbar-right {
        width: 100%;
        gap: 8px;
      }

      body.mobile-ui .toolbar-left {
        justify-content: space-between;
      }

      body.mobile-ui .toolbar-right {
        justify-content: flex-start;
      }

      body.mobile-ui .month-meta {
        display: none;
      }

      body.mobile-ui .view-switch {
        order: 1;
      }

      body.mobile-ui .calendar-expand-btn {
        min-width: 40px;
        width: 40px;
        height: 40px;
      }

      body.mobile-ui .nav-btn,
      body.mobile-ui .ghost-btn,
      body.mobile-ui .primary-btn,
      body.mobile-ui .danger-btn,
      body.mobile-ui .day-add-btn,
      body.mobile-ui .view-switch-btn {
        min-height: 40px;
      }

      body.mobile-ui .calendar-frame,
      body.mobile-ui .week-scroll,
      body.mobile-ui .rail-panel,
      body.mobile-ui .side-panel {
        -webkit-overflow-scrolling: touch;
      }

      body.mobile-ui .calendar-frame {
        overflow: auto;
      }

      body.mobile-ui .calendar-strip-actions {
        flex-wrap: wrap;
      }

      body.mobile-ui .event-actions {
        position: static;
        flex-direction: row;
        justify-content: flex-end;
        margin-top: 8px;
      }

      body.mobile-ui .event-card {
        padding-right: 14px;
      }

      body.mobile-ui .agenda-group {
        margin-bottom: 12px;
      }

      body.mobile-ui .agenda-group-header {
        margin: 0 0 7px;
        padding: 0 1px;
      }

      body.mobile-ui .agenda-group-title {
        font-size: 12.5px;
      }

      body.mobile-ui .agenda-group-count {
        font-size: 11px;
      }

      body.mobile-ui .selected-date-hero {
        padding: 14px;
      }

      body.mobile-ui .week-day-column {
        min-width: 168px;
      }

      body.mobile-ui .week-head-day {
        min-height: 46px;
      }

      body.mobile-ui.calendar-expanded .mobile-layout-switch {
        display: none !important;
      }

      body.mobile-layout-calendar .side-panel {
        margin-top: 10px;
      }

      body.mobile-ui .side-panel-head {
        padding-bottom: 8px;
      }

      body.mobile-ui .side-panel-head .primary-btn {
        display: none !important;
      }

      body.mobile-ui .day-body .event-chip:not(.more-chip) {
        min-height: 18px;
        padding: 1px 6px !important;
        border-radius: 999px !important;
        gap: 0 !important;
        align-items: center !important;
      }

      body.mobile-ui .day-body .event-chip:not(.more-chip) .event-dot,
      body.mobile-ui .day-body .event-chip:not(.more-chip) .event-chip-time {
        display: none !important;
      }

      body.mobile-ui .day-body .event-chip:not(.more-chip) .event-chip-title {
        display: block !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-size: 11px !important;
        line-height: 1.25 !important;
      }
    }
  

/* --- style block 15 --- */
    .calendar-main-panel {
      position: relative;
    }

    .calendar-expand-btn {
      min-width: 36px;
      width: 36px;
      height: 36px;
      padding: 0;
      border: 1px solid rgba(26, 115, 232, 0.14);
      border-radius: 999px;
      background: rgba(26, 115, 232, 0.06);
      color: #5a6d8f;
      font-size: 16px;
      font-weight: 700;
      line-height: 1;
      cursor: pointer;
      display: inline-grid;
      place-items: center;
      transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
      flex: 0 0 auto;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
    }

    .calendar-expand-btn svg {
      width: 20px;
      height: 20px;
      display: block;
      stroke: currentColor;
      fill: none;
      stroke-width: 1.9;
      stroke-linecap: round;
      stroke-linejoin: round;
      vector-effect: non-scaling-stroke;
    }

    .calendar-expand-btn:hover {
      background: rgba(26, 115, 232, 0.12);
      border-color: rgba(26, 115, 232, 0.22);
      color: var(--primary);
    }

    .calendar-expand-btn:focus-visible {
      outline: none;
      box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.22);
    }

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

    body.calendar-expanded {
      overflow: hidden;
    }

    body.calendar-expanded .wrap {
      width: calc(100vw - 16px);
      max-width: none;
      margin: 8px auto;
    }

    body.calendar-expanded .header,
    body.calendar-expanded .layout > .rail-panel,
    body.calendar-expanded .layout > .side-panel {
      display: none !important;
    }

    body.calendar-expanded .layout {
      display: block;
    }

    body.calendar-expanded .calendar-main-panel {
      position: fixed;
      inset: 8px;
      z-index: 120;
      margin: 0;
      padding: 14px;
      border-radius: 24px;
      background: rgba(255, 255, 255, 0.98);
      border: 1px solid rgba(226, 229, 234, 0.96);
      box-shadow: 0 24px 56px rgba(15, 23, 42, 0.18);
      display: flex;
      flex-direction: column;
      gap: 14px;
      overflow: hidden;
      backdrop-filter: blur(10px);
    }

    body.calendar-expanded .calendar-main-panel > .toolbar-shell {
      flex: 0 0 auto;
      margin-bottom: 0;
    }

    body.calendar-expanded .calendar-main-panel > .calendar-frame {
      flex: 1 1 auto;
      min-height: 0;
      overflow: auto !important;
      display: flex;
      flex-direction: column;
    }

    body.calendar-expanded .calendar-main-panel > .calendar-frame > #calendarGrid {
      flex: 1 1 auto;
    }

    body.calendar-expanded .toolbar {
      padding: 10px 12px;
    }

    body.calendar-expanded .month-title {
      font-size: 28px;
    }

    body.calendar-expanded .month-meta {
      font-size: 14px;
    }

    body.calendar-expanded .day {
      min-height: 196px;
    }

    body.calendar-expanded .day-body {
      padding: 48px 10px 14px;
    }

    body.calendar-expanded .event-chip {
      align-items: flex-start;
      margin-bottom: 6px;
    }

    body.calendar-expanded .event-chip-title {
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      white-space: normal;
      overflow: hidden;
      text-overflow: ellipsis;
      line-height: 1.35;
    }

    body.calendar-expanded .holiday-name {
      white-space: normal;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      line-height: 1.35;
    }

    @media (max-width: 1180px) {
      body.calendar-expanded .calendar-main-panel {
        inset: 4px;
        padding: 10px;
        border-radius: 18px;
      }

      body.calendar-expanded .toolbar-left,
      body.calendar-expanded .toolbar-right {
        width: 100%;
      }

      body.calendar-expanded .search-shell {
        flex: 1 1 auto;
        min-width: 0;
      }
    }
  

/* --- style block 16 --- */
    html, body {
      max-width: 100%;
      overflow-x: hidden;
    }

    @media (max-width: 860px) {
      body.mobile-ui {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        overscroll-behavior-x: none;
      }

      body.mobile-ui .wrap {
        width: auto;
        max-width: none;
        margin: 6px 5px 18px;
      }

      body.mobile-ui .header,
      body.mobile-ui .layout,
      body.mobile-ui .panel,
      body.mobile-ui .calendar-main-panel,
      body.mobile-ui .toolbar-shell,
      body.mobile-ui .mobile-layout-switch,
      body.mobile-ui .toolbar,
      body.mobile-ui .toolbar-left,
      body.mobile-ui .toolbar-right,
      body.mobile-ui .calendar-frame {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
      }

      body.mobile-ui .calendar-frame {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior-x: none;
      }
    }
  

/* --- style block 17 --- */
    .mobile-calendar-toolbar {
      display: none;
    }

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

      body.mobile-ui .toolbar-shell {
        display: none !important;
      }

      body.mobile-ui .mini-calendar-section {
        display: none !important;
      }

      body.mobile-ui .mobile-calendar-toolbar {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 10px;
        margin: 0 0 10px;
        border: 1px solid rgba(15, 23, 42, 0.08);
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.94);
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
        overflow: hidden;
      }

      body.mobile-ui .mobile-cal-nav {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        min-width: 0;
        flex: 1 1 auto;
      }

      body.mobile-ui .mobile-cal-nav .nav-btn,
      body.mobile-ui .mobile-cal-nav .ghost-btn {
        min-width: 34px;
        min-height: 34px;
        padding: 0 8px;
        border-radius: 999px;
        font-size: 18px;
        flex: 0 0 auto;
      }

      body.mobile-ui .mobile-month-inline {
        min-width: 0;
        flex: 1 1 auto;
        text-align: center;
        font-size: 15px;
        font-weight: 800;
        color: #0f172a;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      body.mobile-ui .mobile-view-switch {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 3px;
        flex: 0 0 auto;
        border-radius: 999px;
        background: rgba(148, 163, 184, 0.12);
      }

      body.mobile-ui .mobile-view-btn {
        appearance: none;
        border: none;
        background: transparent;
        color: #475569;
        border-radius: 999px;
        min-width: 32px;
        min-height: 32px;
        padding: 0 8px;
        font-size: 13px;
        font-weight: 800;
        cursor: pointer;
      }

      body.mobile-ui .mobile-view-btn.active {
        background: linear-gradient(180deg, #2d7df7 0%, #1858c8 100%);
        color: #fff;
        box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
      }

      body.mobile-ui .mobile-view-btn:focus-visible {
        outline: 2px solid rgba(37, 99, 235, 0.35);
        outline-offset: 2px;
      }

      body.mobile-ui .toolbar-right .search-shell,
      body.mobile-ui .toolbar-right #newEventBtn,
      body.mobile-ui .calendar-expand-btn {
        display: none !important;
      }
    }
  

/* --- style block 18 --- */
    @media (max-width: 860px) {
      body.mobile-ui .day-head {
        left: 6px !important;
        right: 6px !important;
        gap: 4px !important;
      }

      body.mobile-ui .day-head-left {
        flex: 1 1 auto !important;
        min-width: 0 !important;
      }

      body.mobile-ui .day-head-right {
        flex: 0 0 auto !important;
        gap: 4px !important;
      }

      body.mobile-ui .day-add-btn {
        display: none !important;
      }

      body.mobile-ui .day-count:empty {
        display: none !important;
      }

      body.mobile-ui .holiday-name,
      body.mobile-ui .week-head-holiday {
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 2 !important;
        white-space: normal !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        overflow-wrap: anywhere !important;
        word-break: keep-all !important;
        max-width: 100% !important;
        line-height: 1.08 !important;
      }

      body.mobile-ui .holiday-name {
        margin-top: 2px !important;
        font-size: 10px !important;
      }

      body.mobile-ui .week-head-holiday {
        font-size: 10px !important;
      }

      body.mobile-ui .day-body .event-chip:not(.more-chip) {
        min-height: 16px !important;
      }

      body.mobile-ui .day-body .event-chip:not(.more-chip) .event-chip-title,
      body.mobile-ui .event-bar,
      body.mobile-ui .week-all-day-bar,
      body.mobile-ui .week-event-title,
      body.mobile-ui .week-event-time {
        font-size: 9px !important;
      }

      body.mobile-ui .day-body .event-chip:not(.more-chip) .event-chip-title {
        line-height: 1.14 !important;
      }

      body.mobile-ui .event-bar,
      body.mobile-ui .week-all-day-bar {
        padding-left: 6px !important;
        padding-right: 6px !important;
        line-height: 17px !important;
      }

      body.mobile-ui .week-event-title {
        line-height: 1.16 !important;
      }

      body.mobile-ui .week-event-time {
        line-height: 1.05 !important;
      }
    }
  

/* --- style block 19 --- */
    .mobile-agenda-compact-bar {
      display: none;
    }

    @media (max-width: 860px) {
      body.mobile-ui .side-panel-head {
        display: none !important;
      }

      body.mobile-ui .mobile-agenda-compact-bar {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
        padding: 2px 0 6px !important;
        margin: 0 0 6px !important;
        min-width: 0 !important;
      }

      body.mobile-ui .mobile-agenda-compact-label {
        flex: 0 1 auto !important;
        min-width: 0 !important;
        font-size: 12px !important;
        font-weight: 800 !important;
        letter-spacing: -0.02em !important;
        color: #1f2937 !important;
        white-space: nowrap !important;
      }

      body.mobile-ui .mobile-agenda-compact-meta {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        text-align: right !important;
        font-size: 10px !important;
        line-height: 1.2 !important;
        color: #6b7280 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
      }

      body.mobile-ui .selected-date-hero,
      body.mobile-ui .detail-date,
      body.mobile-ui .agenda-summary {
        display: none !important;
      }

      body.mobile-ui #eventList {
        margin-top: 0 !important;
      }
    }
  

