:root {
    --bg: #ffffff;
    --ink: #1f1c17;
    --muted: #5f6673;
    --line: #c9c9c9;
    --accent: #5971b1;
    --accent-dark: #4c63a3;
    --positive: #1e6b4f;
    --negative: #9b3b2f;
    --table-body: #e2e2e2;
    --filter-bg: #c0c1c5;
    --panel-light: #f0f0f0;
    --chip: #c16238;
    --chip-light: #e39674;
    --table-accent: #9eadd6;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Open Sans", system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

body.drawer-open {
    overflow: hidden;
}

.page {
    max-width: 100%;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0;
    width: 100%;
    overflow-x: hidden;
}

.title-bar {
    background: var(--accent);
    color: #ffffff;
    padding: 24px 24px 22px;
    border-bottom: 1px solid var(--line);
    width: 100%;
}

.title-bar h1 {
    margin: 0;
    font-size: clamp(1.9rem, 2.6vw, 2.6rem);
    font-weight: 500;
}

.filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px 18px;
    align-items: center;
    background: var(--filter-bg);
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
    width: 100%;
}

.filters-body {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 12px 18px;
}

.filters-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    grid-column: 1 / -1;
}

.filters-label {
    font-weight: 600;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.checkbox input {
    width: 18px;
    height: 18px;
}

.select {
    display: flex;
    gap: 0;
    align-items: center;
    justify-content: flex-start;
}

.select span {
    font-weight: 600;
    margin-right: 10px;
}

.company-link {
    color: var(--chip);
    text-decoration: none;
}

.company-link:hover {
    text-decoration: underline;
}

.ratings-table a.company-link {
    color: var(--chip) !important;
}

.ratings-table td a.company-link {
    color: var(--chip) !important;
}

.ratings-table td a.company-link:visited {
    color: var(--chip) !important;
}

.select select {
    appearance: none;
    border: 1px solid var(--line);
    padding: 6px 28px 6px 10px;
    background: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    border-radius: 6px;
    width: max-content;
    background-image: linear-gradient(45deg, transparent 50%, #808080 50%),
        linear-gradient(135deg, #808080 50%, transparent 50%),
        linear-gradient(to right, #ffffff, #ffffff);
    background-position: calc(100% - 14px) calc(50% - 3px),
        calc(100% - 9px) calc(50% - 3px),
        100% 0;
    background-size: 5px 5px, 5px 5px, 2.5em 100%;
    background-repeat: no-repeat;
}

.filters-body .select select {
    width: 220px;
    max-width: 100%;
}

.sort-bar {
    display: none;
    align-items: center;
    gap: 16px;
    background: var(--accent);
    color: #ffffff;
    padding: 10px 20px;
    width: 100%;
}

button {
    appearance: none;
    border: 1px solid var(--chip);
    background: var(--chip);
    color: #ffffff;
    padding: 8px 18px;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 6px;
}

.segmented {
    display: inline-flex;
    margin-left: auto;
    border: 1px solid var(--chip-light);
    background: var(--chip);
    border-radius: 6px;
    overflow: hidden;
}

.segmented-btn {
    border: none;
    background: transparent;
    color: inherit;
    border-radius: 0;
    border-right: 1px solid #ffffff;
}

.segmented-btn.active {
    background: var(--chip-light);
    color: #ffffff;
}

.segmented-btn:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.segmented-btn:last-child {
    border-right: none;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.filter-toggle {
    margin-left: auto;
    background: var(--chip);
    color: #ffffff;
}

.filter-toggle.is-active {
    background: var(--chip-light);
    color: #ffffff;
    border-color: transparent;
}

.panel {
    padding: 4px 8px 8px;
    width: 100%;
}

.table-wrap {
    overflow: hidden;
    border: 0;
    width: 100%;
}

#load-sentinel {
    height: 1px;
}

.ratings-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    table-layout: auto;
    background: #ffffff;
}

.ratings-table thead {
    background: var(--chip);
    color: #ffffff;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    text-transform: none;
}

.ratings-table th,
.ratings-table td {
    text-align: left;
    padding: 14px 14px;
    border-bottom: 0;
    font-size: 0.92rem;
}

.ratings-table th.sortable {
    white-space: nowrap;
}

.ratings-table thead th {
    background: var(--chip);
    color: #ffffff;
}

.ratings-table thead th.sorted {
    background: var(--chip-light);
}

.ratings-table thead tr {
    display: table-row;
}

.ratings-table tbody tr {
    border-bottom: 0;
}

.ratings-table th:nth-child(3),
.ratings-table td:nth-child(3) {
    width: 90px;
}

.ratings-table th:nth-child(4),
.ratings-table td:nth-child(4) {
    width: 90px;
}

.ratings-table th:nth-child(5),
.ratings-table td:nth-child(5) {
    width: 140px;
}

.ratings-table th:nth-child(6),
.ratings-table td:nth-child(6) {
    width: 140px;
}

.ratings-table tbody tr:hover {
    background: #d6d6d6;
}

.col-score,
.col-diff {
    width: 90px;
}

.ratings-table td.col-diff {
    text-align: center;
}

.col-date {
    width: 140px;
}

.score-pill {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
}

.diff {
    font-weight: 600;
    color: var(--ink);
}

.mobile-score {
    font-weight: 700;
}

.mobile-meta {
    font-weight: 700;
}

.mobile-meta .diff {
    font-weight: 700;
}

.diff.positive {
    color: var(--positive);
}

.diff.negative {
    color: var(--negative);
}

.text-positive {
    color: var(--positive);
}

.text-negative {
    color: var(--negative);
}

.text-neutral {
    color: #000000;
}


.loading-row td {
    text-align: center;
    color: var(--muted);
    padding: 32px 20px;
}

.ratings-table tbody tr {
    background: var(--panel-light);
}

.ratings-table tbody td {
    background: var(--panel-light);
}

.ratings-table tbody td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.ratings-table tbody td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.ratings-table th:nth-child(6),
.ratings-table th:nth-child(7),
.ratings-table th:nth-child(8),
.ratings-table td:nth-child(6),
.ratings-table td:nth-child(7),
.ratings-table td:nth-child(8) {
    width: 8.3333%;
    background: var(--chip);
    color: #ffffff;
}

.ratings-table td:nth-child(6),
.ratings-table td:nth-child(7),
.ratings-table td:nth-child(8) {
    background: #dee3ef;
    color: var(--ink);
}

.sortable {
    cursor: pointer;
    user-select: none;
}

.sort-icon {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #ffffff;
    transform: none;
    vertical-align: middle;
    margin-left: 6px;
}

.sorted.asc .sort-icon {
    border-top: none;
    border-bottom: 6px solid #ffffff;
}

.sorted.desc .sort-icon {
    border-top: 6px solid #ffffff;
}

.mobile-list {
    display: none;
    border-top: 1px solid #ffffff;
    background: #ffffff;
    padding: 4px 8px 8px;
    max-width: 100%;
}

.mobile-card {
    background: var(--table-body);
    border: 1px solid #ffffff;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 4px;
    padding: 14px 18px;
    background-clip: padding-box;
    max-width: 100%;
}

.mobile-card-header {
    display: grid;
    gap: 4px;
    font-weight: 400;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.9);
}

.mobile-title,
.mobile-updated {
    font-weight: 400;
}

.mobile-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: #000000;
}

.mobile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    color: rgba(0, 0, 0, 0.9);
    font-size: 0.9rem;
}

.mobile-meta .diff.positive {
    color: var(--positive);
}

.mobile-meta .diff.negative {
    color: var(--negative);
}

.mobile-meta .diff {
    color: var(--ink);
}

.mobile-title.company-link {
    color: var(--chip) !important;
}

.mobile-updated,
.mobile-meta {
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.9);
    font-weight: 400;
}


.mobile-extra {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    background: #cfd6e6;
    margin: 12px -18px -14px;
    padding: 12px 18px;
    font-size: 0.92rem;
}

.mobile-action {
    text-align: right;
}

.mobile-recommendation {
    margin-left: auto;
    text-align: right;
}
@media (max-width: 960px) {
    .filters-body {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 760px) {
    .page {
        padding: 0;
    }

    .filters {
        grid-template-columns: 1fr;
        padding: 0 16px;
        gap: 0;
        max-width: 100%;
        overflow-x: hidden;
        background: var(--filter-bg);
    }

    .filters-body {
        display: none;
        grid-template-columns: 1fr;
        gap: 10px 14px;
        padding-bottom: 10px;
        background: var(--filter-bg);
    }

    .filters-body .select select {
        width: 60vw;
        max-width: 60vw;
        min-width: 0;
    }

    .filters.is-open .filters-body {
        display: grid;
    }

    .filters-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 0;
        border-bottom: 0;
    }

    .filter-toggle {
        margin: 0;
    }

    .sort-bar {
        display: flex;
        padding: 10px 16px;
    }

    .panel {
        display: none;
    }

    .mobile-list {
        display: block;
    }
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 20;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 50%;
    max-width: 900px;
    background: #ffffff;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 30;
    box-shadow: -8px 0 20px rgba(0, 0, 0, 0.15);
}

.drawer iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.drawer.is-open {
    transform: translateX(0);
}

.drawer-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 979px) {
    .drawer,
    .drawer-overlay {
        display: none;
    }
}

.detail-page {
    width: 100%;
    max-width: 100%;
    background: #ffffff;
}

.detail-header {
    background: var(--accent);
    color: #ffffff;
    padding: 18px 18px 14px;
}

.detail-back-row {
    background: var(--table-body);
    padding: 10px 18px;
    border-bottom: 1px solid #ffffff;
}

@media (min-width: 768px) {
    .is-embedded .detail-back-row {
        display: none;
    }
}

.is-embedded-wide .detail-back-row {
    display: none;
}

.detail-back-link {
    display: inline-block;
    color: var(--chip);
    text-decoration: none;
    font-weight: 600;
}

.detail-back-link:hover {
    text-decoration: underline;
}

.detail-card {
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
}

.detail-company {
    background: var(--accent);
    color: #ffffff;
    padding: 16px 18px;
}

.detail-company h2 {
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.detail-section h2 {
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.detail-heading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.info-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid #ffffff;
    color: #ffffff;
    background: var(--filter-bg);
    font-size: 0.8rem;
    line-height: 1;
    cursor: help;
    outline: none;
}

.info-tip::before {
    content: "?";
    font-weight: 700;
}

.info-tip-text {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    transform: translate(var(--tip-shift, 0px), -4px);
    min-width: 220px;
    max-width: 320px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--ink);
    font-size: 0.82rem;
    line-height: 1.4;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 5;
}

.info-tip:hover .info-tip-text,
.info-tip.is-open .info-tip-text,
.info-tip:focus-visible .info-tip-text {
    opacity: 1;
    transform: translate(var(--tip-shift, 0px), 0);
}

.info-tip:focus-visible {
    box-shadow: 0 0 0 2px rgba(89, 113, 177, 0.35);
}

@media (max-width: 640px) {
    .info-tip-text {
        max-width: 85vw;
    }
}

.detail-meta {
    font-size: 0.92rem;
    line-height: 1.5;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 12px;
}

.detail-meta-plain {
    margin-top: 8px;
}

.detail-strip {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 18px;
    background: #cfd6e6;
    font-size: 0.92rem;
    border-top: 1px solid #ffffff;
}

.detail-section {
    margin: 0;
    padding: 12px 16px;
    background: transparent;
    border-radius: 0;
}

.detail-section h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.detail-line {
    display: block;
    font-size: 0.92rem;
    margin-bottom: 6px;
}

.detail-strong {
    font-weight: 700;
}

.detail-strong .diff {
    font-weight: 700;
}

.detail-muted {
    color: var(--muted);
}

.detail-content {
    margin: 4px 8px 8px;
    border-radius: 18px;
    overflow: hidden;
    background: var(--table-body);
    border: 1px solid #ffffff;
}

.detail-block {
    background: transparent;
}

.detail-content > .detail-block + .detail-block,
.detail-content > .detail-group + .detail-block,
.detail-content > .detail-block + .detail-group,
.detail-content > .detail-group + .detail-group {
    border-top: 1px solid #ffffff;
}

.detail-group .detail-block {
    border-top: 0;
}
/* gitea test: style change marker */
