:root {
    /* OKLCHベースのブラントカラー定義（数学的に正しいハイライト/シャドウ計算用） */
    --brand-black: oklch(20% 0 0);
    --brand-accent: oklch(55% 0.05 60);
    /* #8c7b6c 近似 */
    --brand-gray: oklch(97% 0 0);

    /* 物理的な質感のためのイージング（慣性のある動き） */
    --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out-expo: cubic-bezier(1, 0, 0, 1);
}

body {
    font-feature-settings: "palt";
    font-optical-sizing: auto;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.vertical-text {
    writing-mode: vertical-rl;
    text-orientation: upright;
}

/* 高解像度UI：物理的境界線（見切り） */
.edge-precision {
    position: relative;
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.05);
    /* 物理的な極細の線 */
    transition: transform 0.5s var(--ease-out-quint), box-shadow 0.5s var(--ease-out-quint);
}

.edge-precision:hover {
    transform: translateY(-6px);
    box-shadow:
        0 0 0 0.5px rgba(0, 0, 0, 0.08),
        0 4px 8px rgba(0, 0, 0, 0.02),
        0 15px 30px rgba(0, 0, 0, 0.08);
    /* ホバー時に浮き上がる多層シャドウ */
}

/* 常に表示したい場合（必要であれば） */
.layered-shadow-static {
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 10px 20px rgba(0, 0, 0, 0.04),
        0 20px 40px rgba(0, 0, 0, 0.06);
}

/* ハードウェアアクセラレーション（限定適用） */
.gpu-accelerated {
    will-change: transform, opacity;
    transform: translateZ(0);
}

.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 1.2s var(--ease-out-quint),
        transform 1.2s var(--ease-out-quint);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* スクロールバーの洗練 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: oklch(80% 0 0);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-accent);
}

/* 組織図（横型ツリー構造） */
.org-container {
    padding: 2rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.org-tree {
    display: flex;
    align-items: center;
    padding: 40px;
    min-width: max-content;
    width: fit-content;
    margin: 0 auto;
}

.org-level-1 {
    flex-shrink: 0;
}

/* 主幹線：にじみを防ぐ高解像度設定 */
.org-connector-main {
    width: 40px;
    height: 1px;
    background: rgba(0, 0, 0, 0.15);
    transform: scaleY(0.5);
    flex-shrink: 0;
}

.org-branches {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
    padding-left: 40px;
}

/* 部署レベルの垂直線 */
.org-branch-item {
    display: flex;
    align-items: center;
    position: relative;
}

.org-branch-item::after {
    content: '';
    position: absolute;
    left: -40px;
    top: -1rem;
    bottom: -1rem;
    width: 1px;
    background: rgba(0, 0, 0, 0.15);
    transform: scaleX(0.5);
    transform-origin: center left;
    z-index: 1;
}

.org-branch-item:first-child::after {
    top: 50%;
}

.org-branch-item:last-child::after {
    bottom: 50%;
}

.org-branch-item:only-child::after {
    display: none;
}

/* 部署レベルの水平線（一本に見せるための設定） */
.org-branch-item::before {
    content: '';
    position: absolute;
    left: -40px;
    top: 50%;
    width: 40px;
    height: 1px;
    background: rgba(0, 0, 0, 0.15);
    transform: translateY(-50%) scaleY(0.5);
    transform-origin: center left;
    z-index: 1;
}

.org-node {
    background: white;
    padding: 0.75rem 1.5rem;
    min-width: 160px;
    text-align: center;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    z-index: 2;
    border: 1px solid #e5e7eb;
}

.org-sub-connector {
    width: 30px;
    height: 1px;
    background: rgba(0, 0, 0, 0.15);
    transform: scaleY(0.5);
    flex-shrink: 0;
}

.org-sub-levels {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-left: 30px;
    position: relative;
}

.org-sub-item {
    display: flex;
    align-items: center;
    position: relative;
}

/* 拠点レベルの垂直線 */
.org-sub-item::after {
    content: '';
    position: absolute;
    left: -30px;
    top: -0.5rem;
    bottom: -0.5rem;
    width: 1px;
    background: rgba(0, 0, 0, 0.15);
    transform: scaleX(0.5);
    transform-origin: center left;
    z-index: 1;
}

.org-sub-item:first-child::after {
    top: 50%;
}

.org-sub-item:last-child::after {
    bottom: 50%;
}

.org-sub-item:only-child::after {
    display: none !important;
}

/* 拠点レベルの水平線（一本に見せるための設定） */
.org-sub-item::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 50%;
    width: 30px;
    height: 1px;
    background: rgba(0, 0, 0, 0.15);
    transform: translateY(-50%) scaleY(0.5);
    transform-origin: center left;
    z-index: 1;
}

.org-node-sub {
    background: oklch(98% 0 0);
    padding: 0.5rem 1.25rem;
    min-width: 100px;
    text-align: center;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    border: 1px solid #e5e7eb;
}

/* 単一分岐の修正（ズレ防止） */
.single-branch .org-sub-connector {
    width: 60px;
    /* 30px connector + 30px padding */
}

.single-branch .org-sub-levels {
    padding-left: 0;
}

.single-branch .org-sub-item::before {
    display: none;
}