@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 > #desktop-toolbar-row {
    position: absolute;
    top: -42px; right: 14px;
    display: flex; align-items: center; gap: 10px;
    z-index: 500;
}
#desktop-toolbar-row .searchbar { max-width: 220px; }

.mobile-toolbar-frame {
    display: none;
}
@media (max-width: 768px) {
    .mobile-toolbar-frame {
        display: flex; align-items: center; gap: 10px;
        padding: 6px 11px;
        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; }
    .mobile-toolbar-frame .year-toggle-btn { flex: 0 0 auto; }
}

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

.table-wrapper {
    position: relative;
    z-index: 0;
    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);
}

.pl-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: 1000px; font-size: 12px; }
.sc-table .col-status { width: 80px; }
.sc-table .col-rule { width: 140px; }
.sc-table .col-people { width: 80px; }
.sc-table .col-role { width: 80px; }
.sc-table .col-start { width: 110px; }
.sc-table .col-dash { width: 10px; }
.sc-table .col-end { width: 110px; }
.sc-table .col-info { width: 60px; }
.sc-table .col-log { width: 60px; }
.sc-table .col-pair { width: 100px; }
.sc-table .col-detail { width: 48px; }

.sc-table thead th {
    position: sticky; top: 0; z-index: 10;
    background: var(--bg-table-head); color: var(--text); 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; }

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

.status-badge { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; height: 20px; vertical-align: middle; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1; letter-spacing: 0; min-width: 44px; text-align: center; border: 1px solid transparent; }
.st-done { border-color: var(--status-done); color: var(--status-done); background: var(--status-done-soft); }
.st-prog { border-color: var(--status-prog); color: #ffffff; background: var(--status-prog); }
.st-hold { border-color: var(--status-hold); color: var(--status-hold); background: var(--status-hold-soft); }
.st-plan { border-color: var(--status-plan); color: var(--status-plan); background: color-mix(in srgb, var(--status-plan) 18%, #ffffff); }

.rule-pill {
    display: inline-block;
    vertical-align: middle;
    width: 100%;
    max-width: 116px;
    padding: 3px 6px;
    border: 1px solid transparent;
    text-align: center;
    border-radius: 0;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}
.sc-table td.col-rule {
    overflow: visible;
    white-space: normal;
}
.dday-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border: 1px solid var(--status-plan);
    border-radius: 999px;
    background: color-mix(in srgb, var(--status-plan) 18%, #ffffff);
    color: var(--status-plan);
    font-size: 10px;
    font-weight: 400;
    line-height: 16px;
    vertical-align: middle;
}

.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); }
.icon-link img { display: block; width: 15px; height: 15px; object-fit: contain; }

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

@media (max-width: 768px) {
    .sc-header { flex-direction: column; align-items: stretch; height: auto; gap: 12px; }
    .searchbar { max-width: 100%; }
}

@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,
#ts-rule-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; }

.btn-small-del {
    background: transparent; border: 1px solid var(--danger); color: var(--danger);
    padding: 6px 10px; border-radius: var(--radius); cursor: pointer; font-weight: 700; font-size: 12px;
    flex: 0 0 auto; white-space: nowrap;
    transition: 0.2s;
}
.btn-small-del:hover { background: var(--danger); color: #fff; }

.rl-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.rl-row .rl-color { width: 40px; height: 38px; padding: 0; border: none; background: none; cursor: pointer; }

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

tr.highlight-prog {
    background-color: var(--status-prog-soft);
}
.highlight-prog td:first-child {
    box-shadow: inset 3px 0 0 var(--status-prog);
}

tr.highlight-plan {
    background-color: color-mix(in srgb, var(--status-plan) 12%, #ffffff);
}

tr.highlight-prog .sc-subject {
    color: var(--status-prog) !important;
}

.trpg-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay);
    backdrop-filter: blur(4px);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 12px;
}
.trpg-modal-overlay.open { display: flex; }
