@charset "utf-8";

#sheetWrap {
    position: relative;
    width: 100%; max-width: 1280px; margin: 0 auto;
    color: var(--text-primary); font-size: 14px; line-height: 1.5;
    box-sizing: border-box;
}
#sheetWrap a { text-decoration: none; transition: 0.2s; }
#sheetWrap * { box-sizing: border-box; }

.trpg-nav-toolbar-slot {
    display: flex; align-items: center;
}
@media (max-width: 768px) {
    .trpg-nav-toolbar-slot .searchbar { max-width: none; flex: 1; }
}

#sheetWrap > .trpg-nav-toolbar-slot {
    position: absolute;
    top: -42px; right: 14px;
    z-index: 500;
}
#sheetWrap > .trpg-nav-toolbar-slot .searchbar { max-width: 220px; }

.mobile-toolbar-frame {
    display: none;
}
@media (max-width: 768px) {
    .mobile-toolbar-frame {
        display: flex; align-items: center; gap: 10px;
        padding: 10px 15px;
        background-color: var(--surface-soft);
        background-image:
            linear-gradient(color-mix(in srgb, var(--border) 18%, transparent) 1px, transparent 1px),
            linear-gradient(90deg, color-mix(in srgb, var(--border) 18%, transparent) 1px, transparent 1px);
        background-size: 24px 24px;
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
    }
    .mobile-toolbar-frame .trpg-nav-toolbar-slot { flex: 1; min-width: 0; }
    .mobile-toolbar-frame .searchbar { flex: 1; max-width: none; }
}

.searchbar { flex: 1; max-width: 300px; position: relative; }

.table-wrapper {
    position: relative;
    width: 100%; height: 100%; overflow-y: auto; overscroll-behavior: contain;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: inset 1px 1px 0 var(--window-highlight), 3px 4px 0 color-mix(in srgb, var(--border) 24%, transparent);
}
.table-wrapper::-webkit-scrollbar { width: 8px; height: 8px; }
.table-wrapper::-webkit-scrollbar-track { background: transparent; }
.table-wrapper::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--border) 55%, transparent); border-radius: 4px; }
.table-wrapper::-webkit-scrollbar-thumb:hover { background: var(--brand); }

.dt-list-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
}

.sc-table { table-layout: fixed; width: 100%; border-collapse: separate; border-spacing: 0; min-width: 960px; font-size: 12px; }

.sc-table thead th {
    position: sticky; top: 0; z-index: 10;
    background: var(--bg-table-head); color: var(--brand); font-weight: 800; padding: 12px;
    font-size: 12.5px; letter-spacing: .02em;
    text-align: center;
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
}

.sc-table td {
    padding: 12px;
    vertical-align: middle; text-align: center; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 35%, transparent);
}

.sc-subject { text-align: left !important; padding-left: 15px !important; font-weight: 700; color: var(--text) !important; white-space: normal !important; }
.sc-subject .ts-edit,
.sc-subject > span {
    display: block;
    white-space: normal;
    overflow-wrap: break-word;
}
.col-memo { text-align: center !important; color: var(--text-subtle) !important; }
.dt-memo-more {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px;
    padding: 0 0 6px;
    border: 1px solid var(--border); border-radius: 50%;
    background: #fff; color: var(--text-subtle);
    font-size: 12px; font-weight: 800; line-height: 1; letter-spacing: -1px;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.dt-memo-more:hover { border-color: var(--brand); color: var(--brand); background: var(--surface-raised); }

.dt-memo-tooltip {
    display: none;
    position: fixed;
    z-index: 100000;
    max-width: min(260px, calc(100vw - 20px));
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 8px;
    background: rgba(35, 30, 48, .96);
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
}
.dt-memo-tooltip.open { display: block; }

.ts-edit { cursor: pointer; transition: 0.2s; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.dt-check-img { display: inline-block; vertical-align: middle; width: 18px; height: 18px; object-fit: contain; }

.status-badge { display: inline-block; width: 60px; text-align: center; padding: 4px 0; border-radius: 20px; font-size: 12px; font-weight: 800; }
.st-done { background: var(--brand); color: var(--brand-contrast); }
.st-yet { background: color-mix(in srgb, var(--border) 25%, transparent); color: var(--text-subtle); }

tr.is-complete .sc-subject,
tr.is-complete .ts-edit,
.mo-play-card.is-complete .mo-card-title { text-decoration: line-through; color: var(--text-subtle); opacity: 0.65; }
tr.is-complete td { opacity: 0.65; }
.mo-play-card.is-complete { opacity: 0.65; }

.rule-pill {
    display: inline-block;
    vertical-align: middle;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: var(--radius);
    color: #fff;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.35;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: anywhere;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
    box-sizing: border-box;
}
.sc-table td.col-rule {
    overflow: visible;
    white-space: normal;
}

.icon-link {
    display: inline-flex; align-items: center; justify-content: center;
    transition: 0.2s;
}
.icon-link i { font-size: 15px; color: var(--text-subtle); transition: 0.2s; }
.icon-link:hover i { color: var(--brand); }

.grid { display: grid; gap: 15px; }

.pc-view-area { display: block; }
.mobile-view-area { display: none; }

@media (max-width: 768px) {
    .pc-view-area { display: none !important; }
    .mobile-view-area { display: block; }
    .table-frame.trpg-content-frame.pc-view-area {
        padding: 0;
    }

    .searchbar { max-width: 100%; }
    .mo-play-card {
        background: var(--card-bg);
        border: 1px solid var(--border);
        border-radius: var(--radius); margin-bottom: 12px; padding: 16px;
        box-shadow: inset 1px 1px 0 var(--window-highlight);
        position: relative; overflow: hidden;
    }

    .mo-card-top { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }

    .mo-card-title {
        font-size: 16px; font-weight: 700; color: var(--text);
        margin-bottom: 12px; display: block; line-height: 1.4;
    }

    .mo-meta-grid { display: flex; flex-wrap: wrap; gap: 6px; }
    .mo-meta-item {
        background: var(--surface-soft); padding: 4px 8px; border-radius: var(--radius);
        font-size: 12px; color: var(--text-subtle); border: 1px solid var(--border);
    }

    .mo-card-actions {
        display: flex; gap: 12px; margin-top: 12px; padding-top: 12px;
        border-top: 1px dashed var(--border); justify-content: flex-end;
    }
    .mo-action-btn {
        font-size: 12px; color: var(--text-subtle); display: flex; align-items: center; gap: 6px;
        padding: 4px 8px; border-radius: var(--radius); transition: 0.2s;
    }
    .mo-action-btn:hover { background: var(--surface-raised); color: var(--text); }
    .mo-action-btn i { font-size: 13px; }

    .mo-memo {
        margin-top: 12px; padding-top: 12px;
        border-top: 1px dashed var(--border);
        font-size: 12.5px; color: var(--text-subtle); line-height: 1.6;
    }
}

@keyframes modalPop {
    from { transform: scale(0.94); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.ts-modal {
    display: none; position: fixed; inset: 0;
    background: var(--overlay);
    z-index: 9999;
    align-items: center; justify-content: center;
    padding: 12px;
}
.ts-modal.active { display: flex !important; }
.ts-modal .ts-modal-card { animation: modalPop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

#ts-modal .sc-write-table,
#ts-csv-modal .sc-write-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
}
#ts-modal .sc-write-table th,
#ts-csv-modal .sc-write-table th {
    width: 100px;
    padding: 8px 10px 8px 0;
    color: var(--text-subtle);
    font-size: 12px;
    font-weight: 750;
    text-align: left;
    vertical-align: top;
}
#ts-modal .sc-write-table th:not(:empty),
#ts-csv-modal .sc-write-table th:not(:empty) { padding-top: 9px; }
#ts-modal .sc-write-table td,
#ts-csv-modal .sc-write-table td { padding: 0 0 8px; border-bottom: 0; }
#ts-modal .btn_danger { margin-right: auto; }

#ts-modal .role-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
#ts-modal .role-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-subtle);
    font-size: 13px;
    line-height: 1.4;
}

#dt-autosort-modal .autosort-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#dt-autosort-modal .autosort-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-subtle);
    font-size: 13px;
    line-height: 1.4;
}

@media (max-width: 520px) {
    .ts-modal { padding: 8px; }
    #ts-modal .sc-write-table th { width: 76px; }
}
