/* カレンダー（予定モーダル・FullCalendar・画面クロム） */
/* --- Event modal (Phase 3) --- */
.wpg-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(17, 24, 39, 0.45);
    backdrop-filter: blur(4px);
}

@media (min-width: 768px) {
    .wpg-sheet-backdrop {
        align-items: center;
        padding: var(--wpg-space-4);
    }
}

.wpg-sheet {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 42rem;
    max-height: 90vh;
    overflow: hidden;
    background: var(--wpg-surface);
    border: 1px solid #f3f4f6;
    border-radius: var(--wpg-radius-lg) var(--wpg-radius-lg) 0 0;
    box-shadow: var(--wpg-shadow-md);
}

@media (min-width: 768px) {
    .wpg-sheet {
        height: min(95vh, calc(100svh - 2rem));
        max-height: calc(100svh - 2rem);
        margin: auto;
        border-radius: var(--wpg-radius-lg);
    }
}

.wpg-sheet-header,
.wpg-sheet-footer {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    z-index: 30;
    background: #f9fafb;
    border-color: var(--wpg-line);
}

.wpg-sheet-header {
    justify-content: space-between;
    padding: var(--wpg-space-3) var(--wpg-space-5);
    border-bottom: 1px solid var(--wpg-line);
}

.wpg-sheet-footer {
    justify-content: flex-end;
    gap: var(--wpg-space-2);
    padding: var(--wpg-space-4);
    border-top: 1px solid var(--wpg-line);
}

@media (min-width: 768px) {
    .wpg-sheet-footer {
        padding-top: var(--wpg-space-3);
        padding-bottom: var(--wpg-space-3);
    }
}

.wpg-sheet-title {
    font-size: var(--wpg-text-lg);
    font-weight: 700;
    color: var(--wpg-ink);
}

@media (min-width: 768px) {
    .wpg-sheet-title {
        font-size: var(--wpg-text-xl);
    }
}

.wpg-sheet-close {
    border: none;
    background: transparent;
    color: var(--wpg-subtle);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.wpg-sheet-close:hover {
    color: var(--wpg-ink);
}

.wpg-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--wpg-space-4);
    display: flex;
    flex-direction: column;
    gap: var(--wpg-space-4);
    font-size: var(--wpg-text-lg);
}

@media (min-width: 768px) {
    .wpg-sheet-body {
        padding: var(--wpg-space-5);
        gap: var(--wpg-space-5);
    }
}

.wpg-field-row {
    display: flex;
    flex-direction: column;
    padding-bottom: var(--wpg-space-3);
    border-bottom: 1px solid #f3f4f6;
}

.wpg-field-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

@media (min-width: 768px) {
    .wpg-field-row {
        flex-direction: row;
        align-items: center;
    }

    .wpg-field-row.is-top {
        align-items: flex-start;
    }
}

.wpg-field-label {
    width: 100%;
    margin-bottom: var(--wpg-space-2);
    font-size: var(--wpg-text-lg);
    font-weight: 700;
    color: var(--wpg-ink);
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .wpg-field-label {
        width: 6rem;
        margin-bottom: 0;
    }

    .wpg-field-row.is-top .wpg-field-label {
        padding-top: 6px;
    }
}

.wpg-required {
    color: var(--wpg-danger);
    margin-left: 2px;
}

.wpg-field-control {
    flex: 1;
    min-width: 0;
}

.wpg-field-control-stack {
    display: flex;
    flex-direction: column;
    gap: var(--wpg-space-2);
}

.wpg-input-compact {
    border: 1px solid #d1d5db;
    border-radius: var(--wpg-radius-sm);
    padding: 6px 8px;
    font-size: var(--wpg-text-sm);
    color: var(--wpg-ink);
    background: #f9fafb;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.wpg-input-compact:focus {
    outline: none;
    border-color: var(--wpg-brand);
    background: var(--wpg-surface);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.12);
}

.wpg-input-compact:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wpg-datetime-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--wpg-space-2);
}

.wpg-datetime-label {
    width: 2rem;
    font-size: var(--wpg-text-sm);
    font-weight: 500;
    color: var(--wpg-subtle);
}

.wpg-time-pair {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.wpg-time-pair .wpg-input-compact {
    width: auto;
    min-width: 3.5rem;
}

.wpg-time-sep {
    flex-shrink: 0;
    font-weight: 700;
    color: var(--wpg-muted);
}

.wpg-input.wpg-input-grow,
.wpg-field-control > .wpg-input,
.wpg-field-control > textarea.wpg-input {
    flex: 1;
    width: 100%;
}

textarea.wpg-input {
    resize: none;
    min-height: 4.5rem;
    line-height: 1.5;
}

.wpg-option-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--wpg-space-4);
    font-size: var(--wpg-text-md);
    font-weight: 500;
    color: var(--wpg-ink);
}

.wpg-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: var(--wpg-text-sm);
    color: var(--wpg-ink);
}

.wpg-option strong {
    font-weight: 700;
}

.wpg-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--wpg-space-3);
    padding: var(--wpg-space-3);
    border-radius: var(--wpg-radius-md);
    border: 1px solid transparent;
    box-shadow: var(--wpg-shadow-sm);
}

.wpg-callout-brand {
    background: rgba(255, 247, 237, 0.7);
    border-color: var(--wpg-brand-border);
}

.wpg-callout-brand .wpg-callout-text {
    font-size: var(--wpg-text-sm);
    font-weight: 700;
    color: #9a3412;
}

.wpg-banner-warn {
    position: absolute;
    top: 3rem;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: var(--wpg-space-2) var(--wpg-space-5);
    font-size: var(--wpg-text-xs);
    font-weight: 700;
    color: var(--wpg-danger);
    background: #fee2e2;
    border-bottom: 1px solid #fecaca;
    box-shadow: var(--wpg-shadow-sm);
}

.wpg-subpanel {
    margin-top: var(--wpg-space-2);
    padding: var(--wpg-space-4);
    background: var(--wpg-surface);
    border: 1px solid #d1d5db;
    border-radius: var(--wpg-radius-sm);
    box-shadow: var(--wpg-shadow-sm);
    display: flex;
    flex-direction: column;
    gap: var(--wpg-space-4);
}

.wpg-subpanel-title {
    font-size: var(--wpg-text-xs);
    font-weight: 700;
    color: var(--wpg-ink);
    padding-bottom: var(--wpg-space-1);
    margin-bottom: var(--wpg-space-2);
    border-bottom: 1px solid var(--wpg-line);
}

.wpg-subpanel-stack {
    display: flex;
    flex-direction: column;
    gap: var(--wpg-space-2);
    font-size: var(--wpg-text-xs);
    color: #374151;
}

.wpg-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--wpg-space-2);
    padding: var(--wpg-space-1) 0;
}

.wpg-btn-muted {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    box-shadow: var(--wpg-shadow-sm);
}

.wpg-btn-muted:hover {
    background: #e5e7eb;
}

.wpg-btn-disabled,
.wpg-btn-disabled:hover {
    background: #f3f4f6;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.wpg-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--wpg-space-2);
    padding: 2px 0;
}

.wpg-summary-text {
    font-size: var(--wpg-text-md);
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: var(--wpg-space-2);
}

.wpg-summary-text.is-muted {
    color: var(--wpg-muted);
}

.wpg-picker-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--wpg-space-3);
    align-items: start;
    padding: 10px;
    border: 1px solid #f3f4f6;
    border-radius: var(--wpg-radius-sm);
    background: rgba(249, 250, 251, 0.7);
}

@media (min-width: 768px) {
    .wpg-picker-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.wpg-picker-col {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.wpg-picker-caption {
    display: block;
    margin-bottom: 6px;
    font-size: 10px;
    font-weight: 700;
    color: var(--wpg-muted);
}

.wpg-picker-box {
    width: 100%;
    overflow-y: auto;
    border-radius: var(--wpg-radius-sm);
    padding: 6px;
    border: 1px solid #d1d5db;
    background: var(--wpg-surface);
}

.wpg-picker-box.is-selected {
    height: 7rem;
    border-color: #bfdbfe;
    background: rgba(239, 246, 255, 0.55);
}

.wpg-picker-box.is-candidates {
    height: 62px;
}

.wpg-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--wpg-radius-sm);
    background: var(--wpg-info-soft);
    border: 1px solid #bfdbfe;
    box-shadow: var(--wpg-shadow-sm);
}

.wpg-file-chip a {
    font-weight: 700;
    color: var(--wpg-info);
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wpg-file-chip a:hover {
    text-decoration: underline;
}

.wpg-delete-panel {
    margin-top: var(--wpg-space-4);
    padding: var(--wpg-space-4);
    background: #f9fafb;
    border: 1px solid var(--wpg-line);
    border-radius: var(--wpg-radius-md);
}

.wpg-footer-grow {
    flex: 2;
}

@media (min-width: 640px) {
    .wpg-footer-grow,
    .wpg-sheet-footer .flex-1 {
        flex: initial;
    }
}

#eventModal.hidden,
#realtimeWarningArea.hidden,
#approvalActionArea.hidden,
#recurrenceDetailPanel.hidden,
#recurrenceToggleArea.hidden,
#weeklyDaysSelection.hidden,
#sharedToExpanded.hidden,
#usersExpanded.hidden,
#fileAttachmentList.hidden,
#deleteConditionArea.hidden,
#deleteBtn.hidden,
#copyBtn.hidden,
#saveBtn.hidden,
#eventFilePickBtn.hidden {
    display: none !important;
}


/* ==========================================
   FullCalendar & クロジカ風 カスタムデザイン
   ========================================== */
.fc { 
    --fc-border-color: var(--wpg-line); 
    --fc-page-bg-color: var(--wpg-surface);
    --fc-neutral-bg-color: #f9fafb;
    --fc-today-bg-color: var(--wpg-cal-today-bg);
    font-family: var(--wpg-font); 
}
.fc .fc-toolbar-title { 
    font-size: 1.1rem; 
    font-weight: 800; 
    color: #111827; 
}
.fc .fc-daygrid-event,
.fc .fc-timegrid-event {
    border-radius: var(--wpg-radius-event);
    font-size: 11px;
    font-weight: 700;
    border: none;
}
.fc .fc-daygrid-day.fc-day-sun,
.fc .fc-col-header-cell.fc-day-sun {
    background: rgba(255, 248, 247, 0.55);
}
.fc .fc-daygrid-day.fc-day-sat,
.fc .fc-col-header-cell.fc-day-sat {
    background: rgba(239, 246, 255, 0.45);
}

/* --- Calendar chrome (Phase 6) --- */
.wpg-cal-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: var(--wpg-surface);
    padding: var(--wpg-space-2);
}

@media (min-width: 768px) {
    .wpg-cal-main {
        padding: var(--wpg-space-5);
    }
}

.wpg-cal-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    gap: var(--wpg-space-2);
    width: 100%;
    flex-shrink: 0;
    padding-bottom: var(--wpg-space-3);
}

@media (min-width: 768px) {
    .wpg-cal-toolbar {
        flex-direction: row;
        align-items: center;
        gap: var(--wpg-space-3);
    }
}

.wpg-cal-toolbar-nav,
.wpg-cal-toolbar-left {
    display: flex;
    align-items: center;
    gap: var(--wpg-space-2);
    width: 100%;
    min-width: 0;
}

.wpg-cal-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 12rem;
    max-width: 28rem;
    min-width: 10rem;
    z-index: 30;
}

.wpg-cal-search .wpg-header-search {
    width: 100%;
    max-width: none;
    min-width: 0;
}

@media (min-width: 768px) {
    .wpg-cal-toolbar-nav,
    .wpg-cal-toolbar-left {
        width: auto;
        justify-content: flex-start;
        gap: var(--wpg-space-3);
    }
}

@media (max-width: 767px) {
    .wpg-cal-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .wpg-cal-toolbar-nav {
        grid-column: 1 / -1;
    }

    .wpg-cal-views {
        grid-column: 1;
        grid-row: 2;
    }

    .wpg-cal-search {
        grid-column: 2;
        grid-row: 2;
        flex: none;
        max-width: none;
        min-width: 0;
        margin-left: 8px;
    }
}

.wpg-cal-nav {
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    background: var(--wpg-surface);
    border: 1px solid #d1d5db;
    border-radius: var(--wpg-radius-sm);
    box-shadow: var(--wpg-shadow-sm);
}

.wpg-cal-nav-btn {
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: var(--wpg-muted);
    font-size: var(--wpg-text-lg);
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.wpg-cal-nav-btn + .wpg-cal-nav-btn {
    border-left: 1px solid var(--wpg-line);
}

.wpg-cal-nav-btn:hover {
    background: #f9fafb;
    color: var(--wpg-ink);
}

.wpg-cal-nav-btn:active {
    background: #f3f4f6;
}

@media (min-width: 768px) {
    .wpg-cal-nav-btn {
        padding: 6px 12px;
        font-size: var(--wpg-text-sm);
    }
}

.wpg-cal-today-btn {
    background: #6b7280;
    color: #fff;
    border: 1px solid #6b7280;
    border-radius: var(--wpg-radius-sm);
    padding: 8px 14px;
    font-size: var(--wpg-text-xs);
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--wpg-shadow-sm);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.wpg-cal-today-btn:hover {
    background: #4b5563;
    border-color: #4b5563;
}

@media (min-width: 768px) {
    .wpg-cal-today-btn {
        padding: 6px 14px;
    }
}

.wpg-cal-title {
    font-size: var(--wpg-text-lg);
    font-weight: 700;
    color: var(--wpg-ink);
    letter-spacing: -0.01em;
    text-align: left;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .wpg-cal-title {
        font-size: 1.25rem;
    }
}

.wpg-cal-views {
    display: inline-flex;
    width: 100%;
    justify-content: center;
    padding: 3px;
    background: #2d3748;
    border-radius: var(--wpg-radius-sm);
    box-shadow: var(--wpg-shadow-sm);
}

@media (min-width: 768px) {
    .wpg-cal-views {
        width: auto;
    }
}

.wpg-cal-view-btn {
    flex: 1;
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #9ca3af;
    font-size: var(--wpg-text-xs);
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

@media (min-width: 640px) {
    .wpg-cal-view-btn {
        flex: none;
    }
}

.wpg-cal-view-btn:hover {
    color: #fff;
}

.wpg-cal-view-btn.is-active {
    background: var(--wpg-brand);
    color: #fff;
}

.wpg-mode-switch {
    display: inline-flex;
    align-items: center;
    margin-left: var(--wpg-space-2);
    padding: 3px;
    background: #f3f4f6;
    border: 1px solid var(--wpg-line);
    border-radius: var(--wpg-radius-sm);
}

.wpg-mode-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--wpg-muted);
    font-size: var(--wpg-text-sm);
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.wpg-mode-btn:hover {
    color: var(--wpg-ink);
}

.wpg-mode-btn.is-active {
    background: var(--wpg-surface);
    color: var(--wpg-ink);
    box-shadow: var(--wpg-shadow-sm);
}

.wpg-cal-stage {
    position: relative;
    flex: 1;
    width: 100%;
    height: 100%;
}

.wpg-cal-board {
    position: absolute;
    inset: 0;
    z-index: 10;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--wpg-surface);
    border-top: 1px solid var(--wpg-line);
}

#custom-month-view.wpg-cal-board {
    border-left: 1px solid var(--wpg-line);
}

/* 月グリッド本体。高さは少なくともボードいっぱい。余った週は #custom-month-view 側でスクロール */
.wpg-cal-month-root {
    min-height: 100%;
}

/*
 * モバイル: FAB・ジェスチャバー・Android ナビで最終週が隠れないよう下端スペーサー。
 * padding + border-box だと min-height:100% に余白が飲み込まれて効かないため、
 * flex 子の固定高スペーサーでスクロール可能領域を確実に伸ばす。
 */
.wpg-cal-month-fab-spacer {
    display: none;
    flex-shrink: 0;
    width: 100%;
    height: 0;
    pointer-events: none;
}

@media (max-width: 767px) {
    .wpg-cal-month-fab-spacer {
        display: block;
        /* FAB 3.5rem + bottom 1rem + ブラウザ UI / ナビの余裕 + safe-area */
        height: calc(7rem + env(safe-area-inset-bottom, 0px));
    }

    #custom-week-view.wpg-cal-board,
    #custom-day-view.wpg-cal-board {
        padding-bottom: calc(7rem + env(safe-area-inset-bottom, 0px));
    }
}

.wpg-cal-day-holiday {
    background: var(--wpg-cal-holiday-bg) !important;
}

.wpg-cal-day-today {
    background: rgba(241, 248, 233, 0.45) !important;
}

.wpg-cal-date-sun,
.wpg-cal-date-holiday {
    color: var(--wpg-cal-sun) !important;
    font-weight: 700;
}

.wpg-cal-date-sat {
    color: var(--wpg-cal-sat) !important;
    font-weight: 700;
}

.wpg-cal-date-normal {
    color: #374151;
}

.wpg-cal-holiday-label {
    color: var(--wpg-cal-sun);
    font-size: 9px;
    font-weight: 700;
}

.wpg-cal-today-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: 0 4px;
    border-radius: 999px;
    background: var(--wpg-cal-today);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    box-shadow: var(--wpg-shadow-sm);
}

.wpg-cal-event {
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
    transition: filter 0.12s ease, background-color 0.12s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wpg-cal-event:hover {
    filter: brightness(1.08);
}

.wpg-cal-event-block {
    padding: 2px 6px;
    border-radius: var(--wpg-radius-event);
    color: #fff;
    font-size: 10px;
    box-shadow: var(--wpg-shadow-sm);
}

.wpg-cal-event-line {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 2px 0 2px 6px;
    border-left: 4px solid transparent;
    border-radius: 0 var(--wpg-radius-event) var(--wpg-radius-event) 0;
    background: rgba(255, 255, 255, 0.55);
    color: #1f2937;
    font-size: 10px;
}

.wpg-cal-event-line:hover {
    background: rgba(243, 244, 246, 0.9);
}

.wpg-cal-event-timed {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 6px;
    border-radius: var(--wpg-radius-event);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #fff;
    box-shadow: var(--wpg-shadow-sm);
    overflow: hidden;
    white-space: normal;
}

.wpg-cal-event-time {
    margin-bottom: 2px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 9px;
    font-weight: 500;
    opacity: 0.9;
    line-height: 1;
}

.wpg-cal-more {
    margin-top: 2px;
    padding: 2px 4px;
    border: 1px solid var(--wpg-line);
    border-radius: var(--wpg-radius-event);
    background: #f9fafb;
    color: var(--wpg-muted);
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--wpg-shadow-sm);
}

.wpg-cal-more:hover {
    background: #f3f4f6;
}

/* 稼働帯（通常予定ブロックとは形を変える薄いピル） */
.wpg-cal-work-row,
.wpg-cal-work-day-row {
    background: #f8fafc;
    min-height: 22px;
}

.wpg-cal-work-lane {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    min-height: 20px;
    padding: 2px 4px;
}

.wpg-cal-work-lane--week,
.wpg-cal-work-lane--day {
    flex-wrap: nowrap;
    overflow: hidden;
}

.wpg-cal-work-lane.is-empty {
    min-height: 18px;
}

.wpg-cal-work-month-strip {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 2px;
    min-height: 14px;
    max-height: 16px;
    margin-top: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.wpg-cal-work-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    height: 16px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    background: color-mix(in srgb, var(--wpg-work-color, #3b82f6) 16%, #ffffff);
    color: color-mix(in srgb, var(--wpg-work-color, #3b82f6) 78%, #111827);
    border: 1px solid color-mix(in srgb, var(--wpg-work-color, #3b82f6) 38%, #ffffff);
    box-shadow: none;
}

.wpg-cal-work-chip--month {
    height: 14px;
    padding: 0 5px;
    font-size: 8px;
}

.wpg-cal-work-chip:hover {
    filter: brightness(0.97);
}

.wpg-fab {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border: none;
    border-radius: 999px;
    background: var(--wpg-brand);
    color: #fff;
    box-shadow: 0 8px 16px rgba(255, 107, 0, 0.35);
    cursor: pointer;
    transition: transform 0.12s ease, background-color 0.15s ease;
}

.wpg-fab.is-apps-hidden {
    display: none !important;
}

.wpg-fab:hover {
    background: var(--wpg-brand-hover);
}

.wpg-fab:active {
    transform: scale(0.92);
}

@media (max-width: 767px) {
    .wpg-fab {
        display: inline-flex;
        right: calc(1rem + env(safe-area-inset-right, 0px));
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    }
}

/* 🔑 サイドバーがシュッと折りたたまれる設定 */
.sidebar-closed {
    width: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-right-width: 0 !important;
}

/* ==========================================
   🎯 クロジカ風チェックボックス（丸型カスタム）
   ========================================== */
#user-filters input[type="checkbox"],
#facility-filters input[type="checkbox"],
#category-filters input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease-in-out;
    background-color: #fff;
    margin-right: 0.25rem;
}

#user-filters input[type="checkbox"]:checked,
#facility-filters input[type="checkbox"]:checked,
#category-filters input[type="checkbox"]:checked {
    background-color: currentColor;
    border-color: currentColor;
}

#user-filters input[type="checkbox"]:checked::after,
#facility-filters input[type="checkbox"]:checked::after,
#category-filters input[type="checkbox"]:checked::after {
    content: "✓";
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
}

/* ==========================================
   ✨ スマホ（PWA）向け特有のセーフエリア対応
   ========================================== */
.pb-safe {
    padding-bottom: env(safe-area-inset-bottom, 20px);
}

/* ==========================================
   ✨ サイボウズ/クロジカ風・極細スクロールバー
   ========================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* スクロールバーを隠すユーティリティクラス */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 見る範囲（自分 / 部署 / グループ / 設備） */
.wpg-cal-filters .wpg-sidebar-stack {
    gap: 0.875rem;
}

.wpg-cal-lens {
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--wpg-brand-soft);
    border: 1px solid var(--wpg-brand-border);
}

.wpg-cal-lens-kicker {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--wpg-brand);
}

.wpg-cal-lens-title {
    margin: 2px 0 0;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
    color: var(--wpg-ink);
}

.wpg-cal-lens-hint,
.wpg-cal-field-hint,
.wpg-cal-count {
    margin: 4px 0 0;
    font-size: 11px;
    line-height: 1.45;
    color: var(--wpg-subtle);
}

.wpg-cal-count {
    margin: 0 0 6px;
}

.wpg-cal-filter-toggle {
    max-width: 9.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wpg-cal-scope-tabs {
    display: flex;
    width: 100%;
    gap: 4px;
}

.wpg-cal-scope-tabs .wpg-work-view-tab {
    flex: 1;
    min-width: 0;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 8px;
    padding: 7px 2px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #374151;
    cursor: pointer;
}

.wpg-cal-scope-tabs .wpg-work-view-tab.is-active {
    background: var(--wpg-brand-soft);
    border-color: var(--wpg-brand);
    color: var(--wpg-brand);
}

.wpg-cal-filter-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wpg-cal-filter-details > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    cursor: pointer;
    font-size: var(--wpg-text-xs);
    font-weight: 700;
    color: var(--wpg-subtle);
    letter-spacing: 0.02em;
}

.wpg-cal-filter-details > summary::-webkit-details-marker {
    display: none;
}

.wpg-cal-filter-details > summary::before {
    content: '▸';
    color: var(--wpg-subtle);
    font-size: 0.7rem;
}

.wpg-cal-filter-details[open] > summary::before {
    content: '▾';
}

.wpg-cal-filter-all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    font-weight: 700;
    color: var(--wpg-ink);
    cursor: pointer;
}

.wpg-cal-filter-all input {
    margin: 0;
}



