﻿body {
    background-size: 100% auto;
    background-repeat: repeat-y;
    background-color: #0f0f0f;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #e0e0e0;
    margin: 0;
    padding: 0 12px 20px;
}

.service-container {
    max-width: 1200px;
    width: 100%;
    margin: 72px auto 0;
    background: linear-gradient(180deg, var(--svc-gradient-top, rgba(100, 100, 100, 0.11)) 0%, rgba(34, 34, 34, 0) 100%),
    rgba(34, 34, 34, 0.94);
    border: 1px solid rgba(145, 145, 145, 0.24);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    overflow: visible;
}

.service-header {
    text-align: center;
    margin-bottom: 22px;
    border-bottom: 1px solid rgba(145, 145, 145, 0.3);
    padding: 8px 0 14px;
}

.service-header h1 {
    color: #f0f0f0;
    font-size: clamp(1.8rem, 3.1vw, 2.5rem);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1.3px;
}

.service-content {
    display: block;
    overflow: visible;
}

.service-description {
    width: 100%;
}

.service-emblem {
    width: var(--svc-emblem-size, 300px);
    height: var(--svc-emblem-size, 300px);
    float: right;
    margin-left: 20px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-emblem img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    filter: brightness(0.95);
}

.service-description > p {
    margin: 0 0 10px;
    line-height: 1.67;
    color: #cfcfcf;
}

.service-rp-notes {
    width: calc(100% - var(--svc-emblem-size, 300px) - 20px);
    background-color: rgba(56, 56, 56, 0.64);
    padding: 10px 14px;
    border-radius: 6px;
    margin: 16px 0;
    border: 1px solid rgba(145, 145, 145, 0.2);
    border-left: 4px solid var(--svc-accent);
    box-sizing: border-box;
}

.service-rp-notes h3 {
    color: var(--svc-accent);
    margin: 2px 0 6px;
    font-size: 1.02em;
}

.service-rp-notes p {
    margin: 5px 0;
    font-size: 0.9em;
    line-height: 1.56;
}

.service-rp-notes ul {
    margin: 5px 0;
    padding-left: 20px;
    font-size: 0.9em;
    line-height: 1.56;
}

.service-rp-notes li {
    margin-bottom: 4px;
}

.relation-goal-container {
    width: calc(100% - var(--svc-emblem-size, 300px) - 20px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0 0 20px;
    align-items: stretch;
}

.service-goal,
.scp-relation-container {
    background-color: rgba(56, 56, 56, 0.64);
    border: 1px solid rgba(145, 145, 145, 0.2);
    border-left: 4px solid var(--svc-accent);
    border-radius: 6px;
    min-height: 58px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.scp-relation-container {
    padding: 8px 12px;
}

.service-goal {
    padding: 8px 12px;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.service-goal h3,
.service-goal h4 {
    color: var(--svc-accent);
    margin: 0 0 4px;
    font-size: 1.02em;
}

.service-goal p {
    margin: 0;
    color: #d7d7d7;
    line-height: 1.55;
}

.literature-section {
    width: calc(100% - var(--svc-emblem-size, 300px) - 20px);
    background-color: rgba(50, 50, 50, 0.6);
    padding: 15px;
    border-radius: 8px;
    margin: 0 0 20px;
    border-left: 4px solid var(--svc-accent);
    box-sizing: border-box;
}

.literature-title {
    color: var(--svc-accent);
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 10px;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

.literature-links {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

.literature-links li {
    margin-bottom: 8px;
    padding-left: 15px;
    position: relative;
}

.literature-links li::before {
    content: "\203A";
    color: var(--svc-accent);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.literature-links a {
    color: #9d9dff;
    text-decoration: none;
    transition: color 0.3s;
}

.literature-links a:hover {
    text-decoration: underline;
    color: #c0c0ff;
}

.literature-links a.internal-link {
    color: #9d9dff;
    text-decoration: none;
    transition: color 0.3s;
}

.literature-links a.internal-link:hover {
    text-decoration: underline;
    color: #c0c0ff;
}

.popup-trigger {
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.popup-trigger:hover {
    background-color: rgba(67, 67, 67, 0.72);
    border-color: rgba(190, 190, 190, 0.34);
}

.popup-trigger.active {
    border-color: var(--svc-accent);
    background-color: var(--svc-trigger-active-bg, rgba(90, 63, 63, 0.62));
}

.scp-relation-text,
.knowledge-text {
    font-size: 1.02em;
    font-weight: 600;
    margin: 0;
    color: var(--svc-accent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.trigger-indicator {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--svc-accent);
    opacity: 0.85;
}

.indicator-lamp {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(155, 155, 155, 0.42);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.popup-trigger.active .indicator-lamp {
    background: var(--svc-accent);
    box-shadow: 0 0 10px var(--svc-accent);
}

.positions-tabs {
    width: 100%;
    margin-top: 16px;
    background: rgba(49, 49, 49, 0.62);
    border: 1px solid rgba(145, 145, 145, 0.24);
    border-radius: 6px;
    padding: 12px;
    box-sizing: border-box;
    overflow: visible;
    clear: both;
}

.tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
}

.tab-button {
    padding: 10px 16px;
    background-color: rgba(58, 58, 58, 0.72);
    color: #f1f1f1;
    border: 1px solid rgba(145, 145, 145, 0.24);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 600;
    font-size: 0.82rem;
    user-select: none;
}

.tab-button:hover {
    background-color: rgba(72, 72, 72, 0.84);
    border-color: rgba(180, 180, 180, 0.34);
}

.tab-button.active {
    box-shadow: inset 0 0 0 2px var(--svc-accent);
    background-color: var(--svc-tab-active-bg, rgba(91, 63, 63, 0.76));
    border-color: var(--svc-accent);
}

.tab-content {
    display: none;
    background-color: rgba(52, 52, 52, 0.72);
    padding: 14px;
    border-radius: 6px;
    border: 1px solid rgba(145, 145, 145, 0.2);
    border-left: 4px solid var(--svc-accent);
    overflow: visible;
}

.tab-content.active {
    display: block;
}

.position-header {
    margin-bottom: 10px;
}

.position-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.position-title {
    color: var(--svc-accent);
    margin: -2px 0 0;
    font-size: 1.55em;
    line-height: 1.2;
}

.position-meta {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    flex-wrap: wrap;
}

.meta-badge {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #d8d8d8;
    border: 1px solid rgba(145, 145, 145, 0.3);
    background: rgba(38, 38, 38, 0.55);
    border-radius: 4px;
    padding: 4px 7px;
    white-space: nowrap;
}

.position-layout {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 18px;
    align-items: start;
}

.position-layout.no-side {
    grid-template-columns: 1fr;
}

.position-description {
    margin-top: 4px;
    line-height: 1.67;
    color: #d5d5d5;
}

.position-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.position-access-image {
    width: 100%;
    height: 215px;
    overflow: hidden;
    background: transparent;
}

.position-access-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.knowledge-container {
    background-color: rgba(56, 56, 56, 0.66);
    border: 1px solid rgba(145, 145, 145, 0.24);
    border-left: 4px solid var(--svc-accent);
    border-radius: 6px;
    min-height: 58px;
    padding: 9px 12px;
    box-sizing: border-box;
}

.position-rp-notes {
    background-color: rgba(60, 60, 60, 0.58);
    padding: 10px 12px;
    border-radius: 6px;
    margin: 12px 0 0;
    border: 1px solid rgba(145, 145, 145, 0.18);
    border-left: 4px solid var(--svc-accent);
}

.position-rp-notes h4 {
    color: var(--svc-accent);
    margin: 2px 0 6px;
    font-size: 0.95em;
}

.position-rp-notes p {
    margin: 5px 0;
    font-size: 0.9em;
    line-height: 1.55;
}

.position-rp-notes ul {
    margin: 5px 0;
    padding-left: 20px;
    font-size: 0.9em;
    line-height: 1.55;
}

.position-rp-notes li {
    margin-bottom: 4px;
}

.position-subgoal {
    background-color: rgba(60, 60, 60, 0.58);
    padding: 10px 12px;
    border-radius: 6px;
    margin: 12px 0 0;
    border: 1px solid rgba(145, 145, 145, 0.18);
    border-left: 4px solid var(--svc-accent);
}

.position-subgoal h4 {
    color: var(--svc-accent);
    margin: 2px 0 6px;
    font-size: 0.95em;
}

.position-subgoal p {
    margin: 0;
    font-size: 0.9em;
    line-height: 1.55;
}

.floating-popup {
    display: none;
    position: fixed;
    width: 540px;
    max-width: min(92vw, 540px);
    background-color: rgba(28, 28, 28, 0.98);
    border: 1px solid rgba(145, 145, 145, 0.24);
    border-radius: 4px;
    padding: 14px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.78);
    z-index: 2200;
}

.floating-popup.active {
    display: block;
}

.relation-groups {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.relation-group-title {
    font-size: 0.88em;
    margin-bottom: 7px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-bottom: 1px solid;
    padding-bottom: 3px;
}

.relation-group.friendly .relation-group-title {
    color: #5d8c5a;
}

.relation-group.neutral .relation-group-title {
    color: #b5a642;
}

.relation-group.hostile .relation-group-title {
    color: #8c5a5a;
}

.relation-icons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.relation-icon {
    padding: 8px 5px;
    background-color: rgba(50, 50, 50, 0.7);
    border: 1px solid #3a3a3a;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    text-align: center;
    min-height: 35px;
    color: #ccc;
}

.knowledge-section {
    margin-bottom: 12px;
}

.knowledge-section:last-child {
    margin-bottom: 0;
}

.knowledge-section-title {
    color: var(--svc-accent);
    font-size: 1.02em;
    margin-bottom: 8px;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

.knowledge-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.knowledge-item {
    padding: 8px 12px;
    background-color: rgba(50, 50, 50, 0.7);
    border: 1px solid var(--svc-warn, var(--svc-accent));
    border-radius: 3px;
    font-size: 0.9em;
    color: var(--svc-warn, var(--svc-accent));
}

.knowledge-item.green {
    border-color: #5d8c5a;
    color: #5d8c5a;
}

.knowledge-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #3a3a3a;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

@media (max-width: 920px) {
    .position-layout {
        grid-template-columns: 1fr;
    }

    .position-layout.no-side {
        grid-template-columns: 1fr;
    }

    .position-side {
        max-width: 280px;
        width: 100%;
        margin: 0 auto;
    }

    .service-rp-notes,
    .relation-goal-container,
    .literature-section {
        width: 100%;
    }
}

@media (max-width: 768px) {
    body {
        background-size: auto 100%;
        padding: 10px;
    }

    .service-container {
        padding: 14px;
        margin: 10px 0 0;
        width: 100%;
    }

    .service-header h1 {
        font-size: 1.8em;
    }

    .service-emblem {
        width: 200px;
        height: 200px;
        float: none;
        margin: 0 auto 14px;
        display: block;
    }

    .relation-goal-container {
        grid-template-columns: 1fr;
    }

    .tab-buttons {
        flex-direction: column;
    }

    .tab-button {
        width: 100%;
    }

    .relation-icons {
        grid-template-columns: 1fr;
    }
}
