.twtf-timeonline {
    --twtf-bg: #0d141c;
    --twtf-panel: #151b26;
    --twtf-panel-2: #1a2230;
    --twtf-border: rgba(148, 163, 184, 0.28);
    --twtf-text: #e5e7eb;
    --twtf-muted: #9ca3af;
    --twtf-green: #22c55e;
    --twtf-red: rgba(248, 113, 113, 0.22);
    color: var(--twtf-text);
}

.twtf-timeonline * {
    box-sizing: border-box;
}

.twtf-timeonline__search {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto;
    gap: 10px;
    align-items: end;
    padding: 14px;
    margin-bottom: 16px;
    background: var(--twtf-bg);
    border: 1px solid var(--twtf-border);
    border-radius: 8px;
}

.twtf-timeonline__search label {
    display: grid;
    gap: 5px;
    margin: 0;
    color: var(--twtf-muted);
    font-size: 12px;
    font-weight: 600;
}

.twtf-timeonline__search input,
.twtf-timeonline__search select {
    width: 100%;
    min-height: 38px;
    color: var(--twtf-text);
    background: #090e15;
    border: 1px solid var(--twtf-border);
    border-radius: 6px;
    padding: 7px 10px;
}

.twtf-timeonline__search button {
    min-height: 38px;
    padding: 0 18px;
    border: 0;
    border-radius: 6px;
    color: #06210f;
    background: var(--twtf-green);
    font-weight: 700;
    cursor: pointer;
}

.twtf-timeonline__empty,
.twtf-timeonline__header,
.twtf-timeonline__summary,
.twtf-timeonline__panel {
    background: var(--twtf-bg);
    border: 1px solid var(--twtf-border);
    border-radius: 8px;
}

.twtf-timeonline__empty {
    padding: 22px;
    color: var(--twtf-muted);
    text-align: center;
}

.twtf-timeonline__header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 18px;
    margin-bottom: 14px;
}

.twtf-timeonline__header h2,
.twtf-timeonline__panel h3 {
    margin: 0;
    color: #fff;
    letter-spacing: 0;
}

.twtf-timeonline__header h2 {
    font-size: 22px;
}

.twtf-timeonline__header p,
.twtf-timeonline__updated {
    margin: 4px 0 0;
    color: var(--twtf-muted);
    font-size: 12px;
}

.twtf-timeonline__summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 1px;
    overflow: hidden;
    margin-bottom: 14px;
}

.twtf-timeonline__summary div {
    padding: 12px;
    background: var(--twtf-panel);
}

.twtf-timeonline__summary span {
    display: block;
    color: var(--twtf-muted);
    font-size: 11px;
    line-height: 1.2;
}

.twtf-timeonline__summary strong {
    display: block;
    margin-top: 5px;
    color: #fff;
    font-size: 15px;
}

.twtf-timeonline__panel {
    padding: 16px;
    margin-bottom: 14px;
}

.twtf-timeonline__panel h3 {
    margin-bottom: 12px;
    font-size: 15px;
}

.twtf-timeonline__chart-wrap {
    height: 280px;
    position: relative;
}

.twtf-timeonline__legend {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
    color: var(--twtf-muted);
    font-size: 12px;
}

.twtf-timeonline__dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    margin-right: 6px;
    border-radius: 2px;
    vertical-align: -1px;
}

.twtf-timeonline__dot--online {
    background: var(--twtf-green);
}

.twtf-timeonline__dot--offline {
    background: var(--twtf-red);
}

.twtf-timeonline__hours {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    margin-left: 84px;
    margin-right: 66px;
    margin-bottom: 4px;
    color: #6b7280;
    font: 10px/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.twtf-timeonline__hours span:not(:first-child) {
    text-align: center;
}

.twtf-timeonline__hours span:last-child {
    text-align: right;
}

.twtf-timeonline__row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 2px 4px;
    margin: 0 -4px;
    border-radius: 4px;
    transition: background-color 0.15s;
}

.twtf-timeonline__row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.twtf-timeonline__day {
    width: 76px;
    flex: 0 0 76px;
    text-align: right;
    color: var(--twtf-muted);
    font: 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.twtf-timeonline__bar {
    display: flex;
    flex: 1 1 auto;
    height: 22px;
    overflow: hidden;
    background: #090e15;
    border-radius: 3px;
    transition: filter 0.15s, box-shadow 0.15s;
}

.twtf-timeonline__row:hover .twtf-timeonline__bar {
    filter: brightness(1.2);
    box-shadow: 0 0 0 1px rgba(156, 163, 175, 0.32);
}

.twtf-timeonline__seg {
    display: block;
    height: 100%;
    transition: filter 0.1s, outline 0.1s;
    cursor: crosshair;
}

.twtf-timeonline__seg--online {
    background: var(--twtf-green);
}

.twtf-timeonline__seg--offline {
    background: var(--twtf-red);
}

.twtf-timeonline__seg:hover {
    filter: brightness(1.35);
    outline: 2px solid rgba(229, 231, 235, 0.5);
    outline-offset: -1px;
    z-index: 1;
}

.twtf-timeonline__total {
    width: 58px;
    flex: 0 0 58px;
    text-align: right;
    color: var(--twtf-muted);
    font: 11px/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.twtf-timeonline__tooltip {
    position: fixed;
    z-index: 99999;
    max-width: 240px;
    padding: 9px 11px;
    color: var(--twtf-text);
    background: rgba(13, 20, 28, 0.96);
    border: 1px solid var(--twtf-border);
    border-radius: 8px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
    font-size: 12px;
    pointer-events: none;
}

.twtf-timeonline__tooltip strong {
    color: #fff;
}

@media (max-width: 700px) {
    .twtf-timeonline__search,
    .twtf-timeonline__header {
        display: block;
    }

    .twtf-timeonline__search label,
    .twtf-timeonline__search button {
        margin-top: 10px;
    }

    .twtf-timeonline__hours {
        margin-left: 0;
        margin-right: 0;
    }

    .twtf-timeonline__row {
        display: grid;
        grid-template-columns: 1fr 58px;
    }

    .twtf-timeonline__day {
        width: auto;
        text-align: left;
    }

    .twtf-timeonline__bar {
        grid-column: 1 / -1;
        order: 3;
    }
}

.twtf-table-wrap,
.twtf-character-page {
    width: 100%;
}

.twtf-inline-search {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    margin: 0 0 18px;
}

.twtf-inline-search input,
.twtf-inline-search select {
    min-width: 180px;
}

.twtf-character-page__head {
    margin: 0 0 22px;
}

.twtf-character-page__head h1 {
    margin-bottom: 4px;
}

.twtf-character-page h2 {
    margin-top: 28px;
    margin-bottom: 12px;
}

.twtf-kv-table th {
    width: 240px;
}

.twtf-deaths td,
.twtf-deaths th,
.twtf-history-table td,
.twtf-history-table th,
.twtf-kv-table td,
.twtf-kv-table th {
    vertical-align: top;
}
