/* --- ベースリセット & レイアウト --- */
.dcm-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
    line-height: 1.6;
    background-color: #f4f7f9;
    min-height: 100vh;
    box-sizing: border-box;
}

.dcm-wrapper *,
.dcm-wrapper *::before,
.dcm-wrapper *::after {
    box-sizing: inherit;
}

/* SWELL等のテーマスタイルリセット */
.dcm-wrapper h2,
.dcm-wrapper h3,
.dcm-wrapper h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    line-height: 1.3;
    border: none;
    padding: 0;
}

.dcm-wrapper ul,
.dcm-wrapper li {
    list-style: none;
    margin: 0;
    padding: 0;
    background: transparent;
}

.dcm-wrapper p {
    margin-bottom: 1em;
}

/* --- ログイン画面（ランディング）専用スタイル --- */
.dcm-landing {
    width: 100%;
    max-width: 400px;
    /* ここで幅を制限 */
    margin: 40px auto;
    text-align: center;
}

/* ログイン画面内のカードは左寄せにして入力しやすく */
.dcm-landing .dcm-card {
    text-align: left;
    margin-bottom: 25px;
}

.dcm-landing h2 {
    margin-bottom: 30px;
    font-size: 1.5rem;
    color: #333;
}

.dcm-landing h3 {
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* --- コンポーネント: カード --- */
.dcm-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    /* 余白を少し広めに */
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    /* 影を少しリッチに */
    border: 1px solid rgba(0, 0, 0, 0.02);
}

/* --- コンポーネント: ヘッダーバー --- */
.dcm-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    margin-bottom: 20px;
}

.dcm-top-bar h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: bold;
}

.dcm-logout {
    font-size: 0.8rem;
    color: #d63638;
    border: 1px solid #d63638;
    padding: 4px 12px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s;
    background: #fff;
}

.dcm-logout:hover {
    background: #d63638;
    color: #fff;
}

/* --- コンポーネント: タブナビゲーション --- */
.dcm-nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5px;
    border-bottom: none;
}

.dcm-nav-tabs::-webkit-scrollbar {
    display: none;
}

.dcm-nav-tabs a {
    display: inline-block;
    padding: 10px 18px;
    text-decoration: none;
    color: #666;
    background: #e9ecef;
    border-radius: 25px;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.2s;
    border: none;
    flex-shrink: 0;
}

.dcm-nav-tabs a.active {
    background: #007cba;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 124, 186, 0.3);
}

/* --- コンポーネント: ボタン --- */
.dcm-wrapper .button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid #ccc;
    background: #fff;
    color: #333;
    transition: all 0.2s;
    line-height: 1.4;
    min-height: 48px;
    /* タップしやすく */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dcm-wrapper .button:active {
    transform: translateY(1px);
}

.dcm-wrapper .button:hover {
    background: #f9f9f9;
    opacity: 0.9;
}

.dcm-wrapper .button-primary {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
    box-shadow: 0 4px 10px rgba(0, 124, 186, 0.2);
}

.dcm-wrapper .button-small {
    padding: 6px 12px;
    font-size: 0.85rem;
    min-height: 36px;
}

.dcm-wrapper .button-link-delete {
    color: #d63638;
    border-color: #d63638;
    background: #fff;
}

/* --- コンポーネント: フォーム --- */
.dcm-form-row {
    margin-bottom: 20px;
}

.dcm-form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 0.95rem;
    color: #444;
}

.dcm-form-row input[type="text"],
.dcm-form-row input[type="email"],
.dcm-form-row input[type="password"],
.dcm-form-row select,
/* ランディングページ用のスタイル強化 */
.dcm-landing input[type="text"],
.dcm-landing input[type="email"],
.dcm-landing input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: #fcfcfc;
    appearance: none;
    box-sizing: border-box;
    /* 重要 */
    margin-bottom: 5px;
}

.dcm-form-row input:focus,
.dcm-landing input:focus {
    background: #fff;
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* --- カレンダーUI --- */
.dcm-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dcm-cal-nav {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: bold;
    font-size: 1.1rem;
}

.dcm-cal-title {
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
}

.dcm-cal-title:hover {
    background: #f0f0f0;
}

.dcm-calendar-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fff;
}

.dcm-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #fff;
    min-width: 600px;
    /* スマホでの横スクロール用 */
}

.dcm-th {
    text-align: center;
    padding: 12px 0;
    background: #f8f9fa;
    font-weight: bold;
    font-size: 0.85rem;
    color: #666;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #eee;
}

.dcm-th.sun {
    color: #d63638;
}

.dcm-th.sat {
    color: #007cba;
}

.dcm-day {
    aspect-ratio: 0.9;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.dcm-day:active {
    background-color: #eef4f9;
}

.dcm-day.other-month {
    background-color: #f9f9f9;
    color: #ccc;
}

.dcm-day.other-month .dcm-num {
    color: #ddd;
}

.dcm-day.sunday,
.dcm-day.holiday {
    background-color: #fff5f5;
    color: #d63638;
}

.dcm-day.saturday {
    background-color: #f0f8ff;
    color: #007cba;
}

.dcm-num {
    position: absolute;
    top: 6px;
    left: 8px;
    font-size: 0.8rem;
    font-weight: bold;
    color: #555;
}

.dcm-assign-box {
    margin-top: 14px;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* --- サマリテーブル --- */
.dcm-summary-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid #eee;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* テーブル共通設定 */
.dcm-table {
    width: 100%;
    border-collapse: collapse;
    /* white-space: nowrap; と min-width: 600px; をここから削除 */
}

/* サマリ画面（スクロールが必要な箇所）のみ幅を固定 */
.dcm-summary-wrapper .dcm-table {
    white-space: nowrap;
    min-width: 600px;
}

.dcm-table th, .dcm-table td {
    padding: 15px 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #eee;
    font-size: 0.9rem;
}

.dcm-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #555;
    position: sticky;
    top: 0;
    z-index: 2;
}

/* 固定列 */
.dcm-table td:first-child,
.dcm-table th:first-child {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 3;
    border-right: 2px solid #eee;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.02);
}

.dcm-table th:first-child {
    background: #f8f9fa;
    z-index: 4;
}

/* --- リスト・モーダル --- */
.dcm-member-list li {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dcm-handle {
    padding: 10px;
    color: #ccc;
    font-size: 1.5rem;
    cursor: grab;
}

.dcm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.dcm-modal-content {
    background: #fff;
    width: 90%;
    max-width: 450px;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: #333;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.dcm-modal-title {
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 25px;
    font-weight: bold;
    color: #333;
}

.dcm-modal-footer {
    margin-top: 25px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ルーム選択リスト */
.dcm-room-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.dcm-room-list li {
    margin-bottom: 10px;
}

.dcm-room-list li button {
    width: 100%;
    text-align: left;
    padding: 15px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dcm-room-list li button:active {
    background: #f0f0f0;
}

/* カラーパレット */
.dcm-color-palette {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-top: 10px;
    justify-content: center;
}

.dcm-color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.1s;
    box-sizing: content-box;
}

.dcm-color-option.selected {
    border-color: #333;
    transform: scale(1.1);
}

.dcm-color-preview {
    width: 16px;
    height: 16px;
    display: inline-block;
    border-radius: 50%;
    border: 1px solid #ddd;
    margin-right: 8px;
    vertical-align: middle;
}